id stringlengths 14 15 | text stringlengths 13 2.7k | source stringlengths 60 181 |
|---|---|---|
d734e11ed1a0-1 | Default implementation runs ainvoke in parallel using asyncio.gather.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
async ainvoke(input: Input, co... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-2 | step, and the final state of the run.
The jsonpatch ops can be applied in order to construct state.
Parameters
input – The input to the runnable.
config – The config to use for the runnable.
diff – Whether to yield diffs between each step, or the current state.
with_streamed_output_list – Whether to yield the streamed_... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-3 | To mark a field as configurable, see the configurable_fields
and configurable_alternatives methods.
Parameters
include – A list of fields to include in the config schema.
Returns
A pydantic model that can be used to validate config.
configurable_alternatives(which: ConfigurableField, *, default_key: str = 'default', pr... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-4 | dict(**kwargs: Any) → Dict¶
Return dictionary representation of prompt.
format(**kwargs: Any) → str[source]¶
Format the prompt with the inputs.
Parameters
kwargs – Any arguments to be passed to the prompt template.
Returns
A formatted string.
Example:
prompt.format(variable1="foo")
format_prompt(**kwargs: Any) → Prompt... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-5 | Parameters
input – The input to the runnable.
config – A config to use when invoking the runnable.
The config supports standard keys like ‘tags’, ‘metadata’ for tracing
purposes, ‘max_concurrency’ for controlling how much work to do
in parallel, and other keys. Please refer to the RunnableConfig
for more details.
Retur... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-6 | 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¶
partial(**kwargs: Union[str, Callable[[], str]]) → BasePromptTemplate¶
Return a partial of the prompt template.
s... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-7 | classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'E... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
d734e11ed1a0-8 | Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exception_type – A tuple of exception types to retry on
wait_exponential_jitter – Whether to add jitter to the wait time
between retries
stop_after_attempt – The maximum number of attempts to make before giving up
Returns
A new ... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html |
930bdce70ba5-0 | langchain_core.prompts.chat.BaseChatPromptTemplate¶
class langchain_core.prompts.chat.BaseChatPromptTemplate[source]¶
Bases: BasePromptTemplate, ABC
Base class for chat prompt templates.
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/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-1 | Subclasses should override this method if they can run asynchronously.
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.
a... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-2 | exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subclasses sho... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-3 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-4 | Format prompt. Should return a PromptValue.
:param **kwargs: Keyword arguments to use for formatting.
Returns
PromptValue.
classmethod from_orm(obj: Any) → Model¶
get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to validate input to the runnable.
Runnabl... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-5 | in parallel, and other keys. Please refer to the RunnableConfig
for more details.
Returns
The output of the runnable.
classmethod is_lc_serializable() → bool¶
Return whether this class is serializable.
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntSt... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-6 | Return a partial of the prompt template.
save(file_path: Union[Path, str]) → None¶
Save the prompt.
Parameters
file_path – Path to directory to save prompt to.
Example:
.. code-block:: python
prompt.save(file_path=”path/prompt.yaml”)
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{mode... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-7 | Add fallbacks to a runnable, returning a new Runnable.
Parameters
fallbacks – A sequence of runnables to try if the original runnable fails.
exceptions_to_handle – A tuple of exception types to handle.
Returns
A new Runnable that will try the original runnable, and then each
fallback in order, upon failures.
with_liste... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
930bdce70ba5-8 | Bind input and output types to a Runnable, returning a new Runnable.
property InputType: Type[langchain_core.runnables.utils.Input]¶
The type of input this runnable accepts specified as a type annotation.
property OutputType: Any¶
The type of output this runnable produces specified as a type annotation.
property config... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html |
9b263e3b8b79-0 | langchain_core.prompts.string.jinja2_formatter¶
langchain_core.prompts.string.jinja2_formatter(template: str, **kwargs: Any) → str[source]¶
Format a template using jinja2.
Security warning: As of LangChain 0.0.329, this method uses Jinja2’sSandboxedEnvironment by default. However, this sand-boxing should
be treated as ... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.jinja2_formatter.html |
cc0f4351e759-0 | langchain_core.prompts.string.validate_jinja2¶
langchain_core.prompts.string.validate_jinja2(template: str, input_variables: List[str]) → None[source]¶
Validate that the input variables are valid for the template.
Issues a warning if missing or extra variables are found.
Parameters
template – The template string.
input... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.validate_jinja2.html |
bc7cf3054548-0 | langchain_core.prompts.string.StringPromptTemplate¶
class langchain_core.prompts.string.StringPromptTemplate[source]¶
Bases: BasePromptTemplate, ABC
String prompt that exposes the format method, returning a prompt.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-1 | Subclasses should override this method if they can run asynchronously.
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.
a... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-2 | exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subclasses sho... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-3 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-4 | Get a pydantic model that can be used to validate input to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific confi... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-5 | classmethod is_lc_serializable() → bool¶
Return whether this class is 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 = Fals... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-6 | Save the prompt.
Parameters
file_path – Path to directory to save prompt to.
Example:
.. code-block:: python
prompt.save(file_path=”path/prompt.yaml”)
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: ... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-7 | Add fallbacks to a runnable, returning a new Runnable.
Parameters
fallbacks – A sequence of runnables to try if the original runnable fails.
exceptions_to_handle – A tuple of exception types to handle.
Returns
A new Runnable that will try the original runnable, and then each
fallback in order, upon failures.
with_liste... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
bc7cf3054548-8 | Bind input and output types to a Runnable, returning a new Runnable.
property InputType: Type[langchain_core.runnables.utils.Input]¶
The type of input this runnable accepts specified as a type annotation.
property OutputType: Any¶
The type of output this runnable produces specified as a type annotation.
property config... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.string.StringPromptTemplate.html |
a14b33642584-0 | langchain_core.prompts.chat.ChatMessagePromptTemplate¶
class langchain_core.prompts.chat.ChatMessagePromptTemplate[source]¶
Bases: BaseStringMessagePromptTemplate
Chat message prompt template.
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/prompts/langchain_core.prompts.chat.ChatMessagePromptTemplate.html |
a14b33642584-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/prompts/langchain_core.prompts.chat.ChatMessagePromptTemplate.html |
a14b33642584-2 | Returns
A new instance of this class.
classmethod from_template_file(template_file: Union[str, Path], input_variables: List[str], **kwargs: Any) → MessagePromptTemplateT¶
Create a class from a template file.
Parameters
template_file – path to a template file. String or Path.
input_variables – list of input variables.
*... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.chat.ChatMessagePromptTemplate.html |
a14b33642584-3 | 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/prompts/langchain_core.prompts.chat.ChatMessagePromptTemplate.html |
86075b8cc794-0 | langchain_core.prompts.base.BasePromptTemplate¶
class langchain_core.prompts.base.BasePromptTemplate[source]¶
Bases: RunnableSerializable[Dict, PromptValue], ABC
Base class for all prompt templates, returning a prompt.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationErro... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-1 | Subclasses should override this method if they can run asynchronously.
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.
a... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-2 | exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subclasses sho... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-3 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-4 | Get a pydantic model that can be used to validate input to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific confi... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-5 | Return whether this class is 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_defaults: bool = False, exclud... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-6 | Save the prompt.
Parameters
file_path – Path to directory to save prompt to.
Example:
.. code-block:: python
prompt.save(file_path=”path/prompt.yaml”)
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: ... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-7 | Add fallbacks to a runnable, returning a new Runnable.
Parameters
fallbacks – A sequence of runnables to try if the original runnable fails.
exceptions_to_handle – A tuple of exception types to handle.
Returns
A new Runnable that will try the original runnable, and then each
fallback in order, upon failures.
with_liste... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
86075b8cc794-8 | Bind input and output types to a Runnable, returning a new Runnable.
property InputType: Type[langchain_core.runnables.utils.Input]¶
The type of input this runnable accepts specified as a type annotation.
property OutputType: Any¶
The type of output this runnable produces specified as a type annotation.
property config... | https://api.python.langchain.com/en/latest/prompts/langchain_core.prompts.base.BasePromptTemplate.html |
238087cb4e37-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 |
238087cb4e37-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 |
238087cb4e37-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 |
693a70ed46f8-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 |
693a70ed46f8-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 |
fa674f3d4987-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.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConf... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-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/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-2 | exclude_names – Exclude logs with these names.
exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which ... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-3 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-4 | methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific configuration.
Parameters
config – A config to use when generating the schema.
Returns
A pydantic model that can be used to validate input.
classmethod get_... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-5 | 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/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-6 | Parse a list of candidate model Generations into a specific format.
The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation.
Parameters
result – A list of Generations to be parsed. The Generations are assumed
to be different candidate outputs for ... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-7 | 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_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runna... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-8 | added to the run.
with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶
Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exc... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
fa674f3d4987-9 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model. | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html |
259844ab5317-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 |
259844ab5317-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 |
259844ab5317-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 |
82a6f42eecb7-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 |
82a6f42eecb7-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 |
82a6f42eecb7-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 |
d2bd4de637ed-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 |
d2bd4de637ed-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 |
7837bd43cc94-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 |
1187788dcdca-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 |
1187788dcdca-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 |
1187788dcdca-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 |
e21c970d3fd2-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 |
e21c970d3fd2-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 |
e21c970d3fd2-2 | 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 calls to other objects.
metadata – Optional metadata associated with the ... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-3 | returned. If False, both input keys and new keys generated by this
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.... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-5 | Subclasses should override this method if they support streaming output.
async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-6 | Default implementation of atransform, which buffers input and calls astream.
Subclasses should override this method if they can start producing output while
input is still being generated.
batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-7 | 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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-8 | Parameters
config – A config to use when generating the schema.
Returns
A pydantic model that can be used to validate input.
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”, “open... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-9 | 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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-10 | 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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-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/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-13 | added to the run.
with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶
Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exc... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
e21c970d3fd2-14 | A map of constructor argument names to secret ids.
For example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_keys: List[str]¶
Keys expected to be in the chain output.
property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model. | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html |
8409bbe45695-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 |
8409bbe45695-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 |
8409bbe45695-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 |
82264a3846cb-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 |
dd2140eaf2a7-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 |
dd2140eaf2a7-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 |
dd2140eaf2a7-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 |
0003b2e83772-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 |
0003b2e83772-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 |
0003b2e83772-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 |
4942b231d795-0 | langchain_experimental.plan_and_execute.schema.PlanOutputParser¶
class langchain_experimental.plan_and_execute.schema.PlanOutputParser[source]¶
Bases: BaseOutputParser
Plan output parser.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool =... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
4942b231d795-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/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
4942b231d795-2 | exclude_names – Exclude logs with these names.
exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which ... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
4942b231d795-3 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
4942b231d795-4 | methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific configuration.
Parameters
config – A config to use when generating the schema.
Returns
A pydantic model that can be used to validate input.
classmethod get_... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
4942b231d795-5 | 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/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
4942b231d795-6 | Parse a list of candidate model Generations into a specific format.
The return value is parsed from only the first Generation in the result, whichis assumed to be the highest-likelihood Generation.
Parameters
result – A list of Generations to be parsed. The Generations are assumed
to be different candidate outputs for ... | https://api.python.langchain.com/en/latest/plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.