Git Product home page Git Product logo

Comments (3)

userpj avatar userpj commented on September 3, 2024

参考使用文档:https://github.com/baidubce/app-builder/blob/master/docs/basic_module/knowledgebase.md
7、导入知识库。
DocumentChunker类下的choices变量,["onePage"]为整文件切片。

from app-builder.

xueyayang avatar xueyayang commented on September 3, 2024

参考使用文档:https://github.com/baidubce/app-builder/blob/master/docs/basic_module/knowledgebase.md 7、导入知识库。 DocumentChunker类下的choices变量,["onePage"]为整文件切片。

thx a lot. I will try later, then close this issue.

from app-builder.

xueyayang avatar xueyayang commented on September 3, 2024

可以了。按照文档选 onePage 可以上传。此问题已解决。

另外一个小问题,separator 参数是必须的,但文档里写是 Optional.

File "C:\Python312\Lib\site-packages\pydantic\main.py", line 171, in init
self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for DocumentChunker
separator >>>>>>>>>>>>>>>>> 这里显示错误
Field required [type=missing, input_value={'choices': ['onePage'], 'prependInfo': []}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.6/v/missing

class DocumentChunker(BaseModel):
    choices: list[str] = Field(..., description="使用哪些chunker方法 (separator | pattern | onePage), separator:自定义切片—标识符,pattern:自定义切片—标识符中选择正则表达式,onePage:整文件切片")
    prependInfo: list[str] = Field(
        ...,
        description="chunker关联元数据,可选值为title (增加标题), filename(增加文件名)",
    )
    separator: Optional[DocumentSeparator] = Field(..., description="分段符号")   # 这里显示是Optional
    pattern: Optional[DocumentPattern] = Field(None, description="正则表达式")

from app-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.