dspy.Signature
dspy.Signature
Bases: BaseModel
Functions
append(name, field, type_=None) -> Type[Signature]
classmethod
delete(name) -> Type[Signature]
classmethod
Source code in dspy/signatures/signature.py
dump_state()
classmethod
Source code in dspy/signatures/signature.py
equals(other) -> bool
classmethod
Compare the JSON schema of two Signature classes.
Source code in dspy/signatures/signature.py
insert(index: int, name: str, field, type_: Type = None) -> Type[Signature]
classmethod
Source code in dspy/signatures/signature.py
load_state(state)
classmethod
Source code in 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
Create a new Signature class with the updated field information.
Returns a new Signature class with the field, name, updated with fields[name].json_schema_extra[key] = value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
The name of the field to update. |
required | |
type_
|
The new type of the field. |
None
|
|
**kwargs
|
The new values for the field. |
{}
|
Returns:
Type | Description |
---|---|
Type[Signature]
|
A new Signature class (not an instance) with the updated field information. |