id
stringlengths
14
15
text
stringlengths
49
2.47k
source
stringlengths
61
166
4c4f2e5a6fa5-6
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, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html
4c4f2e5a6fa5-7
Generate LLM result from inputs. invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None) → Dict[str, Any]¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bo...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html
4c4f2e5a6fa5-8
**kwargs – Keys to pass to prompt template. Returns Completion from LLM. Example completion = llm.predict(adjective="funny") predict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, Any]]¶ Call predict and then parse the result...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html
4c4f2e5a6fa5-9
Convenience method for executing chain. The main difference between this method and Chain.__call__ is that this method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary with all the inputs Parameters *args – If the chain expect...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html
4c4f2e5a6fa5-10
Example chain.save(file_path="path/chain.yaml") 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¶ stream(input: Input, config: Optiona...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html
728722c4d2f2-0
langchain_experimental.tot.thought.ThoughtValidity¶ class langchain_experimental.tot.thought.ThoughtValidity(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶ VALID_INTERMEDIATE = 0¶ VALID_FINAL = 1¶ INVALID = 2¶
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought.ThoughtValidity.html
3d8b3ba792a9-0
langchain_experimental.tot.memory.ToTDFSMemory¶ class langchain_experimental.tot.memory.ToTDFSMemory(stack: Optional[List[Thought]] = None)[source]¶ Memory for the Tree of Thought (ToT) chain. Implemented as a stack of thoughts. This allows for a depth first search (DFS) of the ToT. Attributes level Return the current ...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.memory.ToTDFSMemory.html
d2d95663ad72-0
langchain_experimental.tot.prompts.JSONListOutputParser¶ class langchain_experimental.tot.prompts.JSONListOutputParser[source]¶ Bases: BaseOutputParser Class to parse the output of a PROPOSE_PROMPT response. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the in...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.prompts.JSONListOutputParser.html
d2d95663ad72-1
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__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.prompts.JSONListOutputParser.html
d2d95663ad72-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/tot/langchain_experimental.tot.prompts.JSONListOutputParser.html
d2d95663ad72-3
Parse the output of an LLM call with the input prompt for context. 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 – String output of a language model. prompt – Input PromptValue. Returns Str...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.prompts.JSONListOutputParser.html
d2d95663ad72-4
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/tot/langchain_experimental.tot.prompts.JSONListOutputParser.html
ed4412c73b60-0
langchain_experimental.tot.thought_generation.SampleCoTStrategy¶ class langchain_experimental.tot.thought_generation.SampleCoTStrategy[source]¶ Bases: BaseThoughtGenerationStrategy Sample thoughts from a Chain-of-Thought (CoT) prompt. This strategy works better when the thought space is rich, such as when each thought ...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-1
This metadata 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 output_key: str = 'text'¶ param output_parser: BaseLLMOutputParser [Optional]¶ Output parser to use. Defau...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-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, include_...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-3
Utilize the LLM generate method for speed gains. async aapply_and_parse(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Union[str, List[str], Dict[str, str]]]¶ Call apply and then parse the results. async abatch(inputs: List[Input], config:...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-4
metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Should contain all outputs specified inChain.output_keys. async agenerate(input_list: List[Dict[str, Any]], run_manager: Optional[A...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-5
Call apredict and then parse the results. async aprep_prompts(input_list: List[Dict[str, Any]], run_manager: Optional[AsyncCallbackManagerForChainRun] = None) → Tuple[List[PromptValue], Optional[List[str]]]¶ Prepare prompts from inputs. async arun(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCal...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-6
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: Input, config: Optional[RunnableConfig] = None) → AsyncIterator[Output]¶ batch(inputs: List[Inpu...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-7
deep – set to True to make a deep copy of the model Returns new model instance create_outputs(llm_result: LLMResult) → List[Dict[str, Any]]¶ Create outputs from response. dict(**kwargs: Any) → Dict¶ Dictionary representation of chain. Expects Chain._chain_type property to be implemented and for memory to benull. Parame...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-8
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(). next_thought(problem_description: str, thoughts_path: Tuple[str, ...] = (), **kwargs: Any) → str[source]¶ Generate the next...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-9
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, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶ Validate and prepare chain outputs, and save info...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-10
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 calls to other objects. **kwargs – If the chain expects multiple inputs, they can be passed in directly as keyword arguments. Returns The c...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
ed4412c73b60-11
Try to update ForwardRefs on fields based on this Model, globalns and localns. 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.Ty...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html
1d3d60296b05-0
langchain_experimental.tot.prompts.CheckerOutputParser¶ class langchain_experimental.tot.prompts.CheckerOutputParser[source]¶ Bases: BaseOutputParser 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 aba...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.prompts.CheckerOutputParser.html
1d3d60296b05-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/tot/langchain_experimental.tot.prompts.CheckerOutputParser.html
1d3d60296b05-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/tot/langchain_experimental.tot.prompts.CheckerOutputParser.html
1d3d60296b05-3
Parse the output of an LLM call with the input prompt for context. 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 – String output of a language model. prompt – Input PromptValue. Returns Str...
https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.prompts.CheckerOutputParser.html
1d3d60296b05-4
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/tot/langchain_experimental.tot.prompts.CheckerOutputParser.html
18f2363f6050-0
langchain_experimental.plan_and_execute.schema.ListStepContainer¶ class langchain_experimental.plan_and_execute.schema.ListStepContainer[source]¶ Bases: BaseStepContainer List step container. 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/plan_and_execute/langchain_experimental.plan_and_execute.schema.ListStepContainer.html
18f2363f6050-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.ListStepContainer.html
18f2363f6050-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.ListStepContainer.html
8c5f780b6056-0
langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute¶ class langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute[source]¶ Bases: Chain Plan and execute a chain of steps. 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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-1
The planner to use. param step_container: langchain_experimental.plan_and_execute.schema.BaseStepContainer [Optional]¶ The step container to use. param 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 pas...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-2
addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Sho...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-3
these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Should contain all outputs specified inChain.output_keys. async ainvok...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-4
directly as keyword arguments. Returns The chain output. Example # Suppose we have a single-input chain that takes a 'question' string: await chain.arun("What's the temperature in Boise, Idaho?") # -> "The temperature in Boise is..." # Suppose we have a multi-input chain that takes a 'question' string # and 'context' s...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-5
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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-6
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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-7
method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary 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 cha...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
8c5f780b6056-8
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedN...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html
7d3127e9c98d-0
langchain_experimental.plan_and_execute.planners.base.BasePlanner¶ class langchain_experimental.plan_and_execute.planners.base.BasePlanner[source]¶ Bases: BaseModel Base planner. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to ...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.base.BasePlanner.html
7d3127e9c98d-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/plan_and_execute/langchain_experimental.plan_and_execute.planners.base.BasePlanner.html
7d3127e9c98d-2
abstract plan(inputs: dict, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Plan[source]¶ Given input, decide what to do. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.base.BasePlanner.html
2447bd698b3f-0
langchain_experimental.plan_and_execute.executors.base.BaseExecutor¶ class langchain_experimental.plan_and_execute.executors.base.BaseExecutor[source]¶ Bases: BaseModel Base executor. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parse...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.executors.base.BaseExecutor.html
2447bd698b3f-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/plan_and_execute/langchain_experimental.plan_and_execute.executors.base.BaseExecutor.html
2447bd698b3f-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¶ abstract step(inputs: dict, callbacks: Optional[Union[List[BaseCallbackHandler], Bas...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.executors.base.BaseExecutor.html
6b98c7d800c0-0
langchain_experimental.plan_and_execute.schema.Step¶ class langchain_experimental.plan_and_execute.schema.Step[source]¶ Bases: BaseModel Step. 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 value: str...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.Step.html
6b98c7d800c0-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.Step.html
00edb9209016-0
langchain_experimental.plan_and_execute.schema.StepResponse¶ class langchain_experimental.plan_and_execute.schema.StepResponse[source]¶ Bases: BaseModel Step response. 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 vali...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.StepResponse.html
00edb9209016-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.StepResponse.html
f267fc4d0e53-0
langchain_experimental.plan_and_execute.executors.base.ChainExecutor¶ class langchain_experimental.plan_and_execute.executors.base.ChainExecutor[source]¶ Bases: BaseExecutor Chain executor. 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/plan_and_execute/langchain_experimental.plan_and_execute.executors.base.ChainExecutor.html
f267fc4d0e53-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/plan_and_execute/langchain_experimental.plan_and_execute.executors.base.ChainExecutor.html
f267fc4d0e53-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¶ step(inputs: dict, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallback...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.executors.base.ChainExecutor.html
e8c17f16033f-0
langchain_experimental.plan_and_execute.executors.agent_executor.load_agent_executor¶ langchain_experimental.plan_and_execute.executors.agent_executor.load_agent_executor(llm: BaseLanguageModel, tools: List[BaseTool], verbose: bool = False, include_task_in_prompt: bool = False) → ChainExecutor[source]¶ Load an agent ex...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.executors.agent_executor.load_agent_executor.html
785950198ba9-0
langchain_experimental.plan_and_execute.schema.BaseStepContainer¶ class langchain_experimental.plan_and_execute.schema.BaseStepContainer[source]¶ Bases: BaseModel Base step container. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parse...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.BaseStepContainer.html
785950198ba9-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.BaseStepContainer.html
785950198ba9-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.BaseStepContainer.html
68e58c6e8d36-0
langchain_experimental.plan_and_execute.schema.Plan¶ class langchain_experimental.plan_and_execute.schema.Plan[source]¶ Bases: BaseModel Plan. 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: Lis...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.Plan.html
68e58c6e8d36-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.Plan.html
68e58c6e8d36-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¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.Plan.html
188d22081311-0
langchain_experimental.plan_and_execute.planners.chat_planner.load_chat_planner¶ langchain_experimental.plan_and_execute.planners.chat_planner.load_chat_planner(llm: BaseLanguageModel, system_prompt: str = "Let's first understand the problem and devise a plan to solve the problem. Please output the plan starting with t...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.load_chat_planner.html
0af654e7256c-0
langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser¶ class langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser[source]¶ Bases: PlanOutputParser Planning output parser. Create a new model by parsing and validating input data from keyword arguments. Raises Val...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html
0af654e7256c-1
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__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html
0af654e7256c-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/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html
0af654e7256c-3
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 – String output of a language model. prompt – Input PromptValue. Returns Structured output classmethod schema(by_alias: bool = True, ref_templa...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html
0af654e7256c-4
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/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html
9792b7199e1a-0
langchain_experimental.plan_and_execute.schema.PlanOutputParser¶ class langchain_experimental.plan_and_execute.schema.PlanOutputParser[source]¶ Bases: BaseOutputParser Plan output parser. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be p...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html
9792b7199e1a-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html
9792b7199e1a-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html
9792b7199e1a-3
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 – String output of a language model. prompt – Input PromptValue. Returns Structured output classmethod schema(by_alias: bool = True, ref_templa...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html
9792b7199e1a-4
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/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html
d2d47bdb0755-0
langchain_experimental.plan_and_execute.planners.base.LLMPlanner¶ class langchain_experimental.plan_and_execute.planners.base.LLMPlanner[source]¶ Bases: BasePlanner LLM planner. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to f...
https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.base.LLMPlanner.html
d2d47bdb0755-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/plan_and_execute/langchain_experimental.plan_and_execute.planners.base.LLMPlanner.html
d2d47bdb0755-2
plan(inputs: dict, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Plan[source]¶ Given input, decide 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/plan_and_execute/langchain_experimental.plan_and_execute.planners.base.LLMPlanner.html
a8216c3da165-0
langchain_experimental.cpal.constants.Constant¶ class langchain_experimental.cpal.constants.Constant(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶ Enum for constants used in the CPAL. narrative_input = 'narrative_input'¶ chain_answer = 'chain_answer'¶ chain_data = 'chain_...
https://api.python.langchain.com/en/latest/cpal/langchain_experimental.cpal.constants.Constant.html
730f221f8f44-0
langchain_experimental.sql.base.SQLDatabaseChain¶ class langchain_experimental.sql.base.SQLDatabaseChain[source]¶ Bases: Chain Chain for interacting with SQL Database. Example from langchain_experimental.sql import SQLDatabaseChain from langchain import OpenAI, SQLDatabase db = SQLDatabase(...) db_chain = SQLDatabaseCh...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-1
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 prompt: Optional[BasePromptTemplate] = None¶ [Deprecated] Prompt to use to translate natural language to SQL. param query_checker_prompt: Optional[BasePromptTemplate] = ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-2
Execute the chain. Parameters inputs – Dictionary of 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. return_only_outputs – Whether to return only outputs in the response. If True, only new keys gen...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-3
only one param. Should contain all inputs specified in Chain.input_keys except for inputs that will be set by the chain’s memory. return_only_outputs – 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 generated by thi...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-4
method expects inputs to be passed directly in as positional arguments or keyword arguments, whereas Chain.__call__ expects a single input dictionary 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 cha...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-5
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__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-6
classmethod from_orm(obj: Any) → Model¶ invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None) → Dict[str, Any]¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Opti...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-7
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/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-8
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?") # -> "The temperature in Boise is..." # Suppose we have a multi-input chain that takes a 'question' string # and 'context' string: ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
730f221f8f44-9
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/sql/langchain_experimental.sql.base.SQLDatabaseChain.html
ebaf2bac1465-0
langchain_experimental.sql.base.SQLDatabaseSequentialChain¶ class langchain_experimental.sql.base.SQLDatabaseSequentialChain[source]¶ Bases: Chain Chain for querying SQL database that is a sequential chain. The chain is as follows: 1. Based on the query, determine which tables to use. 2. Based on those tables, call the...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-1
You can use these to eg identify a specific instance of a chain with its use case. param return_intermediate_steps: bool = False¶ param sql_chain: SQLDatabaseChain [Required]¶ param tags: Optional[List[str]] = None¶ Optional list of tags associated with the chain. Defaults to None. These tags will be associated with ea...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-2
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 calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-3
addition to tags passed to the chain during construction, but only these runtime tags will propagate to calls to other objects. metadata – Optional metadata associated with the chain. Defaults to None include_run_info – Whether to include run info in the response. Defaults to False. Returns A dict of named outputs. Sho...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-4
**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: await chain.arun("What's the temperature in Boise, Idaho?") # -> "The temperature in Boise is..." # Suppose we ha...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-5
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/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-6
# -> {“_type”: “foo”, “verbose”: False, …} classmethod from_llm(llm: BaseLanguageModel, database: SQLDatabase, query_prompt: BasePromptTemplate = PromptTemplate(input_variables=['input', 'table_info', 'dialect', 'top_k'], output_parser=None, partial_variables={}, template='Given an input question, first create a syntac...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-7
Load the necessary chains. classmethod from_orm(obj: Any) → Model¶ invoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None) → Dict[str, Any]¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool =...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-8
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/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-9
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?") # -> "The temperature in Boise is..." # Suppose we have a multi-input chain that takes a 'question' string # and 'context' string: ...
https://api.python.langchain.com/en/latest/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
ebaf2bac1465-10
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/sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html
013143b4ddd1-0
langchain.model_laboratory.ModelLaboratory¶ class langchain.model_laboratory.ModelLaboratory(chains: Sequence[Chain], names: Optional[List[str]] = None)[source]¶ Experiment with different models. Initialize with chains to experiment with. Parameters chains – list of chains to experiment with. Methods __init__(chains[, ...
https://api.python.langchain.com/en/latest/model_laboratory/langchain.model_laboratory.ModelLaboratory.html
0b5c55164a55-0
langchain_experimental.generative_agents.generative_agent.GenerativeAgent¶ class langchain_experimental.generative_agents.generative_agent.GenerativeAgent[source]¶ Bases: BaseModel An Agent as a character with memory and innate characteristics. Create a new model by parsing and validating input data from keyword argume...
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html
0b5c55164a55-1
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, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html