id stringlengths 14 16 | text stringlengths 4 1.28k | source stringlengths 54 121 |
|---|---|---|
0e0436a883fe-611 | property lc_secrets: Dict[str, str]ο
Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
Return whether or not the class is serializable. | https://api.python.langchain.com/en/latest/modules/llms.html |
f325f365341c-0 | Base classesο
Common schema objects.
langchain.schema.get_buffer_string(messages, human_prefix='Human', ai_prefix='AI')[source]ο
Get buffer string of messages.
Parameters
messages (List[langchain.schema.BaseMessage]) β
human_prefix (str) β
ai_prefix (str) β
Return type
str
class langchain.schema.AgentAction(tool, to... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-1 | Alias for field number 0
log: strο
Alias for field number 1
count(value, /)ο
Return number of occurrences of value.
index(value, start=0, stop=9223372036854775807, /)ο
Return first index of value.
Raises ValueError if the value is not present.
class langchain.schema.Generation(*, text, generation_info=None)[source]ο
Ba... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-2 | Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallowβ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-3 | the new model: you should trust this data
deep (bool) β set to True to make a deep copy of the model
self (Model) β
Returns
new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionar... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-4 | Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)ο
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an opti... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-5 | models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
localns (Any) β
Return type
None
property lc_attributes: Dictο
Return a list of attribute names that should be include... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-6 | This class is LangChain serializable.
class langchain.schema.BaseMessage(*, content, additional_kwargs=None)[source]ο
Bases: langchain.load.serializable.Serializable
Message object.
Parameters
content (str) β
additional_kwargs (dict) β
Return type
None
classmethod construct(_fields_set=None, **values)ο
Creates a new ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-7 | Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) β values to change/add in the new ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-8 | Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclu... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-9 | exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod upda... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-10 | Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets: Dict[str, str]ο
Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
This class is LangChain serializable.
abstract property type: strο
Typ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-11 | Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallowβ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-12 | the new model: you should trust this data
deep (bool) β set to True to make a deep copy of the model
self (Model) β
Returns
new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionar... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-13 | Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)ο
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an opti... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-14 | models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
localns (Any) β
Return type
None
property lc_attributes: Dictο
Return a list of attribute names that should be include... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-15 | This class is LangChain serializable.
property type: strο
Type of the message, used for serialization.
class langchain.schema.AIMessage(*, content, additional_kwargs=None, example=False)[source]ο
Bases: langchain.schema.BaseMessage
Type of message that is spoken by the AI.
Parameters
content (str) β
additional_kwargs ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-16 | Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingI... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-17 | new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
Parameters
include (Optional[Union[A... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-18 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
exclude (Optional[Union[AbstractSetIntStr, Map... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-19 | Return type
None
property lc_attributes: Dictο
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]ο
Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets:... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-20 | Parameters
content (str) β
additional_kwargs (dict) β
Return type
None
classmethod construct(_fields_set=None, **values)ο
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallowβ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-21 | exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) β values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-22 | by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-23 | exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
l... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-24 | Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
This class is LangChain serializable.
property type: strο
Type of the message, used for serialization.
class langchain.schema.FunctionMessage(*, content, additional_kwargs=None, name)[sourc... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-25 | Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to include in ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-26 | new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
Parameters
include (Optional[Union[A... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-27 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
exclude (Optional[Union[AbstractSetIntStr, Map... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-28 | Return type
None
property lc_attributes: Dictο
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]ο
Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets:... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-29 | Type of message with arbitrary speaker.
Parameters
content (str) β
additional_kwargs (dict) β
role (str) β
Return type
None
classmethod construct(_fields_set=None, **values)ο
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validat... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-30 | exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) β values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-31 | by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-32 | exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
l... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-33 | Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
This class is LangChain serializable.
property type: strο
Type of the message, used for serialization.
langchain.schema.messages_to_dict(messages)[source]ο
Convert messages to dict.
Paramet... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-34 | Bases: langchain.schema.Generation
Output of a single generation.
Parameters
text (str) β
generation_info (Optional[Dict[str, Any]]) β
message (langchain.schema.BaseMessage) β
Return type
None
attribute generation_info: Optional[Dict[str, Any]] = Noneο
Raw generation info response from the provider
attribute text: s... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-35 | Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingI... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-36 | new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
Parameters
include (Optional[Union[A... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-37 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
exclude (Optional[Union[AbstractSetIntStr, Map... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-38 | Return type
None
property lc_attributes: Dictο
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]ο
Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets:... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-39 | Return type
None
classmethod construct(_fields_set=None, **values)ο
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallowβ was set since it adds all passed values
Parameters
_fie... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-40 | update (Optional[DictStrAny]) β values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool) β set to True to make a deep copy of the model
self (Model) β
Returns
new model instance
Return type
Model
dict(*, include=None, exclude=None, by_... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-41 | exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)ο
Generate a JSON representation of the model, include and e... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-42 | exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
localns (Any) β
Return type
None
class langchain.sc... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-43 | List of the things generated.
attribute llm_output: Optional[dict] = Noneο
For arbitrary LLM provider specific output.
classmethod construct(_fields_set=None, **values)ο
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is p... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-44 | exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) β values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-45 | by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-46 | exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
l... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-47 | Return type
None
attribute generations: List[List[langchain.schema.Generation]] [Required]ο
List of the things generated. This is List[List[]] because
each input could have multiple generations.
attribute llm_output: Optional[dict] = Noneο
For arbitrary LLM provider specific output.
attribute run: Optional[List[langcha... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-48 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to include in new model
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes preced... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-49 | Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
flatten()[source]ο
Flatten ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-50 | encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β
by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bo... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-51 | Bases: langchain.load.serializable.Serializable, abc.ABC
Return type
None
classmethod construct(_fields_set=None, **values)ο
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallow... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-52 | exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) β values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-53 | by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-54 | exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
abstract to_messages()[source]ο
Return prompt as messages.
Return type
List[langchain.schema.BaseMessage]
abstract to_string()[source]ο... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-55 | property lc_namespace: List[str]ο
Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets: Dict[str, str]ο
Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
Return whether or not the class is s... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-56 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallowβ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choo... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-57 | the new model: you should trust this data
deep (bool) β set to True to make a deep copy of the model
self (Model) β
Returns
new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionar... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-58 | Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)ο
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an opti... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-59 | models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
abstract load_memory_variables(inputs)[source]ο
Return key-value pairs given the text input to the chain.
If None, return all memories
Parameters
inputs (Dict[str, Any]) β
Return type
Dict[str, Any]
abstract save_context(inputs, outputs)[source]ο
Save ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-60 | serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]ο
Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets: Dict[str, str]ο
Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_K... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-61 | message (str) β
Return type
None
add_ai_message(message)[source]ο
Add an AI message to the store
Parameters
message (str) β
Return type
None
add_message(message)[source]ο
Add a self-created message to the store
Parameters
message (langchain.schema.BaseMessage) β
Return type
None
abstract clear()[source]ο
Remove all ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-62 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = βallowβ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choo... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-63 | the new model: you should trust this data
deep (bool) β set to True to make a deep copy of the model
self (Model) β
Returns
new model instance
Return type
Model
dict(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False)ο
Generate a dictionar... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-64 | Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True, **dumps_kwargs)ο
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an opti... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-65 | models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
classmethod update_forward_refs(**localns)ο
Try to update ForwardRefs on fields based on this Model, globalns and localns.
Parameters
localns (Any) β
Return type
None
property lc_attributes: Dictο
Return a list of attribute names that should be include... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-66 | property lc_serializable: boolο
Return whether or not the class is serializable.
class langchain.schema.BaseRetriever[source]ο
Bases: abc.ABC
Base interface for retrievers.
abstract get_relevant_documents(query)[source]ο
Get documents relevant for a query.
Parameters
query (str) β string to find relevant documents for
... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-67 | Bases: langchain.load.serializable.Serializable, abc.ABC, Generic[langchain.schema.T]
Return type
None
classmethod construct(_fields_set=None, **values)ο
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behave... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-68 | exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to exclude from new model, as with values this takes precedence over include
update (Optional[DictStrAny]) β values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep (bool... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-69 | by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
Return type
DictStrAny
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=None, models_as_dict=True... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-70 | exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
abstract parse_result(result)[source]ο
Parse LLM Result.
Parameters
result (List[langchain.schema.Generation]) β
Return type
langchain... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-71 | Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets: Dict[str, str]ο
Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
Return whether or not the class is serializable.
class langchain.schem... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-72 | Behaves as if Config.extra = βallowβ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-73 | self (Model) β
Returns
new model instance
Return type
Model
dict(**kwargs)[source]ο
Return dictionary representation of output parser.
Parameters
kwargs (Any) β
Return type
Dict
get_format_instructions()[source]ο
Instructions on how the LLM output should be formatted.
Return type
str
json(*, include=None, exclude=Non... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-74 | by_alias (bool) β
skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
abstract parse(text)[source]ο
Parse the output of an LLM call.
A method which take... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-75 | Optional method to parse the output of an LLM call with a prompt.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion (str) β output of language model
prompt (langchain.schema.PromptValue) β prom... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-76 | Return the namespace of the langchain object.
eg. [βlangchainβ, βllmsβ, βopenaiβ]
property lc_secrets: Dict[str, str]ο
Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
Return whether or not the class is serializable.
class langchain.schem... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-77 | Parameters
_fields_set (Optional[SetStr]) β
values (Any) β
Return type
Model
copy(*, include=None, exclude=None, update=None, deep=False)ο
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) β fields to include in ... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-78 | Model
dict(**kwargs)ο
Return dictionary representation of output parser.
Parameters
kwargs (Any) β
Return type
Dict
get_format_instructions()ο
Instructions on how the LLM output should be formatted.
Return type
str
json(*, include=None, exclude=None, by_alias=False, skip_defaults=None, exclude_unset=False, exclude_def... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-79 | skip_defaults (Optional[bool]) β
exclude_unset (bool) β
exclude_defaults (bool) β
exclude_none (bool) β
encoder (Optional[Callable[[Any], Any]]) β
models_as_dict (bool) β
dumps_kwargs (Any) β
Return type
unicode
parse(text)[source]ο
Parse the output of an LLM call.
A method which takes in a string (assumed outpu... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-80 | The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
completion (str) β output of language model
prompt (langchain.schema.PromptValue) β prompt value
Returns
structured output
Return type
Any
classmethod upd... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-81 | Return a map of constructor argument names to secret ids.
eg. {βopenai_api_keyβ: βOPENAI_API_KEYβ}
property lc_serializable: boolο
Return whether or not the class is serializable.
exception langchain.schema.OutputParserException(error, observation=None, llm_output=None, send_to_llm=False)[source]ο
Bases: ValueError
Exc... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
f325f365341c-82 | Exception.add_note(note) β
add a note to the exception
with_traceback()ο
Exception.with_traceback(tb) β
set self.__traceback__ to tb and return self.
class langchain.schema.BaseDocumentTransformer[source]ο
Bases: abc.ABC
Base interface for transforming documents.
abstract transform_documents(documents, **kwargs)[source... | https://api.python.langchain.com/en/latest/modules/base_classes.html |
07ceff43f477-0 | Chainsο
Chains are easily reusable components which can be linked together.
class langchain.chains.APIChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, api_request_chain, api_answer_chain, requests_wrapper, api_docs, question_key='question', output_key='output')[source]ο
Bases: langc... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-1 | api_answer_chain (langchain.chains.llm.LLMChain) β
requests_wrapper (langchain.requests.TextRequestsWrapper) β
api_docs (str) β
question_key (str) β
output_key (str) β
Return type
None
attribute api_answer_chain: LLMChain [Required]ο
attribute api_docs: str [Required]ο
attribute api_request_chain: LLMChain [Requir... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-2 | for full details.
attribute memory: Optional[BaseMemory] = Noneο
Optional memory object. Defaults to None.
Memory is a class that gets called at the start
and at the end of every chain. At the start, memory loads variables and passes
them along in the chain. At the end, it saves any returned variables.
There are many d... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-3 | will be printed to the console. Defaults to langchain.verbose value.
async acall(inputs, return_only_outputs=False, callbacks=None, *, tags=None, include_run_info=False)ο
Run the logic of this chain and add to output if desired.
Parameters
inputs (Union[Dict[str, Any], Any]) β Dictionary of inputs, or single input if c... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-4 | use the callbacks provided to the chain.
include_run_info (bool) β Whether to include run info in the response. Defaults
to False.
tags (Optional[List[str]]) β
Return type
Dict[str, Any]
apply(input_list, callbacks=None)ο
Call the chain on all inputs in the list.
Parameters
input_list (List[Dict[str, Any]]) β
callbac... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-5 | tags (Optional[List[str]]) β
kwargs (Any) β
Return type
str
dict(**kwargs)ο
Return dictionary representation of chain.
Parameters
kwargs (Any) β
Return type
Dict | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-6 | classmethod from_llm_and_api_docs(llm, api_docs, headers=None, api_url_prompt=PromptTemplate(input_variables=['api_docs', 'question'], output_parser=None, partial_variables={}, template='You are given the below API Documentation:\n{api_docs}\nUsing this documentation, generate the full API url to call for answering the... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-7 | the full API url to call for answering the user question.\nYou should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call.\n\nQuestion:{questi... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-8 | Load chain from just an LLM and the api docs.
Parameters
llm (langchain.base_language.BaseLanguageModel) β
api_docs (str) β
headers (Optional[dict]) β
api_url_prompt (langchain.prompts.base.BasePromptTemplate) β
api_response_prompt (langchain.prompts.base.BasePromptTemplate) β
kwargs (Any) β
Return type
langchain... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-9 | Return type
Dict[str, str]
run(*args, callbacks=None, tags=None, **kwargs)ο
Run the chain as text in, text out or multiple variables, text out.
Parameters
args (Any) β
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) β
tags (Optional[List[st... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-10 | to_json_not_implemented()ο
Return type
langchain.load.serializable.SerializedNotImplemented
property lc_attributes: Dictο
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]ο
Return the namespace of the... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-11 | class langchain.chains.AnalyzeDocumentChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, input_key='input_document', text_splitter=None, combine_docs_chain)[source]ο
Bases: langchain.chains.base.Chain
Chain that splits documents, then analyzes it in pieces.
Parameters
memory (Optional... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-12 | Return type
None
attribute callback_manager: Optional[BaseCallbackManager] = Noneο
Deprecated, use callbacks instead.
attribute callbacks: Callbacks = Noneο
Optional list of callback handlers (or callback manager). Defaults to None.
Callback handlers are called throughout the lifecycle of a call to a chain,
starting wi... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-13 | There are many different types of memory - please see memory docs
for the full catalog.
attribute tags: Optional[List[str]] = Noneο
Optional list of tags associated with the chain. Defaults to None
These tags will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-14 | Parameters
inputs (Union[Dict[str, Any], Any]) β Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs (bool) β boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generat... | https://api.python.langchain.com/en/latest/modules/chains.html |
07ceff43f477-15 | Parameters
input_list (List[Dict[str, Any]]) β
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) β
Return type
List[Dict[str, str]]
async arun(*args, callbacks=None, tags=None, **kwargs)ο
Run the chain as text in, text out or multiple variabl... | https://api.python.langchain.com/en/latest/modules/chains.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.