id
stringlengths
14
15
text
stringlengths
44
2.47k
source
stringlengths
61
181
5302c5564fe4-1
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. You can use these to eg identify a specific instance of a chain with its use case. param task_creation_chain: langchain.chains.base...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-2
addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be passed in addition to tags passed to the chain during construction, but only these runtime tags will propagate to c...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-3
chain will be returned. Defaults to False. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-4
with all the inputs Parameters *args – If the chain expects a single input, it can be passed in as the sole positional argument. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to call...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-5
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names: Optional[Sequence[...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-6
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 copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-7
Initialize the BabyAGI Controller. classmethod from_orm(obj: Any) → Model¶ classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then the namespace is [“langchain”, “llms”, “openai”] get_next_task(result: str, task_description: ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-8
by calling invoke() with each input. 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 = No...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-9
Prioritize tasks. run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Convenience method for executing chain. The main difference between this method and Chain.__call__ is th...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-10
save(file_path: Union[Path, str]) → None¶ Save the chain. Expects Chain._chain_type property to be implemented and for memory to benull. Parameters file_path – Path to file to save the chain to. Example chain.save(file_path="path/chain.yaml") classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definiti...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
5302c5564fe4-11
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html
e65e771e6ee5-0
langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner¶ class langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner[source]¶ Bases: BasePlanner Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner.html
e65e771e6ee5-1
the new model: you should trust this data 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[boo...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner.html
e65e771e6ee5-2
plan(inputs: dict, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Plan[source]¶ Given input, decided what to do. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True,...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner.html
e7444ef2f832-0
langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser¶ class langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser[source]¶ Bases: BaseOutputParser Base Output parser for AutoGPT. Create a new model by parsing and validating input data from keyword argum...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
e7444ef2f832-1
to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support str...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
e7444ef2f832-2
Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Mode...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
e7444ef2f832-3
namespace is [“langchain”, “llms”, “openai”] invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶ classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
e7444ef2f832-4
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
e7444ef2f832-5
to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
e7444ef2f832-6
For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html
ed66f4656f05-0
langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator¶ class langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator[source]¶ A class for generating custom prompt strings. Does this based on constraints, commands, resources, and performance evaluations. Initialize t...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator.html
46852330b1ea-0
langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain¶ class langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain[source]¶ Bases: LLMChain Chain to execute tasks. Create a new model by parsing and validating input data from keyword argum...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-1
param output_parser: BaseLLMOutputParser [Optional]¶ Output parser to use. Defaults to one that takes the most likely string but does not change it otherwise. param prompt: BasePromptTemplate [Required]¶ Prompt object to use. param return_final_only: bool = True¶ Whether to return only the final parsed result. Defaults...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-2
chain will be returned. Defaults to False. callbacks – Callbacks to use for this chain run. These will be called in addition to callbacks passed to the chain during construction, but only these runtime callbacks will propagate to calls to other objects. tags – List of string tags to pass to all callbacks. These will be...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-3
Subclasses should override this method if they can batch more efficiently. async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None,...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-4
Generate LLM result from inputs. async ainvoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None, **kwargs: Any) → Dict[str, Any]¶ Default implementation of ainvoke, which calls invoke in a thread pool. Subclasses should override this method if they can run asynchronously. apply(input_list: List[Dict[str, ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-5
Prepare prompts from inputs. async arun(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Convenience method for executing chain. The main difference between this method and Ch...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-6
# -> "The temperature in Boise is..." async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, conf...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-7
Subclasses should override this method if they can batch more efficiently. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ fr...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-8
# -> {"_type": "foo", "verbose": False, ...} classmethod from_llm(llm: BaseLanguageModel, verbose: bool = True) → LLMChain[source]¶ classmethod from_orm(obj: Any) → Model¶ classmethod from_string(llm: BaseLanguageModel, template: str) → LLMChain¶ Create LLMChain from LLM and template. generate(input_list: List[Dict[str...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-9
A unique identifier for this class for serialization purposes. The unique identifier is a list of strings that describes the path to the object. map() → Runnable[List[Input], List[Output]]¶ Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input. classmethod parse_file...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-10
Returns A dictionary of all inputs, including those added by the chain’s memory. prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶ Validate and prepare chain outputs, and save info about this run to memory. Parameters inputs – Dictionary of chain inputs, ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-11
these runtime tags will propagate to calls to other objects. **kwargs – If the chain expects multiple inputs, they can be passed in directly as keyword arguments. Returns The chain output. Example # Suppose we have a single-input chain that takes a 'question' string: chain.run("What's the temperature in Boise, Idaho?")...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
46852330b1ea-12
Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and lo...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html
82367659dee7-0
langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser¶ class langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser[source]¶ Bases: BaseAutoGPTOutputParser Output parser for AutoGPT. Create a new model by parsing and validating input data from keyword arguments. ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
82367659dee7-1
to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support str...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
82367659dee7-2
Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Mode...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
82367659dee7-3
namespace is [“langchain”, “llms”, “openai”] invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶ classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
82367659dee7-4
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
82367659dee7-5
to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
82367659dee7-6
For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html
824b2cd136f4-0
langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser¶ class langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser[source]¶ Bases: BaseModel Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser.html
824b2cd136f4-1
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False,...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser.html
9d4d09425e86-0
langchain_experimental.autonomous_agents.hugginggpt.task_planner.Plan¶ class langchain_experimental.autonomous_agents.hugginggpt.task_planner.Plan(steps: List[Step])[source]¶ Methods __init__(steps) __init__(steps: List[Step])[source]¶
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.Plan.html
6e34aab7ecb9-0
langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory¶ class langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory[source]¶ Bases: BaseChatMemory Memory for AutoGPT. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data c...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory.html
6e34aab7ecb9-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/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory.html
6e34aab7ecb9-2
The unique identifier is a list of strings that describes the path to the object. load_memory_variables(inputs: Dict[str, Any]) → Dict[str, Any][source]¶ Return key-value pairs given the text input to the chain. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', ...
https://api.python.langchain.com/en/latest/autonomous_agents/langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory.html
caca62d909f2-0
langchain.load.load.loads¶ langchain.load.load.loads(text: str, *, secrets_map: Optional[Dict[str, str]] = None, valid_namespaces: Optional[List[str]] = None) → Any[source]¶ Revive a LangChain class from a JSON string. Equivalent to load(json.loads(text)). Parameters text – The string to load. secrets_map – A map of se...
https://api.python.langchain.com/en/latest/load/langchain.load.load.loads.html
df90ada0c795-0
langchain.load.serializable.SerializedSecret¶ class langchain.load.serializable.SerializedSecret[source]¶ Serialized secret. lc: int¶ id: List[str]¶ type: Literal['secret']¶
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.SerializedSecret.html
184561f4db70-0
langchain.load.dump.dumpd¶ langchain.load.dump.dumpd(obj: Any) → Dict[str, Any][source]¶ Return a json dict representation of an object.
https://api.python.langchain.com/en/latest/load/langchain.load.dump.dumpd.html
21d5236fc8d7-0
langchain.load.serializable.BaseSerialized¶ class langchain.load.serializable.BaseSerialized[source]¶ Base class for serialized objects. lc: int¶ id: List[str]¶
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.BaseSerialized.html
aa8acde6a0de-0
langchain.load.serializable.SerializedConstructor¶ class langchain.load.serializable.SerializedConstructor[source]¶ Serialized constructor. lc: int¶ id: List[str]¶ type: Literal['constructor']¶ kwargs: Dict[str, Any]¶
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.SerializedConstructor.html
42b492e763d4-0
langchain.load.serializable.SerializedNotImplemented¶ class langchain.load.serializable.SerializedNotImplemented[source]¶ Serialized not implemented. lc: int¶ id: List[str]¶ type: Literal['not_implemented']¶ repr: Optional[str]¶
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.SerializedNotImplemented.html
08abe632163e-0
langchain.load.serializable.Serializable¶ class langchain.load.serializable.Serializable[source]¶ Bases: BaseModel, ABC Serializable base class. 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. classmethod co...
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.Serializable.html
08abe632163e-1
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ classmethod get_lc_namespace() → List[str][source]¶ Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then the namespac...
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.Serializable.html
08abe632163e-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][source]¶ to_json_...
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.Serializable.html
fb604054c489-0
langchain.load.dump.default¶ langchain.load.dump.default(obj: Any) → Any[source]¶ Return a default value for a Serializable object or a SerializedNotImplemented object.
https://api.python.langchain.com/en/latest/load/langchain.load.dump.default.html
96732a272efd-0
langchain.load.serializable.to_json_not_implemented¶ langchain.load.serializable.to_json_not_implemented(obj: object) → SerializedNotImplemented[source]¶ Serialize a “not implemented” object. Parameters obj – object to serialize Returns SerializedNotImplemented
https://api.python.langchain.com/en/latest/load/langchain.load.serializable.to_json_not_implemented.html
64a6fe4ca917-0
langchain.load.dump.dumps¶ langchain.load.dump.dumps(obj: Any, *, pretty: bool = False) → str[source]¶ Return a json string representation of an object.
https://api.python.langchain.com/en/latest/load/langchain.load.dump.dumps.html
48cf6ce30510-0
langchain.load.load.Reviver¶ class langchain.load.load.Reviver(secrets_map: Optional[Dict[str, str]] = None, valid_namespaces: Optional[List[str]] = None)[source]¶ Reviver for JSON objects. Methods __init__([secrets_map, valid_namespaces]) __init__(secrets_map: Optional[Dict[str, str]] = None, valid_namespaces: Optiona...
https://api.python.langchain.com/en/latest/load/langchain.load.load.Reviver.html
eb737e543608-0
langchain.load.load.load¶ langchain.load.load.load(obj: Any, *, secrets_map: Optional[Dict[str, str]] = None, valid_namespaces: Optional[List[str]] = None) → Any[source]¶ Revive a LangChain class from a JSON object. Use this if you already have a parsed JSON object, eg. from json.load or orjson.loads. Parameters obj – ...
https://api.python.langchain.com/en/latest/load/langchain.load.load.load.html
c7d1f9dd141b-0
langchain_experimental.pal_chain.base.PALChain¶ class langchain_experimental.pal_chain.base.PALChain[source]¶ Bases: Chain Implements Program-Aided Language Models (PAL). This class implements the Program-Aided Language Models (PAL) for generating code solutions. PAL is a technique described in the paper “Program-Aided...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-1
param llm_chain: LLMChain [Required]¶ param 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. ...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-2
will be printed to the console. Defaults to langchain.verbose value. __call__(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-3
Default implementation of abatch, which calls ainvoke N times. Subclasses should override this method if they can batch more efficiently. async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optiona...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-4
Default implementation of ainvoke, which calls invoke in a thread pool. Subclasses should override this method if they can run asynchronously. apply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dict[str, str]]¶ Call the chain on all inputs i...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-5
# Suppose we have a multi-input chain that takes a 'question' string # and 'context' string: question = "What's the temperature in Boise, Idaho?" context = "Weather report for Boise, Idaho on 07/03/23..." await chain.arun(question=question, context=context) # -> "The temperature in Boise is..." async astream(input: Inp...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-6
input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can ba...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-7
**kwargs – Keyword arguments passed to default pydantic.BaseModel.dict method. Returns A dictionary representation of the chain. Example chain.dict(exclude_unset=True) # -> {"_type": "foo", "verbose": False, ...} classmethod from_colored_object_prompt(llm: BaseLanguageModel, **kwargs: Any) → PALChain[source]¶ Load PAL ...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-8
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-9
Parameters inputs – Dictionary of raw inputs, or single input if chain expects only one param. Should contain all inputs specified in Chain.input_keys except for inputs that will be set by the chain’s memory. Returns A dictionary of all inputs, including those added by the chain’s memory. prep_outputs(inputs: Dict[str,...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-10
these runtime tags will propagate to calls to other objects. **kwargs – If the chain expects multiple inputs, they can be passed in directly as keyword arguments. Returns The chain output. Example # Suppose we have a single-input chain that takes a 'question' string: chain.run("What's the temperature in Boise, Idaho?")...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-11
Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and lo...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
c7d1f9dd141b-12
For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALChain.html
423ade11a507-0
langchain_experimental.pal_chain.base.PALValidation¶ class langchain_experimental.pal_chain.base.PALValidation(solution_expression_name: Optional[str] = None, solution_expression_type: Optional[type] = None, allow_imports: bool = False, allow_command_exec: bool = False)[source]¶ Initialize a PALValidation instance. Par...
https://api.python.langchain.com/en/latest/pal_chain/langchain_experimental.pal_chain.base.PALValidation.html
57b72a3cbcf9-0
langchain.indexes.vectorstore.VectorStoreIndexWrapper¶ class langchain.indexes.vectorstore.VectorStoreIndexWrapper[source]¶ Bases: BaseModel Wrapper around a vectorstore for easy access. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be pa...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html
57b72a3cbcf9-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/indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html
57b72a3cbcf9-2
query(question: str, llm: Optional[BaseLanguageModel] = None, retriever_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) → str[source]¶ Query the vectorstore. query_with_sources(question: str, llm: Optional[BaseLanguageModel] = None, retriever_kwargs: Optional[Dict[str, Any]] = None, **kwargs: Any) → dict[source...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html
93bc5da7c1e5-0
langchain.indexes.vectorstore.VectorstoreIndexCreator¶ class langchain.indexes.vectorstore.VectorstoreIndexCreator[source]¶ Bases: BaseModel Logic for creating indexes. 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 val...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html
93bc5da7c1e5-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/indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html
93bc5da7c1e5-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html
5c9543e8fe0c-0
langchain.indexes.base.RecordManager¶ class langchain.indexes.base.RecordManager(namespace: str)[source]¶ An abstract base class representing the interface for a record manager. Initialize the record manager. Parameters namespace (str) – The namespace for the record manager. Methods __init__(namespace) Initialize the r...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.base.RecordManager.html
5c9543e8fe0c-1
Returns The current server time as a float timestamp. abstract list_keys(*, before: Optional[float] = None, after: Optional[float] = None, group_ids: Optional[Sequence[str]] = None, limit: Optional[int] = None) → List[str][source]¶ List records in the database based on the provided filters. Parameters before – Filter t...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.base.RecordManager.html
92b5ce8b0e2a-0
langchain.indexes.graph.GraphIndexCreator¶ class langchain.indexes.graph.GraphIndexCreator[source]¶ Bases: BaseModel Functionality to create graph index. 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...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html
92b5ce8b0e2a-1
param llm: Optional[langchain.schema.language_model.BaseLanguageModel] = None¶ async afrom_text(text: str, prompt: BasePromptTemplate = PromptTemplate(input_variables=['text'], template="You are a networked intelligence helping a human track knowledge triples about all relevant people, things, concepts, etc. and integr...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html
92b5ce8b0e2a-2
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/indexes/langchain.indexes.graph.GraphIndexCreator.html
92b5ce8b0e2a-3
classmethod from_orm(obj: Any) → Model¶ from_text(text: str, prompt: BasePromptTemplate = PromptTemplate(input_variables=['text'], template="You are a networked intelligence helping a human track knowledge triples about all relevant people, things, concepts, etc. and integrating them with your knowledge stored within y...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html
92b5ce8b0e2a-4
Create graph index from text. 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 ...
https://api.python.langchain.com/en/latest/indexes/langchain.indexes.graph.GraphIndexCreator.html
c8d638a186f8-0
langchain.memory.chat_message_histories.sql.SQLChatMessageHistory¶ class langchain.memory.chat_message_histories.sql.SQLChatMessageHistory(session_id: str, connection_string: str, table_name: str = 'message_store', session_id_field_name: str = 'session_id', custom_message_converter: Optional[BaseMessageConverter] = Non...
https://api.python.langchain.com/en/latest/memory/langchain.memory.chat_message_histories.sql.SQLChatMessageHistory.html
4ac1d2c8a5d4-0
langchain.memory.chat_message_histories.xata.XataChatMessageHistory¶ class langchain.memory.chat_message_histories.xata.XataChatMessageHistory(session_id: str, db_url: str, api_key: str, branch_name: str = 'main', table_name: str = 'messages', create_table: bool = True)[source]¶ Chat message history stored in a Xata da...
https://api.python.langchain.com/en/latest/memory/langchain.memory.chat_message_histories.xata.XataChatMessageHistory.html
e85c23bfe0fb-0
langchain.memory.entity.BaseEntityStore¶ class langchain.memory.entity.BaseEntityStore[source]¶ Bases: BaseModel, ABC Abstract base class for Entity store. 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. abs...
https://api.python.langchain.com/en/latest/memory/langchain.memory.entity.BaseEntityStore.html
e85c23bfe0fb-1
abstract delete(key: str) → None[source]¶ Delete entity value from store. 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, exclude...
https://api.python.langchain.com/en/latest/memory/langchain.memory.entity.BaseEntityStore.html
e85c23bfe0fb-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/memory/langchain.memory.entity.BaseEntityStore.html
1b12af95b3c7-0
langchain.memory.buffer_window.ConversationBufferWindowMemory¶ class langchain.memory.buffer_window.ConversationBufferWindowMemory[source]¶ Bases: BaseChatMemory Buffer for storing conversation memory inside a limited size window. Create a new model by parsing and validating input data from keyword arguments. Raises Va...
https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer_window.ConversationBufferWindowMemory.html
1b12af95b3c7-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/memory/langchain.memory.buffer_window.ConversationBufferWindowMemory.html
1b12af95b3c7-2
The unique identifier is a list of strings that describes the path to the object. load_memory_variables(inputs: Dict[str, Any]) → Dict[str, Any][source]¶ Return history buffer. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickl...
https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer_window.ConversationBufferWindowMemory.html
1b12af95b3c7-3
List of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_secrets: Dict[str, str]¶ A map of constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} Examples using ConversationBufferWindowMemory¶ Figma Op...
https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer_window.ConversationBufferWindowMemory.html
a76e3cc5c1f7-0
langchain.memory.summary.ConversationSummaryMemory¶ class langchain.memory.summary.ConversationSummaryMemory[source]¶ Bases: BaseChatMemory, SummarizerMixin Conversation summarizer to chat memory. 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/memory/langchain.memory.summary.ConversationSummaryMemory.html
a76e3cc5c1f7-1
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 copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu...
https://api.python.langchain.com/en/latest/memory/langchain.memory.summary.ConversationSummaryMemory.html