id
stringlengths
14
15
text
stringlengths
49
2.47k
source
stringlengths
61
166
6582e7b8a9ac-4
classmethod validate(value: Any) → Model¶ with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseOutputParser.html
328b9e313def-0
langchain.schema.messages.AIMessage¶ class langchain.schema.messages.AIMessage[source]¶ Bases: BaseMessage A Message from an AI. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param additional_kwargs: dict ...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.AIMessage.html
328b9e313def-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.AIMessage.html
328b9e313def-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.AIMessage.html
ea8d4b1c058c-0
langchain.schema.runnable.RunnableBinding¶ class langchain.schema.runnable.RunnableBinding[source]¶ Bases: Serializable, Runnable[Input, Output] Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param bound: l...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableBinding.html
ea8d4b1c058c-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableBinding.html
ea8d4b1c058c-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableBinding.html
ea8d4b1c058c-3
classmethod validate(value: Any) → Model¶ with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableBinding.html
81ce7b24fd20-0
langchain.schema.runnable.Runnable¶ class langchain.schema.runnable.Runnable[source]¶ Methods __init__() abatch(inputs[, config, max_concurrency]) ainvoke(input[, config]) astream(input[, config]) batch(inputs[, config, max_concurrency]) bind(**kwargs) Bind arguments to a Runnable, returning a new Runnable. invoke(inpu...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.Runnable.html
81ce7b24fd20-1
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Output][source]¶
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.Runnable.html
e355dd528e67-0
langchain.schema.memory.BaseChatMessageHistory¶ class langchain.schema.memory.BaseChatMessageHistory[source]¶ Abstract base class for storing chat message history. See ChatMessageHistory for default implementation. Example class FileChatMessageHistory(BaseChatMessageHistory): storage_path: str session_id: str ...
https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseChatMessageHistory.html
e355dd528e67-1
Convenience method for adding a human message string to the store. Parameters message – The string contents of a human message. abstract clear() → None[source]¶ Remove all messages from the store
https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseChatMessageHistory.html
e9dd7e595405-0
langchain.schema.messages.ChatMessage¶ class langchain.schema.messages.ChatMessage[source]¶ Bases: BaseMessage A Message that can be assigned an arbitrary speaker (i.e. role). Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to for...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessage.html
e9dd7e595405-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessage.html
e9dd7e595405-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessage.html
0bda2995edbf-0
langchain.schema.output_parser.BaseGenerationOutputParser¶ class langchain.schema.output_parser.BaseGenerationOutputParser[source]¶ Bases: BaseLLMOutputParser, Runnable[Union[str, BaseMessage], T] Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data ca...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html
0bda2995edbf-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html
0bda2995edbf-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html
0bda2995edbf-3
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ with_fallbacks(fallba...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output_parser.BaseGenerationOutputParser.html
717d59c77482-0
langchain.schema.messages.FunctionMessageChunk¶ class langchain.schema.messages.FunctionMessageChunk[source]¶ Bases: FunctionMessage, BaseMessageChunk Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param ad...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessageChunk.html
717d59c77482-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessageChunk.html
717d59c77482-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessageChunk.html
cea0c5307f06-0
langchain.schema.messages.FunctionMessage¶ class langchain.schema.messages.FunctionMessage[source]¶ Bases: BaseMessage A Message for passing the result of executing a function back to a model. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessage.html
cea0c5307f06-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessage.html
cea0c5307f06-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.FunctionMessage.html
c880c84dd5db-0
langchain.schema.messages.messages_to_dict¶ langchain.schema.messages.messages_to_dict(messages: Sequence[BaseMessage]) → List[dict][source]¶ Convert a sequence of Messages to a list of dictionaries. Parameters messages – Sequence of messages (as BaseMessages) to convert. Returns List of messages as dicts.
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.messages_to_dict.html
f20525c64595-0
langchain.schema.agent.AgentFinish¶ class langchain.schema.agent.AgentFinish(return_values: dict, log: str)[source]¶ The final return value of an ActionAgent. Create new instance of AgentFinish(return_values, log) Attributes log Additional information to log about the return value return_values Dictionary of return val...
https://api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentFinish.html
a33d0c6cf7d3-0
langchain.schema.output.GenerationChunk¶ class langchain.schema.output.GenerationChunk[source]¶ Bases: Generation Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param generation_info: Optional[Dict[str, Any...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output.GenerationChunk.html
a33d0c6cf7d3-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output.GenerationChunk.html
a33d0c6cf7d3-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output.GenerationChunk.html
340e76597818-0
langchain.schema.runnable.RunnableSequence¶ class langchain.schema.runnable.RunnableSequence[source]¶ Bases: Serializable, Runnable[Input, Output] Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param first:...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableSequence.html
340e76597818-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableSequence.html
340e76597818-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableSequence.html
340e76597818-3
classmethod validate(value: Any) → Model¶ with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableSequence.html
2d4d341db3b1-0
langchain.schema.runnable.RunnableMap¶ class langchain.schema.runnable.RunnableMap[source]¶ Bases: Serializable, Runnable[Input, Dict[str, Any]] Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param steps: M...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableMap.html
2d4d341db3b1-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableMap.html
2d4d341db3b1-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableMap.html
2d4d341db3b1-3
classmethod validate(value: Any) → Model¶ with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableMap.html
302fbcd065b4-0
langchain.schema.messages.AIMessageChunk¶ class langchain.schema.messages.AIMessageChunk[source]¶ Bases: AIMessage, BaseMessageChunk Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param additional_kwargs: d...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.AIMessageChunk.html
302fbcd065b4-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.AIMessageChunk.html
302fbcd065b4-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.AIMessageChunk.html
b363471c2884-0
langchain.schema.prompt_template.format_document¶ langchain.schema.prompt_template.format_document(doc: Document, prompt: BasePromptTemplate) → str[source]¶ Format a document into a string based on a prompt template. First, this pulls information from the document from two sources: page_content:This takes the informati...
https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt_template.format_document.html
73b3bf0bacc4-0
langchain.schema.memory.BaseMemory¶ class langchain.schema.memory.BaseMemory[source]¶ Bases: Serializable, ABC Abstract base class for memory in Chains. Memory refers to state in Chains. Memory can be used to store information aboutpast executions of a Chain and inject that information into the inputs of future executi...
https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseMemory.html
73b3bf0bacc4-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseMemory.html
73b3bf0bacc4-2
classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n...
https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseMemory.html
73b3bf0bacc4-3
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ property lc_attribute...
https://api.python.langchain.com/en/latest/schema/langchain.schema.memory.BaseMemory.html
8bcc6c74f060-0
langchain.schema.storage.BaseStore¶ class langchain.schema.storage.BaseStore[source]¶ Abstract interface for a key-value store. Methods __init__() mdelete(keys) Delete the given keys and their associated values. mget(keys) Get the values associated with the given keys. mset(key_value_pairs) Set the values for the given...
https://api.python.langchain.com/en/latest/schema/langchain.schema.storage.BaseStore.html
972be266354f-0
langchain.schema.messages.HumanMessage¶ class langchain.schema.messages.HumanMessage[source]¶ Bases: BaseMessage A Message from a human. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param additional_kwarg...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html
972be266354f-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html
972be266354f-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html
972be266354f-3
Simulated Environment: Gymnasium Agent Debates with Tools Custom callback handlers Async callbacks Tools as OpenAI Functions Prompt Pipelining Using OpenAI functions Retrieval QA using OpenAI functions
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.HumanMessage.html
7a0474625641-0
langchain.schema.agent.AgentAction¶ class langchain.schema.agent.AgentAction(tool: str, tool_input: Union[str, dict], log: str)[source]¶ A full description of an action for an ActionAgent to execute. Attributes tool The name of the Tool to execute. tool_input The input to pass in to the Tool. log Additional information...
https://api.python.langchain.com/en/latest/schema/langchain.schema.agent.AgentAction.html
ce360b81e8a2-0
langchain.schema.messages.ChatMessageChunk¶ class langchain.schema.messages.ChatMessageChunk[source]¶ Bases: ChatMessage, BaseMessageChunk Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param additional_kwa...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessageChunk.html
ce360b81e8a2-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessageChunk.html
ce360b81e8a2-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.ChatMessageChunk.html
9e1f63b45cc8-0
langchain.schema.runnable.RunnableConfig¶ class langchain.schema.runnable.RunnableConfig[source]¶ tags: List[str]¶ Tags for this call and any sub-calls (eg. a Chain calling an LLM). You can use these to filter calls. metadata: Dict[str, Any]¶ Metadata for this call and any sub-calls (eg. a Chain calling an LLM). Keys s...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableConfig.html
8dbdece815eb-0
langchain.schema.runnable.RunnableWithFallbacks¶ class langchain.schema.runnable.RunnableWithFallbacks[source]¶ Bases: Serializable, Runnable[Input, Output] Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. pa...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableWithFallbacks.html
8dbdece815eb-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableWithFallbacks.html
8dbdece815eb-2
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Cal...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableWithFallbacks.html
8dbdece815eb-3
classmethod validate(value: Any) → Model¶ with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnableWithFallbacks.html
1104be4e6047-0
langchain.schema.prompt.PromptValue¶ class langchain.schema.prompt.PromptValue[source]¶ Bases: Serializable, ABC Base abstract class for inputs to any language model. PromptValues can be converted to both LLM (pure text-generation) inputs andChatModel inputs. Create a new model by parsing and validating input data from...
https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt.PromptValue.html
1104be4e6047-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt.PromptValue.html
1104be4e6047-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.prompt.PromptValue.html
6c3483b36e9c-0
langchain.schema.document.Document¶ class langchain.schema.document.Document[source]¶ Bases: Serializable Class for storing a piece of text and associated metadata. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid m...
https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html
6c3483b36e9c-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html
6c3483b36e9c-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html
6c3483b36e9c-3
Weaviate self-querying Chroma self-querying DeepLake self-querying Self-querying with Pinecone Self-querying with MyScale Qdrant self-querying How to add memory to a Multi-Input Chain Custom agent with tool retrieval Vector store-augmented text generation FLARE
https://api.python.langchain.com/en/latest/schema/langchain.schema.document.Document.html
27612997e5b0-0
langchain.schema.runnable.RunnablePassthrough¶ class langchain.schema.runnable.RunnablePassthrough[source]¶ Bases: Serializable, Runnable[Input, Input] Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. async a...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnablePassthrough.html
27612997e5b0-1
Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – 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 – set to True to make a deep co...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnablePassthrough.html
27612997e5b0-2
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto...
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnablePassthrough.html
27612997e5b0-3
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.
https://api.python.langchain.com/en/latest/schema/langchain.schema.runnable.RunnablePassthrough.html
639f700f5b4d-0
langchain.schema.output.Generation¶ class langchain.schema.output.Generation[source]¶ Bases: Serializable A single text generation output. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param generation_inf...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output.Generation.html
639f700f5b4d-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output.Generation.html
639f700f5b4d-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.output.Generation.html
5da9952fbe58-0
langchain.schema.messages.SystemMessageChunk¶ class langchain.schema.messages.SystemMessageChunk[source]¶ Bases: SystemMessage, BaseMessageChunk Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param addition...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessageChunk.html
5da9952fbe58-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessageChunk.html
5da9952fbe58-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_impl...
https://api.python.langchain.com/en/latest/schema/langchain.schema.messages.SystemMessageChunk.html
0930c9231d91-0
langchain.document_transformers.long_context_reorder.LongContextReorder¶ class langchain.document_transformers.long_context_reorder.LongContextReorder[source]¶ Bases: BaseDocumentTransformer, BaseModel Lost in the middle: Performance degrades when models must access relevant information in the middle of long contexts. ...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.long_context_reorder.LongContextReorder.html
0930c9231d91-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.long_context_reorder.LongContextReorder.html
0930c9231d91-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ transform_documents(documents: Sequence[Document], **kwargs: Any) → Sequence[Documen...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.long_context_reorder.LongContextReorder.html
286e12d00487-0
langchain.document_transformers.openai_functions.create_metadata_tagger¶ langchain.document_transformers.openai_functions.create_metadata_tagger(metadata_schema: Union[Dict[str, Any], Type[BaseModel]], llm: BaseLanguageModel, prompt: Optional[ChatPromptTemplate] = None, *, tagging_chain_kwargs: Optional[Dict] = None) →...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.openai_functions.create_metadata_tagger.html
286e12d00487-1
} # Must be an OpenAI model that supports functions llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo-0613") document_transformer = create_metadata_tagger(schema, llm) original_documents = [ Document(page_content="Review of The Bee Movie By Roger Ebert This is the greatest movie ever made. 4 out of 5 stars.”), D...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.openai_functions.create_metadata_tagger.html
59754e5590a4-0
langchain.document_transformers.doctran_text_translate.DoctranTextTranslator¶ class langchain.document_transformers.doctran_text_translate.DoctranTextTranslator(openai_api_key: Optional[str] = None, language: str = 'english', openai_api_model: Optional[str] = None)[source]¶ Translate text documents using doctran. Param...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.doctran_text_translate.DoctranTextTranslator.html
d7150f601c7d-0
langchain.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter¶ class langchain.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter[source]¶ Bases: BaseDocumentTransformer, BaseModel Filter that drops redundant documents by comparing their embeddings. Create a new model by...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter.html
d7150f601c7d-1
Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creat...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter.html
d7150f601c7d-2
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter.html
313961c80424-0
langchain.document_transformers.doctran_text_qa.DoctranQATransformer¶ class langchain.document_transformers.doctran_text_qa.DoctranQATransformer(openai_api_key: Optional[str] = None, openai_api_model: Optional[str] = None)[source]¶ Extract QA from text documents using doctran. Parameters openai_api_key – OpenAI API key...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.doctran_text_qa.DoctranQATransformer.html
039914ebd090-0
langchain.document_transformers.openai_functions.OpenAIMetadataTagger¶ class langchain.document_transformers.openai_functions.OpenAIMetadataTagger[source]¶ Bases: BaseDocumentTransformer, BaseModel Extract metadata tags from document contents using OpenAI functions. Example:from langchain.chat_models import ChatOpenAI ...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.openai_functions.OpenAIMetadataTagger.html
039914ebd090-1
Raises ValidationError if the input data cannot be parsed to form a valid model. param tagging_chain: langchain.chains.llm.LLMChain [Required]¶ The chain used to extract metadata from each document. async atransform_documents(documents: Sequence[Document], **kwargs: Any) → Sequence[Document][source]¶ Asynchronously tra...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.openai_functions.OpenAIMetadataTagger.html
039914ebd090-2
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.openai_functions.OpenAIMetadataTagger.html
039914ebd090-3
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ transform_documents(documents: Sequence[Document], **kwargs: Any) → Sequence[Documen...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.openai_functions.OpenAIMetadataTagger.html
a9d10e32e96c-0
langchain.document_transformers.doctran_text_extract.DoctranPropertyExtractor¶ class langchain.document_transformers.doctran_text_extract.DoctranPropertyExtractor(properties: List[dict], openai_api_key: Optional[str] = None, openai_api_model: Optional[str] = None)[source]¶ Extract properties from text documents using d...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.doctran_text_extract.DoctranPropertyExtractor.html
a9d10e32e96c-1
Methods __init__(properties[, openai_api_key, ...]) atransform_documents(documents, **kwargs) Extracts properties from text documents using doctran. transform_documents(documents, **kwargs) Transform a list of documents. __init__(properties: List[dict], openai_api_key: Optional[str] = None, openai_api_model: Optional[s...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.doctran_text_extract.DoctranPropertyExtractor.html
226b83c13523-0
langchain.document_transformers.embeddings_redundant_filter.get_stateful_documents¶ langchain.document_transformers.embeddings_redundant_filter.get_stateful_documents(documents: Sequence[Document]) → Sequence[_DocumentWithState][source]¶ Convert a list of documents to a list of documents with state. Parameters document...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.get_stateful_documents.html
f161bc315d5f-0
langchain.document_transformers.nuclia_text_transform.NucliaTextTransformer¶ class langchain.document_transformers.nuclia_text_transform.NucliaTextTransformer(nua: NucliaUnderstandingAPI)[source]¶ The Nuclia Understanding API splits into paragraphs and sentences, identifies entities, provides a summary of the text and ...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.nuclia_text_transform.NucliaTextTransformer.html
34a74f404577-0
langchain.document_transformers.html2text.Html2TextTransformer¶ class langchain.document_transformers.html2text.Html2TextTransformer[source]¶ Replace occurrences of a particular search pattern with a replacement string .. rubric:: Example Methods __init__() atransform_documents(documents, **kwargs) Asynchronously trans...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.html2text.Html2TextTransformer.html
1f84d30e52eb-0
langchain.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter¶ class langchain.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter[source]¶ Bases: BaseDocumentTransformer, BaseModel Perform K-means clustering on document vectors. Returns an arbitrary number of documents...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html
1f84d30e52eb-1
documents – A sequence of Documents to be transformed. Returns A list of transformed Documents. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other valid...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html
1f84d30e52eb-2
classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n...
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html
1f84d30e52eb-3
classmethod validate(value: Any) → Model¶ Examples using EmbeddingsClusteringFilter¶ LOTR (Merger Retriever)
https://api.python.langchain.com/en/latest/document_transformers/langchain.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html