dspy.Signature
dspy.Signature
基类: BaseModel
函数
append(name, field, type_=None) -> Type[Signature]
classmethod
delete(name) -> Type[Signature]
classmethod
源代码位于 dspy/signatures/signature.py
dump_state()
classmethod
源代码位于 dspy/signatures/signature.py
equals(other) -> bool
classmethod
比较两个 Signature 类的 JSON schema。
源代码位于 dspy/signatures/signature.py
insert(index: int, name: str, field, type_: Optional[Type] = None) -> Type[Signature]
classmethod
源代码位于 dspy/signatures/signature.py
load_state(state)
classmethod
源代码位于 dspy/signatures/signature.py
prepend(name, field, type_=None) -> Type[Signature]
classmethod
with_instructions(instructions: str) -> Type[Signature]
classmethod
with_updated_fields(name, type_=None, **kwargs) -> Type[Signature]
classmethod
创建一个带有更新字段信息的新 Signature 类。
返回一个新的 Signature 类,其中字段 name 通过 fields[name].json_schema_extra[key] = value 进行更新。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
name
|
要更新的字段名称。 |
必填 | |
type_
|
字段的新类型。 |
无
|
|
**kwargs
|
字段的新值。 |
{}
|
返回值
类型 | 描述 |
---|---|
Type[Signature]
|
一个新的 Signature 类(非实例),包含更新后的字段信息。 |