Pydantic
PydanticProgramExtractor #
基类: BaseExtractor
, Generic[Model]
Pydantic 程序提取器。
使用 LLM 提取 Pydantic 对象。在字典中返回该对象的属性。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
program
|
BasePydanticProgram[TypeVar]
|
要提取的 Pydantic 程序。 |
必需的 |
input_key
|
str
|
用作程序输入的键 (程序模板字符串必须公开此键)。 |
'input'
|
extract_template_str
|
str
|
用于提取的模板。 |
'Here is the content of the section:\n----------------\n{context_str}\n----------------\nGiven the contextual information, extract out a {class_name} object.'
|
源代码位于 llama-index-core/llama_index/core/extractors/metadata_extractors.py
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
|
aextract async
#
aextract(nodes: Sequence[BaseNode]) -> List[Dict]
提取 pydantic 程序。
源代码位于 llama-index-core/llama_index/core/extractors/metadata_extractors.py
514 515 516 517 518 519 520 521 522 523 524 |
|