id
stringlengths
14
15
text
stringlengths
22
2.51k
source
stringlengths
61
160
b2c0e1034450-1
param callbacks: Callbacks = None¶ Callbacks to be called during tool execution. param description: str = 'Extract all hyperlinks on the current webpage'¶ Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶ Handle the content of the ToolException thrown. param metadata: Optional[Dict[str, Any]] = None¶ Optional metadata associated with the tool. Defaults to None This metadata will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param name: str = 'extract_hyperlinks'¶ The unique name of the tool that clearly communicates its purpose. param return_direct: bool = False¶ Whether to return the tool’s output directly. Setting this to True means that after the tool is called, the AgentExecutor will stop looping. param sync_browser: Optional['SyncBrowser'] = None¶ param tags: Optional[List[str]] = None¶ Optional list of tags associated with the tool. Defaults to None These tags will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param verbose: bool = False¶ Whether to log the tool’s progress. __call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶ Make tool callable. async ainvoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶
https://api.python.langchain.com/en/latest/tools/langchain.tools.playwright.extract_hyperlinks.ExtractHyperlinksTool.html
b2c0e1034450-2
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Run the tool asynchronously. validator check_bs_import  »  all fields[source]¶ Check that the arguments are valid. classmethod from_browser(sync_browser: Optional[SyncBrowser] = None, async_browser: Optional[AsyncBrowser] = None) → BaseBrowserTool¶ Instantiate the tool. invoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶ validator raise_deprecation  »  all fields¶ Raise deprecation warning if callback_manager is used. run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Run the tool. static scrape_page(page: Any, html_content: str, absolute_urls: bool) → str[source]¶ validator validate_browser_provided  »  all fields¶ Check that the arguments are valid. property args: dict¶ property is_single_input: bool¶ Whether the tool only accepts a single input. model Config¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶ extra = 'forbid'¶
https://api.python.langchain.com/en/latest/tools/langchain.tools.playwright.extract_hyperlinks.ExtractHyperlinksTool.html
8cdb115a29c6-0
langchain.tools.file_management.file_search.FileSearchInput¶ class langchain.tools.file_management.file_search.FileSearchInput(*, dir_path: str = '.', pattern: str)[source]¶ Bases: BaseModel Input for FileSearchTool. 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 dir_path: str = '.'¶ Subdirectory to search in. param pattern: str [Required]¶ Unix shell regex, where * matches everything.
https://api.python.langchain.com/en/latest/tools/langchain.tools.file_management.file_search.FileSearchInput.html
8b08f0a9f031-0
langchain.tools.amadeus.flight_search.AmadeusFlightSearch¶ class langchain.tools.amadeus.flight_search.AmadeusFlightSearch(*, name: str = 'single_flight_search', description: str = ' Use this tool to search for a single flight between the origin and  destination airports at a departure between an earliest and  latest datetime. ', args_schema: ~typing.Type[~langchain.tools.amadeus.flight_search.FlightSearchSchema] = <class 'langchain.tools.amadeus.flight_search.FlightSearchSchema'>, return_direct: bool = False, verbose: bool = False, callbacks: ~typing.Optional[~typing.Union[~typing.List[~langchain.callbacks.base.BaseCallbackHandler], ~langchain.callbacks.base.BaseCallbackManager]] = None, callback_manager: ~typing.Optional[~langchain.callbacks.base.BaseCallbackManager] = None, tags: ~typing.Optional[~typing.List[str]] = None, metadata: ~typing.Optional[~typing.Dict[str, ~typing.Any]] = None, handle_tool_error: ~typing.Optional[~typing.Union[bool, str, ~typing.Callable[[~langchain.tools.base.ToolException], str]]] = False, client: Client = None)[source]¶ Bases: AmadeusBaseTool Tool for searching for a single flight between two airports. 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 args_schema: Type[langchain.tools.amadeus.flight_search.FlightSearchSchema] = <class 'langchain.tools.amadeus.flight_search.FlightSearchSchema'>¶ Pydantic model class to validate and parse the tool’s input arguments. param callback_manager: Optional[BaseCallbackManager] = None¶ Deprecated. Please use callbacks instead. param callbacks: Callbacks = None¶
https://api.python.langchain.com/en/latest/tools/langchain.tools.amadeus.flight_search.AmadeusFlightSearch.html
8b08f0a9f031-1
Deprecated. Please use callbacks instead. param callbacks: Callbacks = None¶ Callbacks to be called during tool execution. param client: Client [Optional]¶ param description: str = ' Use this tool to search for a single flight between the origin and  destination airports at a departure between an earliest and  latest datetime. '¶ Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶ Handle the content of the ToolException thrown. param metadata: Optional[Dict[str, Any]] = None¶ Optional metadata associated with the tool. Defaults to None This metadata will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param name: str = 'single_flight_search'¶ The unique name of the tool that clearly communicates its purpose. param return_direct: bool = False¶ Whether to return the tool’s output directly. Setting this to True means that after the tool is called, the AgentExecutor will stop looping. param tags: Optional[List[str]] = None¶ Optional list of tags associated with the tool. Defaults to None These tags will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param verbose: bool = False¶ Whether to log the tool’s progress. __call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶ Make tool callable.
https://api.python.langchain.com/en/latest/tools/langchain.tools.amadeus.flight_search.AmadeusFlightSearch.html
8b08f0a9f031-2
Make tool callable. async ainvoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶ async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Run the tool asynchronously. invoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶ validator raise_deprecation  »  all fields¶ Raise deprecation warning if callback_manager is used. run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Run the tool. property args: dict¶ property is_single_input: bool¶ Whether the tool only accepts a single input. model Config¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶ extra = 'forbid'¶
https://api.python.langchain.com/en/latest/tools/langchain.tools.amadeus.flight_search.AmadeusFlightSearch.html
0342bad343a1-0
langchain.tools.requests.tool.RequestsGetTool¶ class langchain.tools.requests.tool.RequestsGetTool(*, name: str = 'requests_get', description: str = 'A portal to the internet. Use this when you need to get specific content from a website. Input should be a  url (i.e. https://www.google.com). The output will be the text response of the GET request.', args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False, requests_wrapper: TextRequestsWrapper)[source]¶ Bases: BaseRequestsTool, BaseTool Tool for making a GET request to an API endpoint. 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 args_schema: Optional[Type[BaseModel]] = None¶ Pydantic model class to validate and parse the tool’s input arguments. param callback_manager: Optional[BaseCallbackManager] = None¶ Deprecated. Please use callbacks instead. param callbacks: Callbacks = None¶ Callbacks to be called during tool execution. param description: str = 'A portal to the internet. Use this when you need to get specific content from a website. Input should be a  url (i.e. https://www.google.com). The output will be the text response of the GET request.'¶ Used to tell the model how/when/why to use the tool.
https://api.python.langchain.com/en/latest/tools/langchain.tools.requests.tool.RequestsGetTool.html
0342bad343a1-1
Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. param handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False¶ Handle the content of the ToolException thrown. param metadata: Optional[Dict[str, Any]] = None¶ Optional metadata associated with the tool. Defaults to None This metadata will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param name: str = 'requests_get'¶ The unique name of the tool that clearly communicates its purpose. param requests_wrapper: langchain.utilities.requests.TextRequestsWrapper [Required]¶ param return_direct: bool = False¶ Whether to return the tool’s output directly. Setting this to True means that after the tool is called, the AgentExecutor will stop looping. param tags: Optional[List[str]] = None¶ Optional list of tags associated with the tool. Defaults to None These tags will be associated with each call to this tool, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a tool with its use case. param verbose: bool = False¶ Whether to log the tool’s progress. __call__(tool_input: str, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → str¶ Make tool callable. async ainvoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶
https://api.python.langchain.com/en/latest/tools/langchain.tools.requests.tool.RequestsGetTool.html
0342bad343a1-2
async arun(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Run the tool asynchronously. invoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶ validator raise_deprecation  »  all fields¶ Raise deprecation warning if callback_manager is used. run(tool_input: Union[str, Dict], verbose: Optional[bool] = None, start_color: Optional[str] = 'green', color: Optional[str] = 'green', callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶ Run the tool. property args: dict¶ property is_single_input: bool¶ Whether the tool only accepts a single input. model Config¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶ extra = 'forbid'¶ Examples using RequestsGetTool¶ Tool Input Schema
https://api.python.langchain.com/en/latest/tools/langchain.tools.requests.tool.RequestsGetTool.html
33ae0b19818a-0
langchain_experimental.generative_agents.generative_agent.GenerativeAgent¶ class langchain_experimental.generative_agents.generative_agent.GenerativeAgent(*, name: str, age: Optional[int] = None, traits: str = 'N/A', status: str, memory: GenerativeAgentMemory, llm: BaseLanguageModel, verbose: bool = False, summary: str = '', summary_refresh_seconds: int = 3600, last_refreshed: datetime = None, daily_summaries: List[str] = None)[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 arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param age: Optional[int] = None¶ The optional age of the character. param daily_summaries: List[str] [Optional]¶ Summary of the events in the plan that the agent took. param last_refreshed: datetime.datetime [Optional]¶ The last time the character’s summary was regenerated. param llm: langchain.schema.language_model.BaseLanguageModel [Required]¶ The underlying language model. param memory: langchain_experimental.generative_agents.memory.GenerativeAgentMemory [Required]¶ The memory object that combines relevance, recency, and ‘importance’. param name: str [Required]¶ The character’s name. param status: str [Required]¶ The traits of the character you wish not to change. param summary: str = ''¶ Stateful self-summary generated via reflection on the character’s memory. param summary_refresh_seconds: int = 3600¶ How frequently to re-generate the summary. param traits: str = 'N/A'¶ Permanent traits to ascribe to the character. param verbose: bool = False¶
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html
33ae0b19818a-1
Permanent traits to ascribe to the character. param verbose: bool = False¶ chain(prompt: PromptTemplate) → LLMChain[source]¶ generate_dialogue_response(observation: str, now: Optional[datetime] = None) → Tuple[bool, str][source]¶ React to a given observation. generate_reaction(observation: str, now: Optional[datetime] = None) → Tuple[bool, str][source]¶ React to a given observation. get_full_header(force_refresh: bool = False, now: Optional[datetime] = None) → str[source]¶ Return a full header of the agent’s status, summary, and current time. get_summary(force_refresh: bool = False, now: Optional[datetime] = None) → str[source]¶ Return a descriptive summary of the agent. summarize_related_memories(observation: str) → str[source]¶ Summarize memories that are most relevant to an observation. model Config[source]¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html
be827f77830d-0
langchain_experimental.generative_agents.memory.GenerativeAgentMemory¶ class langchain_experimental.generative_agents.memory.GenerativeAgentMemory(*, llm: BaseLanguageModel, memory_retriever: TimeWeightedVectorStoreRetriever, verbose: bool = False, reflection_threshold: Optional[float] = None, current_plan: List[str] = [], importance_weight: float = 0.15, aggregate_importance: float = 0.0, max_tokens_limit: int = 1200, queries_key: str = 'queries', most_recent_memories_token_key: str = 'recent_memories_token', add_memory_key: str = 'add_memory', relevant_memories_key: str = 'relevant_memories', relevant_memories_simple_key: str = 'relevant_memories_simple', most_recent_memories_key: str = 'most_recent_memories', now_key: str = 'now', reflecting: bool = False)[source]¶ Bases: BaseMemory Memory for the generative agent. 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 add_memory_key: str = 'add_memory'¶ param aggregate_importance: float = 0.0¶ Track the sum of the ‘importance’ of recent memories. Triggers reflection when it reaches reflection_threshold. param current_plan: List[str] = []¶ The current plan of the agent. param importance_weight: float = 0.15¶ How much weight to assign the memory importance. param llm: langchain.schema.language_model.BaseLanguageModel [Required]¶ The core language model. param max_tokens_limit: int = 1200¶ param memory_retriever: langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever [Required]¶
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.memory.GenerativeAgentMemory.html
be827f77830d-1
The retriever to fetch related memories. param most_recent_memories_key: str = 'most_recent_memories'¶ param most_recent_memories_token_key: str = 'recent_memories_token'¶ param now_key: str = 'now'¶ param queries_key: str = 'queries'¶ param reflecting: bool = False¶ param reflection_threshold: Optional[float] = None¶ When aggregate_importance exceeds reflection_threshold, stop to reflect. param relevant_memories_key: str = 'relevant_memories'¶ param relevant_memories_simple_key: str = 'relevant_memories_simple'¶ param verbose: bool = False¶ add_memories(memory_content: str, now: Optional[datetime] = None) → List[str][source]¶ Add an observations or memories to the agent’s memory. add_memory(memory_content: str, now: Optional[datetime] = None) → List[str][source]¶ Add an observation or memory to the agent’s memory. chain(prompt: PromptTemplate) → LLMChain[source]¶ clear() → None[source]¶ Clear memory contents. fetch_memories(observation: str, now: Optional[datetime] = None) → List[Document][source]¶ Fetch related memories. format_memories_detail(relevant_memories: List[Document]) → str[source]¶ format_memories_simple(relevant_memories: List[Document]) → str[source]¶ load_memory_variables(inputs: Dict[str, Any]) → Dict[str, str][source]¶ Return key-value pairs given the text input to the chain. pause_to_reflect(now: Optional[datetime] = None) → List[str][source]¶ Reflect on recent observations and generate ‘insights’. save_context(inputs: Dict[str, Any], outputs: Dict[str, Any]) → None[source]¶
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.memory.GenerativeAgentMemory.html
be827f77830d-2
Save the context of this model run to memory. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. property memory_variables: List[str]¶ Input keys this memory class will load dynamically. model Config¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶
https://api.python.langchain.com/en/latest/generative_agents/langchain_experimental.generative_agents.memory.GenerativeAgentMemory.html
43205a223da2-0
langchain.output_parsers.list.ListOutputParser¶ class langchain.output_parsers.list.ListOutputParser[source]¶ Bases: BaseOutputParser[List[str]] Parse the output of an LLM call to a list. 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. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ abstract parse(text: str) → List[str][source]¶ Parse the output of an LLM call. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.ListOutputParser.html
43205a223da2-1
property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.ListOutputParser.html
1027086b1adc-0
langchain.output_parsers.combining.CombiningOutputParser¶ class langchain.output_parsers.combining.CombiningOutputParser(*, parsers: List[BaseOutputParser])[source]¶ Bases: BaseOutputParser Combine multiple output parsers into one. 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 parsers: List[langchain.schema.output_parser.BaseOutputParser] [Required]¶ dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → Dict[str, Any][source]¶ Parse the output of an LLM call. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
1027086b1adc-1
Returns Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ validator validate_parsers  »  all fields[source]¶ Validate the parsers. property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
f1873598add9-0
langchain.output_parsers.enum.EnumOutputParser¶ class langchain.output_parsers.enum.EnumOutputParser(*, enum: Type[Enum])[source]¶ Bases: BaseOutputParser Parse an output that is one of a set of values. 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 enum: Type[enum.Enum] [Required]¶ The enum to parse. Its values must be strings. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(response: str) → Any[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.enum.EnumOutputParser.html
f1873598add9-1
prompt – Input PromptValue. Returns Structured output validator raise_deprecation  »  all fields[source]¶ to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶ Examples using EnumOutputParser¶ Enum parser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.enum.EnumOutputParser.html
3e8def2a4800-0
langchain.output_parsers.openai_functions.OutputFunctionsParser¶ class langchain.output_parsers.openai_functions.OutputFunctionsParser(*, args_only: bool = True)[source]¶ Bases: BaseGenerationOutputParser[Any] Parse an output that is one of sets of values. 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 args_only: bool = True¶ Whether to only return the arguments to the function call. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse_result(result: List[Generation]) → Any[source]¶ Parse a list of candidate model Generations into a specific format. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.OutputFunctionsParser.html
fe97978261dc-0
langchain.output_parsers.list.CommaSeparatedListOutputParser¶ class langchain.output_parsers.list.CommaSeparatedListOutputParser[source]¶ Bases: ListOutputParser Parse the output of an LLM call to a comma-separated list. 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. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → List[str][source]¶ Parse the output of an LLM call. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.CommaSeparatedListOutputParser.html
fe97978261dc-1
to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.CommaSeparatedListOutputParser.html
cdb69decf509-0
langchain.output_parsers.retry.RetryWithErrorOutputParser¶ class langchain.output_parsers.retry.RetryWithErrorOutputParser(*, parser: BaseOutputParser[T], retry_chain: LLMChain)[source]¶ Bases: BaseOutputParser[T] Wraps a parser and tries to fix parsing errors. Does this by passing the original prompt, the completion, AND the error that was raised to another language model and telling it that the completion did not work, and raised the given error. Differs from RetryOutputParser in that this implementation provides the error that was raised back to the LLM, which in theory should give it more information on how to fix it. 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 parser: langchain.schema.output_parser.BaseOutputParser[langchain.output_parsers.retry.T] [Required]¶ param retry_chain: langchain.chains.llm.LLMChain [Required]¶ dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. classmethod from_llm(llm: BaseLanguageModel, parser: BaseOutputParser[T], prompt: BasePromptTemplate = PromptTemplate(input_variables=['completion', 'error', 'prompt'], output_parser=None, partial_variables={}, template='Prompt:\n{prompt}\nCompletion:\n{completion}\n\nAbove, the Completion did not satisfy the constraints given in the Prompt.\nDetails: {error}\nPlease try again:', template_format='f-string', validate_template=True)) → RetryWithErrorOutputParser[T][source]¶ Create a RetryWithErrorOutputParser from an LLM. Parameters llm – The LLM to use to retry the completion. parser – The parser to use to parse the output. prompt – The prompt to use to retry the completion. Returns
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.retry.RetryWithErrorOutputParser.html
cdb69decf509-1
prompt – The prompt to use to retry the completion. Returns A RetryWithErrorOutputParser. get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(completion: str) → T[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt_value: PromptValue) → T[source]¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”]
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.retry.RetryWithErrorOutputParser.html
cdb69decf509-2
eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶ Examples using RetryWithErrorOutputParser¶ Retry parser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.retry.RetryWithErrorOutputParser.html
8f6f67b5eca0-0
langchain.output_parsers.retry.RetryOutputParser¶ class langchain.output_parsers.retry.RetryOutputParser(*, parser: BaseOutputParser[T], retry_chain: LLMChain)[source]¶ Bases: BaseOutputParser[T] Wraps a parser and tries to fix parsing errors. Does this by passing the original prompt and the completion to another LLM, and telling it the completion did not satisfy criteria in the prompt. 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 parser: langchain.schema.output_parser.BaseOutputParser[langchain.output_parsers.retry.T] [Required]¶ The parser to use to parse the output. param retry_chain: langchain.chains.llm.LLMChain [Required]¶ The LLMChain to use to retry the completion. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. classmethod from_llm(llm: BaseLanguageModel, parser: BaseOutputParser[T], prompt: BasePromptTemplate = PromptTemplate(input_variables=['completion', 'prompt'], output_parser=None, partial_variables={}, template='Prompt:\n{prompt}\nCompletion:\n{completion}\n\nAbove, the Completion did not satisfy the constraints given in the Prompt.\nPlease try again:', template_format='f-string', validate_template=True)) → RetryOutputParser[T][source]¶ get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(completion: str) → T[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.retry.RetryOutputParser.html
8f6f67b5eca0-1
Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt_value: PromptValue) → T[source]¶ Parse the output of an LLM call using a wrapped parser. Parameters completion – The chain completion to parse. prompt_value – The prompt to use to parse the completion. Returns The parsed completion. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶ Examples using RetryOutputParser¶ Retry parser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.retry.RetryOutputParser.html
5bdddf1a8590-0
langchain.output_parsers.boolean.BooleanOutputParser¶ class langchain.output_parsers.boolean.BooleanOutputParser(*, true_val: str = 'YES', false_val: str = 'NO')[source]¶ Bases: BaseOutputParser[bool] Parse the output of an LLM call to a boolean. 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 false_val: str = 'NO'¶ The string value that should be parsed as False. param true_val: str = 'YES'¶ The string value that should be parsed as True. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → bool[source]¶ Parse the output of an LLM call to a boolean. Parameters text – output of a language model Returns boolean parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.boolean.BooleanOutputParser.html
5bdddf1a8590-1
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 to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.boolean.BooleanOutputParser.html
13e9dd761389-0
langchain.output_parsers.json.SimpleJsonOutputParser¶ class langchain.output_parsers.json.SimpleJsonOutputParser[source]¶ Bases: BaseOutputParser[Any] Parse the output of an LLM call to a JSON object. 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. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → Any[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.json.SimpleJsonOutputParser.html
13e9dd761389-1
to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.json.SimpleJsonOutputParser.html
fd90a4e9d4b6-0
langchain.output_parsers.openai_functions.JsonKeyOutputFunctionsParser¶ class langchain.output_parsers.openai_functions.JsonKeyOutputFunctionsParser(*, args_only: bool = True, key_name: str)[source]¶ Bases: JsonOutputFunctionsParser Parse an output as the element of the Json object. 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 args_only: bool = True¶ Whether to only return the arguments to the function call. param key_name: str [Required]¶ The name of the key to return. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse_result(result: List[Generation]) → Any[source]¶ Parse a list of candidate model Generations into a specific format. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.JsonKeyOutputFunctionsParser.html
fd90a4e9d4b6-1
Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.JsonKeyOutputFunctionsParser.html
72deaf3c340e-0
langchain.output_parsers.datetime.DatetimeOutputParser¶ class langchain.output_parsers.datetime.DatetimeOutputParser(*, format: str = '%Y-%m-%dT%H:%M:%S.%fZ')[source]¶ Bases: BaseOutputParser[datetime] Parse the output of an LLM call to a datetime. 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 format: str = '%Y-%m-%dT%H:%M:%S.%fZ'¶ The string value that used as the datetime format. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(response: str) → datetime[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.datetime.DatetimeOutputParser.html
72deaf3c340e-1
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 to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶ Examples using DatetimeOutputParser¶ Datetime parser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.datetime.DatetimeOutputParser.html
0467257f3b62-0
langchain.output_parsers.structured.ResponseSchema¶ class langchain.output_parsers.structured.ResponseSchema(*, name: str, description: str, type: str = 'string')[source]¶ Bases: BaseModel A schema for a response from a structured output parser. 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 description: str [Required]¶ The description of the schema. param name: str [Required]¶ The name of the schema. param type: str = 'string'¶ The type of the response.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.structured.ResponseSchema.html
4f301e14620e-0
langchain.output_parsers.structured.StructuredOutputParser¶ class langchain.output_parsers.structured.StructuredOutputParser(*, response_schemas: List[ResponseSchema])[source]¶ Bases: BaseOutputParser Parse the output of an LLM call to a structured output. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param response_schemas: List[langchain.output_parsers.structured.ResponseSchema] [Required]¶ The schemas for the response. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. classmethod from_response_schemas(response_schemas: List[ResponseSchema]) → StructuredOutputParser[source]¶ get_format_instructions(only_json: bool = False) → str[source]¶ Get format instructions for the output parser. example: ```python from langchain.output_parsers.structured import ( StructuredOutputParser, ResponseSchema ) response_schemas = [ ResponseSchema(name=”foo”, description=”a list of strings”, type=”List[string]” ), ResponseSchema(name=”bar”, description=”a string”, type=”string” ), ] parser = StructuredOutputParser.from_response_schemas(response_schemas) print(parser.get_format_instructions()) output: # The output should be a Markdown code snippet formatted in the following # schema, including the leading and trailing “`json" and "`”: # # ```json # { # “foo”: List[string] // a list of strings # “bar”: string // a string # } Parameters only_json (bool) – If True, only the json in the Markdown code snippet will be returned, without the introducing text. Defaults to False.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.structured.StructuredOutputParser.html
4f301e14620e-1
will be returned, without the introducing text. Defaults to False. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → Any[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.structured.StructuredOutputParser.html
4f301e14620e-2
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. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.structured.StructuredOutputParser.html
80685b55b0d1-0
langchain.output_parsers.json.parse_and_check_json_markdown¶ langchain.output_parsers.json.parse_and_check_json_markdown(text: str, expected_keys: List[str]) → dict[source]¶ Parse a JSON string from a Markdown string and check that it contains the expected keys. Parameters text – The Markdown string. expected_keys – The expected keys in the JSON string. Returns The parsed JSON object as a Python dictionary.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.json.parse_and_check_json_markdown.html
9e731dc770e8-0
langchain.output_parsers.json.parse_json_markdown¶ langchain.output_parsers.json.parse_json_markdown(json_string: str) → dict[source]¶ Parse a JSON string from a Markdown string. Parameters json_string – The Markdown string. Returns The parsed JSON object as a Python dictionary.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.json.parse_json_markdown.html
c4b4225ae82c-0
langchain.output_parsers.openai_functions.PydanticOutputFunctionsParser¶ class langchain.output_parsers.openai_functions.PydanticOutputFunctionsParser(*, args_only: bool = True, pydantic_schema: Union[Type[BaseModel], Dict[str, Type[BaseModel]]])[source]¶ Bases: OutputFunctionsParser Parse an output as a pydantic object. 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 args_only: bool = True¶ Whether to only return the arguments to the function call. param pydantic_schema: Union[Type[pydantic.main.BaseModel], Dict[str, Type[pydantic.main.BaseModel]]] [Required]¶ The pydantic schema to parse the output with. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse_result(result: List[Generation]) → Any[source]¶ Parse a list of candidate model Generations into a specific format. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ validator validate_schema  »  all fields[source]¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.PydanticOutputFunctionsParser.html
c4b4225ae82c-1
property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.PydanticOutputFunctionsParser.html
d50dcbaef96c-0
langchain.output_parsers.regex.RegexParser¶ class langchain.output_parsers.regex.RegexParser(*, regex: str, output_keys: List[str], default_output_key: Optional[str] = None)[source]¶ Bases: BaseOutputParser Parse the output of an LLM call using a regex. 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 default_output_key: Optional[str] = None¶ The default key to use for the output. param output_keys: List[str] [Required]¶ The keys to use for the output. param regex: str [Required]¶ The regex to use to parse the output. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → Dict[str, str][source]¶ Parse the output of an LLM call. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ Parse the output of an LLM call with the input prompt for context. The prompt is largely provided in the event the OutputParser wants
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.regex.RegexParser.html
d50dcbaef96c-1
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 to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶ Examples using RegexParser¶ Multi-Agent Simulated Environment: Petting Zoo Multi-agent decentralized speaker selection Multi-agent authoritarian speaker selection Simulated Environment: Gymnasium
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.regex.RegexParser.html
32a1b54c669a-0
langchain.output_parsers.rail_parser.GuardrailsOutputParser¶ class langchain.output_parsers.rail_parser.GuardrailsOutputParser(*, guard: Any = None, api: Optional[Callable] = None, args: Any = None, kwargs: Any = None)[source]¶ Bases: BaseOutputParser Parse the output of an LLM call using Guardrails. 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 api: Optional[Callable] = None¶ The API to use for the Guardrails object. param args: Any = None¶ The arguments to pass to the API. param guard: Any = None¶ The Guardrails object. param kwargs: Any = None¶ The keyword arguments to pass to the API. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. classmethod from_pydantic(output_class: Any, num_reasks: int = 1, api: Optional[Callable] = None, *args: Any, **kwargs: Any) → GuardrailsOutputParser[source]¶ classmethod from_rail(rail_file: str, num_reasks: int = 1, api: Optional[Callable] = None, *args: Any, **kwargs: Any) → GuardrailsOutputParser[source]¶ Create a GuardrailsOutputParser from a rail file. Parameters rail_file – a rail file. num_reasks – number of times to re-ask the question. api – the API to use for the Guardrails object. *args – The arguments to pass to the API **kwargs – The keyword arguments to pass to the API. Returns GuardrailsOutputParser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.rail_parser.GuardrailsOutputParser.html
32a1b54c669a-1
**kwargs – The keyword arguments to pass to the API. Returns GuardrailsOutputParser classmethod from_rail_string(rail_str: str, num_reasks: int = 1, api: Optional[Callable] = None, *args: Any, **kwargs: Any) → GuardrailsOutputParser[source]¶ get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → Dict[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.rail_parser.GuardrailsOutputParser.html
32a1b54c669a-2
serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.rail_parser.GuardrailsOutputParser.html
d75d37041987-0
langchain.output_parsers.pydantic.PydanticOutputParser¶ class langchain.output_parsers.pydantic.PydanticOutputParser(*, pydantic_object: Type[T])[source]¶ Bases: BaseOutputParser[T] Parse an output using a pydantic model. 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 pydantic_object: Type[langchain.output_parsers.pydantic.T] [Required]¶ The pydantic model to parse. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → T[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.pydantic.PydanticOutputParser.html
d75d37041987-1
the prompt to do so. Parameters completion – String output of a language model. prompt – Input PromptValue. Returns Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶ Examples using PydanticOutputParser¶ MultiQueryRetriever WebResearchRetriever Retry parser Pydantic (JSON) parser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.pydantic.PydanticOutputParser.html
781b35704fdb-0
langchain.output_parsers.openai_functions.JsonOutputFunctionsParser¶ class langchain.output_parsers.openai_functions.JsonOutputFunctionsParser(*, args_only: bool = True)[source]¶ Bases: OutputFunctionsParser Parse an output as the Json object. 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 args_only: bool = True¶ Whether to only return the arguments to the function call. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse_result(result: List[Generation]) → Any[source]¶ Parse a list of candidate model Generations into a specific format. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.JsonOutputFunctionsParser.html
a1a50727d570-0
langchain.output_parsers.regex_dict.RegexDictParser¶ class langchain.output_parsers.regex_dict.RegexDictParser(*, regex_pattern: str = "{}:\\s?([^.'\\n']*)\\.?", output_key_to_format: Dict[str, str], no_update_value: Optional[str] = None)[source]¶ Bases: BaseOutputParser Parse the output of an LLM call into a Dictionary using a regex. 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 no_update_value: Optional[str] = None¶ The default key to use for the output. param output_key_to_format: Dict[str, str] [Required]¶ The keys to use for the output. param regex_pattern: str = "{}:\\s?([^.'\\n']*)\\.?"¶ The regex pattern to use to parse the output. dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. get_format_instructions() → str¶ Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(text: str) → Dict[str, str][source]¶ Parse the output of an LLM call. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.regex_dict.RegexDictParser.html
a1a50727d570-1
Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.regex_dict.RegexDictParser.html
7dfdb2938dae-0
langchain.output_parsers.loading.load_output_parser¶ langchain.output_parsers.loading.load_output_parser(config: dict) → dict[source]¶ Load an output parser. Parameters config – config dict Returns config dict with output parser loaded
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.loading.load_output_parser.html
24a7b014b922-0
langchain.output_parsers.fix.OutputFixingParser¶ class langchain.output_parsers.fix.OutputFixingParser(*, parser: BaseOutputParser[T], retry_chain: LLMChain)[source]¶ Bases: BaseOutputParser[T] Wraps a parser and tries to fix parsing errors. 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 parser: langchain.schema.output_parser.BaseOutputParser[langchain.output_parsers.fix.T] [Required]¶ param retry_chain: langchain.chains.llm.LLMChain [Required]¶ dict(**kwargs: Any) → Dict¶ Return dictionary representation of output parser. classmethod from_llm(llm: BaseLanguageModel, parser: BaseOutputParser[T], prompt: BasePromptTemplate = PromptTemplate(input_variables=['completion', 'error', 'instructions'], output_parser=None, partial_variables={}, template='Instructions:\n--------------\n{instructions}\n--------------\nCompletion:\n--------------\n{completion}\n--------------\n\nAbove, the Completion did not satisfy the constraints given in the Instructions.\nError:\n--------------\n{error}\n--------------\n\nPlease try again. Please only respond with an answer that satisfies the constraints laid out in the Instructions:', template_format='f-string', validate_template=True)) → OutputFixingParser[T][source]¶ Create an OutputFixingParser from a language model and a parser. Parameters llm – llm to use for fixing parser – parser to use for parsing prompt – prompt to use for fixing Returns OutputFixingParser get_format_instructions() → str[source]¶ Instructions on how the LLM output should be formatted.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.fix.OutputFixingParser.html
24a7b014b922-1
Instructions on how the LLM output should be formatted. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse(completion: str) → T[source]¶ Parse a single string model output into some structure. Parameters text – String output of a language model. Returns Structured output. parse_result(result: List[Generation]) → T¶ 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 a single model input. Returns Structured output. parse_with_prompt(completion: str, prompt: PromptValue) → Any¶ 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 Structured output to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.fix.OutputFixingParser.html
24a7b014b922-2
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. model Config¶ Bases: object extra = 'ignore'¶ Examples using OutputFixingParser¶ Retry parser
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.fix.OutputFixingParser.html
5f2920e91b68-0
langchain.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser¶ class langchain.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser(*, args_only: bool = True, pydantic_schema: Union[Type[BaseModel], Dict[str, Type[BaseModel]]], attr_name: str)[source]¶ Bases: PydanticOutputFunctionsParser Parse an output as an attribute of a pydantic object. 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 args_only: bool = True¶ Whether to only return the arguments to the function call. param attr_name: str [Required]¶ The name of the attribute to return. param pydantic_schema: Union[Type[pydantic.main.BaseModel], Dict[str, Type[pydantic.main.BaseModel]]] [Required]¶ The pydantic schema to parse the output with. invoke(input: str | langchain.schema.messages.BaseMessage, config: langchain.schema.runnable.RunnableConfig | None = None) → T¶ parse_result(result: List[Generation]) → Any[source]¶ Parse a list of candidate model Generations into a specific format. Parameters result – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input. Returns Structured output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ validator validate_schema  »  all fields¶ property lc_attributes: Dict¶ Return a list of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_namespace: List[str]¶ Return the namespace of the langchain object.
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser.html
5f2920e91b68-1
property lc_namespace: List[str]¶ Return the namespace of the langchain object. eg. [“langchain”, “llms”, “openai”] property lc_secrets: Dict[str, str]¶ Return a map of constructor argument names to secret ids. eg. {“openai_api_key”: “OPENAI_API_KEY”} property lc_serializable: bool¶ Return whether or not the class is serializable. model Config¶ Bases: object extra = 'ignore'¶
https://api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser.html
0acc3f40716b-0
langchain.utilities.loading.try_load_from_hub¶ langchain.utilities.loading.try_load_from_hub(path: Union[str, Path], loader: Callable[[str], T], valid_prefix: str, valid_suffixes: Set[str], **kwargs: Any) → Optional[T][source]¶ Load configuration from hub. Returns None if path is not a hub path.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.loading.try_load_from_hub.html
31f6e063f319-0
langchain.utilities.jira.JiraAPIWrapper¶ class langchain.utilities.jira.JiraAPIWrapper(*, jira: Any = None, confluence: Any = None, jira_username: Optional[str] = None, jira_api_token: Optional[str] = None, jira_instance_url: Optional[str] = None)[source]¶ Bases: BaseModel Wrapper for Jira API. 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 confluence: Any = None¶ param jira_api_token: Optional[str] = None¶ param jira_instance_url: Optional[str] = None¶ param jira_username: Optional[str] = None¶ issue_create(query: str) → str[source]¶ other(query: str) → str[source]¶ page_create(query: str) → str[source]¶ parse_issues(issues: Dict) → List[dict][source]¶ parse_projects(projects: List[dict]) → List[dict][source]¶ project() → str[source]¶ run(mode: str, query: str) → str[source]¶ search(query: str) → str[source]¶ validator validate_environment  »  all fields[source]¶ Validate that api key and python package exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. extra = 'forbid'¶ Examples using JiraAPIWrapper¶ Jira
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.jira.JiraAPIWrapper.html
d6d901c71218-0
langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper¶ class langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper(*, metaphor_api_key: str, k: int = 10)[source]¶ Bases: BaseModel Wrapper for Metaphor Search API. 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 k: int = 10¶ param metaphor_api_key: str [Required]¶ results(query: str, num_results: int, include_domains: Optional[List[str]] = None, exclude_domains: Optional[List[str]] = None, start_crawl_date: Optional[str] = None, end_crawl_date: Optional[str] = None, start_published_date: Optional[str] = None, end_published_date: Optional[str] = None, use_autoprompt: Optional[bool] = None) → List[Dict][source]¶ Run query through Metaphor Search and return metadata. Parameters query – The query to search for. num_results – The number of results to return. include_domains – A list of domains to include in the search. Only one of include_domains and exclude_domains should be defined. exclude_domains – A list of domains to exclude from the search. Only one of include_domains and exclude_domains should be defined. start_crawl_date – If specified, only pages we crawled after start_crawl_date will be returned. end_crawl_date – If specified, only pages we crawled before end_crawl_date will be returned. start_published_date – If specified, only pages published after start_published_date will be returned. end_published_date – If specified, only pages published before end_published_date will be returned. use_autoprompt – If true, we turn your query into a more Metaphor-friendly query. Adds latency.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper.html
d6d901c71218-1
Returns title - The title of the page url - The url author - Author of the content, if applicable. Otherwise, None. published_date - Estimated date published in YYYY-MM-DD format. Otherwise, None. Return type A list of dictionaries with the following keys async results_async(query: str, num_results: int, include_domains: Optional[List[str]] = None, exclude_domains: Optional[List[str]] = None, start_crawl_date: Optional[str] = None, end_crawl_date: Optional[str] = None, start_published_date: Optional[str] = None, end_published_date: Optional[str] = None, use_autoprompt: Optional[bool] = None) → List[Dict][source]¶ Get results from the Metaphor Search API asynchronously. validator validate_environment  »  all fields[source]¶ Validate that api key and endpoint exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. extra = 'forbid'¶ Examples using MetaphorSearchAPIWrapper¶ Metaphor Search
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.metaphor_search.MetaphorSearchAPIWrapper.html
7e4404dc1fd1-0
langchain.utilities.bing_search.BingSearchAPIWrapper¶ class langchain.utilities.bing_search.BingSearchAPIWrapper(*, bing_subscription_key: str, bing_search_url: str, k: int = 10)[source]¶ Bases: BaseModel Wrapper for Bing Search API. In order to set this up, follow instructions at: https://levelup.gitconnected.com/api-tutorial-how-to-use-bing-web-search-api-in-python-4165d5592a7e 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 bing_search_url: str [Required]¶ param bing_subscription_key: str [Required]¶ param k: int = 10¶ results(query: str, num_results: int) → List[Dict][source]¶ Run query through BingSearch and return metadata. Parameters query – The query to search for. num_results – The number of results to return. Returns snippet - The description of the result. title - The title of the result. link - The link to the result. Return type A list of dictionaries with the following keys run(query: str) → str[source]¶ Run query through BingSearch and parse result. validator validate_environment  »  all fields[source]¶ Validate that api key and endpoint exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. extra = 'forbid'¶ Examples using BingSearchAPIWrapper¶ Bing Search
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bing_search.BingSearchAPIWrapper.html
95807aa9987e-0
langchain.utilities.python.warn_once¶ langchain.utilities.python.warn_once() → None[source]¶ Warn once about the dangers of PythonREPL.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.python.warn_once.html
589f23588e3a-0
langchain.utilities.bibtex.BibtexparserWrapper¶ class langchain.utilities.bibtex.BibtexparserWrapper[source]¶ Bases: BaseModel Wrapper around bibtexparser. To use, you should have the bibtexparser python package installed. https://bibtexparser.readthedocs.io/en/master/ This wrapper will use bibtexparser to load a collection of references from a bibtex file and fetch document summaries. 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. get_metadata(entry: Mapping[str, Any], load_extra: bool = False) → Dict[str, Any][source]¶ Get metadata for the given entry. load_bibtex_entries(path: str) → List[Dict[str, Any]][source]¶ Load bibtex entries from the bibtex file at the given path. validator validate_environment  »  all fields[source]¶ Validate that the python package exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. extra = 'forbid'¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
6fec3affb05b-0
langchain.utilities.brave_search.BraveSearchWrapper¶ class langchain.utilities.brave_search.BraveSearchWrapper(*, api_key: str, search_kwargs: dict = None, base_url: str = 'https://api.search.brave.com/res/v1/web/search')[source]¶ Bases: BaseModel Wrapper around the Brave search engine. 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 api_key: str [Required]¶ The API key to use for the Brave search engine. param base_url = 'https://api.search.brave.com/res/v1/web/search'¶ The base URL for the Brave search engine. param search_kwargs: dict [Optional]¶ Additional keyword arguments to pass to the search request. download_documents(query: str) → List[Document][source]¶ Query the Brave search engine and return the results as a list of Documents. Parameters query – The query to search for. Returns: The results as a list of Documents. run(query: str) → str[source]¶ Query the Brave search engine and return the results as a JSON string. Parameters query – The query to search for. Returns: The results as a JSON string.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.brave_search.BraveSearchWrapper.html
340e86d98ddb-0
langchain.utilities.scenexplain.SceneXplainAPIWrapper¶ class langchain.utilities.scenexplain.SceneXplainAPIWrapper(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, scenex_api_key: str, scenex_api_url: str = 'https://api.scenex.jina.ai/v1/describe')[source]¶ Bases: BaseSettings, BaseModel Wrapper for SceneXplain API. In order to set this up, you need API key for the SceneXplain API. You can obtain a key by following the steps below. - Sign up for a free account at https://scenex.jina.ai/. - Navigate to the API Access page (https://scenex.jina.ai/api) and create a new API key. 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 scenex_api_key: str [Required]¶ param scenex_api_url: str = 'https://api.scenex.jina.ai/v1/describe'¶ run(image: str) → str[source]¶ Run SceneXplain image explainer. validator validate_environment  »  all fields[source]¶ Validate that api key exists in environment. model Config¶ Bases: BaseConfig getter_dict¶ alias of GetterDict
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html
340e86d98ddb-1
model Config¶ Bases: BaseConfig getter_dict¶ alias of GetterDict classmethod customise_sources(init_settings: Callable[[BaseSettings], Dict[str, Any]], env_settings: Callable[[BaseSettings], Dict[str, Any]], file_secret_settings: Callable[[BaseSettings], Dict[str, Any]]) → Tuple[Callable[[BaseSettings], Dict[str, Any]], ...]¶ classmethod get_field_info(name: unicode) → Dict[str, Any]¶ Get properties of FieldInfo from the fields property of the config class. json_dumps(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)¶ Serialize obj to a JSON formatted str. If skipkeys is true then dict keys that are not basic types (str, int, float, bool, None) will be skipped instead of raising a TypeError. If ensure_ascii is false, then the return value can contain non-ASCII characters if they appear in strings contained in obj. Otherwise, all such characters are escaped in JSON strings. If check_circular is false, then the circular reference check for container types will be skipped and a circular reference will result in an RecursionError (or worse). If allow_nan is false, then it will be a ValueError to serialize out of range float values (nan, inf, -inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN, Infinity, -Infinity). If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. If specified, separators should be an (item_separator, key_separator)
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html
340e86d98ddb-2
representation. If specified, separators should be an (item_separator, key_separator) tuple. The default is (', ', ': ') if indent is None and (',', ': ') otherwise. To get the most compact JSON representation, you should specify (',', ':') to eliminate whitespace. default(obj) is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If sort_keys is true (default: False), then the output of dictionaries will be sorted by key. To use a custom JSONEncoder subclass (e.g. one that overrides the .default() method to serialize additional types), specify it with the cls kwarg; otherwise JSONEncoder is used. json_loads(*, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)¶ Deserialize s (a str, bytes or bytearray instance containing a JSON document) to a Python object. object_hook is an optional function that will be called with the result of any object literal decode (a dict). The return value of object_hook will be used instead of the dict. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). object_pairs_hook is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of object_pairs_hook will be used instead of the dict. This feature can be used to implement custom decoders. If object_hook is also defined, the object_pairs_hook takes priority. parse_float, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal).
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html
340e86d98ddb-3
for JSON floats (e.g. decimal.Decimal). parse_int, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). parse_constant, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. To use a custom JSONDecoder subclass, specify it with the cls kwarg; otherwise JSONDecoder is used. classmethod parse_env_var(field_name: unicode, raw_val: unicode) → Any¶ classmethod prepare_field(field: ModelField) → None¶ Optional hook to check or modify fields during model creation. alias_generator = None¶ allow_inf_nan = True¶ allow_mutation = True¶ allow_population_by_field_name = False¶ anystr_lower = False¶ anystr_strip_whitespace = False¶ anystr_upper = False¶ arbitrary_types_allowed = True¶ case_sensitive = False¶ copy_on_model_validation = 'shallow'¶ env_file = None¶ env_file_encoding = None¶ env_nested_delimiter = None¶ env_prefix = ''¶ error_msg_templates = {}¶ extra = 'forbid'¶ fields = {}¶ frozen = False¶ json_encoders = {}¶ keep_untouched = ()¶ max_anystr_length = None¶ min_anystr_length = 0¶ orm_mode = False¶ post_init_call = 'before_validation'¶ schema_extra = {}¶ secrets_dir = None¶ smart_union = False¶ title = None¶ underscore_attrs_are_private = False¶ use_enum_values = False¶ validate_all = True¶ validate_assignment = False¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.scenexplain.SceneXplainAPIWrapper.html
2a8f5e21301a-0
langchain.utilities.twilio.TwilioAPIWrapper¶ class langchain.utilities.twilio.TwilioAPIWrapper(*, client: Any = None, account_sid: Optional[str] = None, auth_token: Optional[str] = None, from_number: Optional[str] = None)[source]¶ Bases: BaseModel Messaging Client using Twilio. To use, you should have the twilio python package installed, and the environment variables TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_FROM_NUMBER, or pass account_sid, auth_token, and from_number as named parameters to the constructor. Example from langchain.utilities.twilio import TwilioAPIWrapper twilio = TwilioAPIWrapper( account_sid="ACxxx", auth_token="xxx", from_number="+10123456789" ) twilio.run('test', '+12484345508') 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 account_sid: Optional[str] = None¶ Twilio account string identifier. param auth_token: Optional[str] = None¶ Twilio auth token. param from_number: Optional[str] = None¶ A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.twilio.TwilioAPIWrapper.html
2a8f5e21301a-1
Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using messaging_service_sid, this parameter must be empty. run(body: str, to: str) → str[source]¶ Run body through Twilio and respond with message sid. Parameters body – The text of the message you want to send. Can be up to 1,600 characters in length. to – The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. validator validate_environment  »  all fields[source]¶ Validate that api key and python package exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = False¶ extra = 'forbid'¶ Examples using TwilioAPIWrapper¶ Twilio
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.twilio.TwilioAPIWrapper.html
556bb9009631-0
langchain.utilities.openapi.HTTPVerb¶ class langchain.utilities.openapi.HTTPVerb(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶ Bases: str, Enum Enumerator of the HTTP verbs. Methods from_str(verb) Parse an HTTP verb. __init__(*args, **kwds) capitalize() Return a capitalized version of the string. casefold() Return a version of the string suitable for caseless comparisons. center(width[, fillchar]) Return a centered string of length width. count(sub[, start[, end]]) Return the number of non-overlapping occurrences of substring sub in string S[start:end]. encode([encoding, errors]) Encode the string using the codec registered for encoding. endswith(suffix[, start[, end]]) Return True if S ends with the specified suffix, False otherwise. expandtabs([tabsize]) Return a copy where all tab characters are expanded using spaces. find(sub[, start[, end]]) Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. format(*args, **kwargs) Return a formatted version of S, using substitutions from args and kwargs. format_map(mapping) Return a formatted version of S, using substitutions from mapping. index(sub[, start[, end]]) Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. isalnum() Return True if the string is an alpha-numeric string, False otherwise. isalpha() Return True if the string is an alphabetic string, False otherwise. isascii() Return True if all characters in the string are ASCII, False otherwise. isdecimal()
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-1
Return True if all characters in the string are ASCII, False otherwise. isdecimal() Return True if the string is a decimal string, False otherwise. isdigit() Return True if the string is a digit string, False otherwise. isidentifier() Return True if the string is a valid Python identifier, False otherwise. islower() Return True if the string is a lowercase string, False otherwise. isnumeric() Return True if the string is a numeric string, False otherwise. isprintable() Return True if the string is printable, False otherwise. isspace() Return True if the string is a whitespace string, False otherwise. istitle() Return True if the string is a title-cased string, False otherwise. isupper() Return True if the string is an uppercase string, False otherwise. join(iterable, /) Concatenate any number of strings. ljust(width[, fillchar]) Return a left-justified string of length width. lower() Return a copy of the string converted to lowercase. lstrip([chars]) Return a copy of the string with leading whitespace removed. maketrans Return a translation table usable for str.translate(). partition(sep, /) Partition the string into three parts using the given separator. removeprefix(prefix, /) Return a str with the given prefix string removed if present. removesuffix(suffix, /) Return a str with the given suffix string removed if present. replace(old, new[, count]) Return a copy with all occurrences of substring old replaced by new. rfind(sub[, start[, end]]) Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. rindex(sub[, start[, end]])
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-2
rindex(sub[, start[, end]]) Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. rjust(width[, fillchar]) Return a right-justified string of length width. rpartition(sep, /) Partition the string into three parts using the given separator. rsplit([sep, maxsplit]) Return a list of the substrings in the string, using sep as the separator string. rstrip([chars]) Return a copy of the string with trailing whitespace removed. split([sep, maxsplit]) Return a list of the substrings in the string, using sep as the separator string. splitlines([keepends]) Return a list of the lines in the string, breaking at line boundaries. startswith(prefix[, start[, end]]) Return True if S starts with the specified prefix, False otherwise. strip([chars]) Return a copy of the string with leading and trailing whitespace removed. swapcase() Convert uppercase characters to lowercase and lowercase characters to uppercase. title() Return a version of the string where each word is titlecased. translate(table, /) Replace each character in the string using the given translation table. upper() Return a copy of the string converted to uppercase. zfill(width, /) Pad a numeric string with zeros on the left, to fill a field of the given width. Attributes GET PUT POST DELETE OPTIONS HEAD PATCH TRACE capitalize()¶ Return a capitalized version of the string. More specifically, make the first character have upper case and the rest lower case. casefold()¶ Return a version of the string suitable for caseless comparisons. center(width, fillchar=' ', /)¶ Return a centered string of length width.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-3
center(width, fillchar=' ', /)¶ Return a centered string of length width. Padding is done using the specified fill character (default is a space). count(sub[, start[, end]]) → int¶ Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation. encode(encoding='utf-8', errors='strict')¶ Encode the string using the codec registered for encoding. encodingThe encoding in which to encode the string. errorsThe error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors. endswith(suffix[, start[, end]]) → bool¶ Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try. expandtabs(tabsize=8)¶ Return a copy where all tab characters are expanded using spaces. If tabsize is not given, a tab size of 8 characters is assumed. find(sub[, start[, end]]) → int¶ Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. format(*args, **kwargs) → str¶ Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’). format_map(mapping) → str¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-4
format_map(mapping) → str¶ Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’). classmethod from_str(verb: str) → HTTPVerb[source]¶ Parse an HTTP verb. index(sub[, start[, end]]) → int¶ Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found. isalnum()¶ Return True if the string is an alpha-numeric string, False otherwise. A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string. isalpha()¶ Return True if the string is an alphabetic string, False otherwise. A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string. isascii()¶ Return True if all characters in the string are ASCII, False otherwise. ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too. isdecimal()¶ Return True if the string is a decimal string, False otherwise. A string is a decimal string if all characters in the string are decimal and there is at least one character in the string. isdigit()¶ Return True if the string is a digit string, False otherwise. A string is a digit string if all characters in the string are digits and there is at least one character in the string. isidentifier()¶ Return True if the string is a valid Python identifier, False otherwise. Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-5
such as “def” or “class”. islower()¶ Return True if the string is a lowercase string, False otherwise. A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string. isnumeric()¶ Return True if the string is a numeric string, False otherwise. A string is numeric if all characters in the string are numeric and there is at least one character in the string. isprintable()¶ Return True if the string is printable, False otherwise. A string is printable if all of its characters are considered printable in repr() or if it is empty. isspace()¶ Return True if the string is a whitespace string, False otherwise. A string is whitespace if all characters in the string are whitespace and there is at least one character in the string. istitle()¶ Return True if the string is a title-cased string, False otherwise. In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones. isupper()¶ Return True if the string is an uppercase string, False otherwise. A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string. join(iterable, /)¶ Concatenate any number of strings. The string whose method is called is inserted in between each given string. The result is returned as a new string. Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’ ljust(width, fillchar=' ', /)¶ Return a left-justified string of length width. Padding is done using the specified fill character (default is a space). lower()¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-6
Padding is done using the specified fill character (default is a space). lower()¶ Return a copy of the string converted to lowercase. lstrip(chars=None, /)¶ Return a copy of the string with leading whitespace removed. If chars is given and not None, remove characters in chars instead. static maketrans()¶ Return a translation table usable for str.translate(). If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result. partition(sep, /)¶ Partition the string into three parts using the given separator. This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it. If the separator is not found, returns a 3-tuple containing the original string and two empty strings. removeprefix(prefix, /)¶ Return a str with the given prefix string removed if present. If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string. removesuffix(suffix, /)¶ Return a str with the given suffix string removed if present. If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string. replace(old, new, count=- 1, /)¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-7
string. replace(old, new, count=- 1, /)¶ Return a copy with all occurrences of substring old replaced by new. countMaximum number of occurrences to replace. -1 (the default value) means replace all occurrences. If the optional argument count is given, only the first count occurrences are replaced. rfind(sub[, start[, end]]) → int¶ Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. rindex(sub[, start[, end]]) → int¶ Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found. rjust(width, fillchar=' ', /)¶ Return a right-justified string of length width. Padding is done using the specified fill character (default is a space). rpartition(sep, /)¶ Partition the string into three parts using the given separator. This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it. If the separator is not found, returns a 3-tuple containing two empty strings and the original string. rsplit(sep=None, maxsplit=- 1)¶ Return a list of the substrings in the string, using sep as the separator string. sepThe separator used to split the string. When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-8
character (including \n \r \t \f and spaces) and will discard empty strings from the result. maxsplitMaximum number of splits (starting from the left). -1 (the default value) means no limit. Splitting starts at the end of the string and works to the front. rstrip(chars=None, /)¶ Return a copy of the string with trailing whitespace removed. If chars is given and not None, remove characters in chars instead. split(sep=None, maxsplit=- 1)¶ Return a list of the substrings in the string, using sep as the separator string. sepThe separator used to split the string. When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result. maxsplitMaximum number of splits (starting from the left). -1 (the default value) means no limit. Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module. splitlines(keepends=False)¶ Return a list of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless keepends is given and true. startswith(prefix[, start[, end]]) → bool¶ Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try. strip(chars=None, /)¶ Return a copy of the string with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. swapcase()¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
556bb9009631-9
If chars is given and not None, remove characters in chars instead. swapcase()¶ Convert uppercase characters to lowercase and lowercase characters to uppercase. title()¶ Return a version of the string where each word is titlecased. More specifically, words start with uppercased characters and all remaining cased characters have lower case. translate(table, /)¶ Replace each character in the string using the given translation table. tableTranslation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None. The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted. upper()¶ Return a copy of the string converted to uppercase. zfill(width, /)¶ Pad a numeric string with zeros on the left, to fill a field of the given width. The string is never truncated. DELETE = 'delete'¶ GET = 'get'¶ HEAD = 'head'¶ OPTIONS = 'options'¶ PATCH = 'patch'¶ POST = 'post'¶ PUT = 'put'¶ TRACE = 'trace'¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.HTTPVerb.html
c4ca825fc110-0
langchain.utilities.google_places_api.GooglePlacesAPIWrapper¶ class langchain.utilities.google_places_api.GooglePlacesAPIWrapper(*, gplaces_api_key: Optional[str] = None, google_map_client: Any = None, top_k_results: Optional[int] = None)[source]¶ Bases: BaseModel Wrapper around Google Places API. To use, you should have the googlemaps python package installed,an API key for the google maps platform, and the environment variable ‘’GPLACES_API_KEY’’ set with your API key , or pass ‘gplaces_api_key’ as a named parameter to the constructor. By default, this will return the all the results on the input query.You can use the top_k_results argument to limit the number of results. Example from langchain import GooglePlacesAPIWrapper gplaceapi = GooglePlacesAPIWrapper() 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 gplaces_api_key: Optional[str] = None¶ param top_k_results: Optional[int] = None¶ fetch_place_details(place_id: str) → Optional[str][source]¶ format_place_details(place_details: Dict[str, Any]) → Optional[str][source]¶ run(query: str) → str[source]¶ Run Places search and get k number of places that exists that match. validator validate_environment  »  all fields[source]¶ Validate that api key is in your environment variable. model Config[source]¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶ extra = 'forbid'¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.google_places_api.GooglePlacesAPIWrapper.html
e027e7bde031-0
langchain.utilities.sql_database.truncate_word¶ langchain.utilities.sql_database.truncate_word(content: Any, *, length: int, suffix: str = '...') → str[source]¶ Truncate a string to a certain number of words, based on the max string length.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.truncate_word.html
2efe152a65d0-0
langchain.utilities.python.PythonREPL¶ class langchain.utilities.python.PythonREPL(*, _globals: Optional[Dict] = None, _locals: Optional[Dict] = None)[source]¶ Bases: BaseModel Simulates a standalone Python REPL. 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 globals: Optional[Dict] [Optional] (alias '_globals')¶ param locals: Optional[Dict] [Optional] (alias '_locals')¶ run(command: str, timeout: Optional[int] = None) → str[source]¶ Run command with own globals/locals and returns anything printed. Timeout after the specified number of seconds. classmethod worker(command: str, globals: Optional[Dict], locals: Optional[Dict], queue: Queue) → None[source]¶ Examples using PythonREPL¶ Python REPL Dynamodb Chat Message History Python Agent
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.python.PythonREPL.html
b4cbdac2a403-0
langchain.utilities.github.GitHubAPIWrapper¶ class langchain.utilities.github.GitHubAPIWrapper(*, github: Any = None, github_repo_instance: Any = None, github_repository: Optional[str] = None, github_app_id: Optional[str] = None, github_app_private_key: Optional[str] = None, github_branch: Optional[str] = None, github_base_branch: Optional[str] = None)[source]¶ Bases: BaseModel Wrapper for GitHub API. 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 github_app_id: Optional[str] = None¶ param github_app_private_key: Optional[str] = None¶ param github_base_branch: Optional[str] = None¶ param github_branch: Optional[str] = None¶ param github_repository: Optional[str] = None¶ comment_on_issue(comment_query: str) → str[source]¶ Adds a comment to a github issue Parameters: comment_query(str): a string which contains the issue number, two newlines, and the comment. for example: “1 Working on it now” adds the comment “working on it now” to issue 1 Returns:str: A success or failure message create_file(file_query: str) → str[source]¶ Creates a new file on the Github repo Parameters: file_query(str): a string which contains the file path and the file contents. The file path is the first line in the string, and the contents are the rest of the string. For example, “hello_world.md # Hello World!” Returns:str: A success or failure message create_pull_request(pr_query: str) → str[source]¶ Makes a pull request from the bot’s branch to the base branch Parameters:
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
b4cbdac2a403-1
Makes a pull request from the bot’s branch to the base branch Parameters: pr_query(str): a string which contains the PR title and the PR body. The title is the first line in the string, and the body are the rest of the string. For example, “Updated README made changes to add info” Returns:str: A success or failure message delete_file(file_path: str) → str[source]¶ Deletes a file from the repo :param file_path: Where the file is :type file_path: str Returns Success or failure message Return type str get_issue(issue_number: int) → Dict[str, Any][source]¶ Fetches a specific issue and its first 10 comments :param issue_number: The number for the github issue :type issue_number: int Returns A doctionary containing the issue’s title, body, and comments as a string Return type dict get_issues() → str[source]¶ Fetches all open issues from the repo Returns A plaintext report containing the number of issues and each issue’s title and number. Return type str parse_issues(issues: List[Issue]) → List[dict][source]¶ Extracts title and number from each Issue and puts them in a dictionary :param issues: A list of Github Issue objects :type issues: List[Issue] Returns A dictionary of issue titles and numbers Return type List[dict] read_file(file_path: str) → str[source]¶ Reads a file from the github repo :param file_path: the file path :type file_path: str Returns The file decoded as a string Return type str run(mode: str, query: str) → str[source]¶ update_file(file_query: str) → str[source]¶ Updates a file with new content.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
b4cbdac2a403-2
Updates a file with new content. :param file_query: Contains the file path and the file contents. The old file contents is wrapped in OLD <<<< and >>>> OLD The new file contents is wrapped in NEW <<<< and >>>> NEW For example: /test/hello.txt OLD <<<< Hello Earth! >>>> OLD NEW <<<< Hello Mars! >>>> NEW Returns A success or failure message validator validate_environment  »  all fields[source]¶ Validate that api key and python package exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. extra = 'forbid'¶ Examples using GitHubAPIWrapper¶ Github Toolkit
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
0e943d032bd8-0
langchain.utilities.searx_search.SearxResults¶ class langchain.utilities.searx_search.SearxResults(data: str)[source]¶ Bases: dict Dict like wrapper around search api results. Take a raw result from Searx and make it into a dict like object. Methods __init__(data) Take a raw result from Searx and make it into a dict like object. clear() copy() fromkeys([value]) Create a new dictionary with keys from iterable and values set to value. get(key[, default]) Return the value for key if key is in the dictionary, else default. items() keys() pop(k[,d]) If the key is not found, return the default if given; otherwise, raise a KeyError. popitem() Remove and return a (key, value) pair as a 2-tuple. setdefault(key[, default]) Insert key with a value of default if key is not in the dictionary. update([E, ]**F) If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] values() Attributes answers Helper accessor on the json result. results Silence mypy for accessing this field. clear() → None.  Remove all items from D.¶ copy() → a shallow copy of D¶ fromkeys(value=None, /)¶ Create a new dictionary with keys from iterable and values set to value. get(key, default=None, /)¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxResults.html
0e943d032bd8-1
get(key, default=None, /)¶ Return the value for key if key is in the dictionary, else default. items() → a set-like object providing a view on D's items¶ keys() → a set-like object providing a view on D's keys¶ pop(k[, d]) → v, remove specified key and return the corresponding value.¶ If the key is not found, return the default if given; otherwise, raise a KeyError. popitem()¶ Remove and return a (key, value) pair as a 2-tuple. Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty. setdefault(key, default=None, /)¶ Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. update([E, ]**F) → None.  Update D from dict/iterable E and F.¶ If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] values() → an object providing a view on D's values¶ property answers: Any¶ Helper accessor on the json result.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxResults.html
8d5bd39f503a-0
langchain.utilities.google_serper.GoogleSerperAPIWrapper¶ class langchain.utilities.google_serper.GoogleSerperAPIWrapper(*, k: int = 10, gl: str = 'us', hl: str = 'en', type: Literal['news', 'search', 'places', 'images'] = 'search', tbs: Optional[str] = None, serper_api_key: Optional[str] = None, aiosession: Optional[ClientSession] = None, result_key_for_type: dict = {'images': 'images', 'news': 'news', 'places': 'places', 'search': 'organic'})[source]¶ Bases: BaseModel Wrapper around the Serper.dev Google Search API. You can create a free API key at https://serper.dev. To use, you should have the environment variable SERPER_API_KEY set with your API key, or pass serper_api_key as a named parameter to the constructor. Example from langchain import GoogleSerperAPIWrapper google_serper = GoogleSerperAPIWrapper() 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 aiosession: Optional[aiohttp.client.ClientSession] = None¶ param gl: str = 'us'¶ param hl: str = 'en'¶ param k: int = 10¶ param serper_api_key: Optional[str] = None¶ param tbs: Optional[str] = None¶ param type: Literal['news', 'search', 'places', 'images'] = 'search'¶ async aresults(query: str, **kwargs: Any) → Dict[source]¶ Run query through GoogleSearch. async arun(query: str, **kwargs: Any) → str[source]¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.google_serper.GoogleSerperAPIWrapper.html
8d5bd39f503a-1
async arun(query: str, **kwargs: Any) → str[source]¶ Run query through GoogleSearch and parse result async. results(query: str, **kwargs: Any) → Dict[source]¶ Run query through GoogleSearch. run(query: str, **kwargs: Any) → str[source]¶ Run query through GoogleSearch and parse result. validator validate_environment  »  all fields[source]¶ Validate that api key exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. arbitrary_types_allowed = True¶ Examples using GoogleSerperAPIWrapper¶ Google Serper API Google Serper Retrieve as you generate with FLARE FLARE
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.google_serper.GoogleSerperAPIWrapper.html
4337418e5c9a-0
langchain.utilities.arxiv.ArxivAPIWrapper¶ class langchain.utilities.arxiv.ArxivAPIWrapper(*, arxiv_search: Any = None, arxiv_exceptions: Any = None, top_k_results: int = 3, load_max_docs: int = 100, load_all_available_meta: bool = False, doc_content_chars_max: Optional[int] = 4000, ARXIV_MAX_QUERY_LENGTH: int = 300)[source]¶ Bases: BaseModel Wrapper around ArxivAPI. To use, you should have the arxiv python package installed. https://lukasschwab.me/arxiv.py/index.html This wrapper will use the Arxiv API to conduct searches and fetch document summaries. By default, it will return the document summaries of the top-k results. It limits the Document content by doc_content_chars_max. Set doc_content_chars_max=None if you don’t want to limit the content size. Parameters top_k_results – number of the top-scored document used for the arxiv tool ARXIV_MAX_QUERY_LENGTH – the cut limit on the query used for the arxiv tool. load_max_docs – a limit to the number of loaded documents load_all_available_meta – if True: the metadata of the loaded Documents contains all available meta info (see https://lukasschwab.me/arxiv.py/index.html#Result), if False: the metadata contains only the published date, title, authors and summary. doc_content_chars_max – an optional cut limit for the length of a document’s content Example from langchain.utilities.arxiv import ArxivAPIWrapper arxiv = ArxivAPIWrapper( top_k_results = 3, ARXIV_MAX_QUERY_LENGTH = 300, load_max_docs = 3, load_all_available_meta = False,
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html
4337418e5c9a-1
load_max_docs = 3, load_all_available_meta = False, doc_content_chars_max = 40000 ) arxiv.run("tree of thought llm) 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 arxiv_exceptions: Any = None¶ param doc_content_chars_max: Optional[int] = 4000¶ param load_all_available_meta: bool = False¶ param load_max_docs: int = 100¶ param top_k_results: int = 3¶ load(query: str) → List[Document][source]¶ Run Arxiv search and get the article texts plus the article meta information. See https://lukasschwab.me/arxiv.py/index.html#Search Returns: a list of documents with the document.page_content in text format Performs an arxiv search, downloads the top k results as PDFs, loads them as Documents, and returns them in a List. Parameters query – a plaintext search query run(query: str) → str[source]¶ Performs an arxiv search and A single string with the publish date, title, authors, and summary for each article separated by two newlines. If an error occurs or no documents found, error text is returned instead. Wrapper for https://lukasschwab.me/arxiv.py/index.html#Search Parameters query – a plaintext search query validator validate_environment  »  all fields[source]¶ Validate that the python package exists in environment. Examples using ArxivAPIWrapper¶ ArXiv API Tool
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html
c6fb82124f37-0
langchain.utilities.zapier.ZapierNLAWrapper¶ class langchain.utilities.zapier.ZapierNLAWrapper(*, zapier_nla_api_key: str, zapier_nla_oauth_access_token: str, zapier_nla_api_base: str = 'https://nla.zapier.com/api/v1/')[source]¶ Bases: BaseModel Wrapper for Zapier NLA. Full docs here: https://nla.zapier.com/start/ This wrapper supports both API Key and OAuth Credential auth methods. API Key is the fastest way to get started using this wrapper. Call this wrapper with either zapier_nla_api_key or zapier_nla_oauth_access_token arguments, or set the ZAPIER_NLA_API_KEY environment variable. If both arguments are set, the Access Token will take precedence. For use-cases where LangChain + Zapier NLA is powering a user-facing application, and LangChain needs access to the end-user’s connected accounts on Zapier.com, you’ll need to use OAuth. Review the full docs above to learn how to create your own provider and generate credentials. 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 zapier_nla_api_base: str = 'https://nla.zapier.com/api/v1/'¶ param zapier_nla_api_key: str [Required]¶ param zapier_nla_oauth_access_token: str [Required]¶ async alist() → List[Dict][source]¶ Returns a list of all exposed (enabled) actions associated with current user (associated with the set api_key). Change your exposed actions here: https://nla.zapier.com/demo/start/ The return list can be empty if no actions exposed. Else will contain
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
c6fb82124f37-1
The return list can be empty if no actions exposed. Else will contain a list of action objects: [{“id”: str, “description”: str, “params”: Dict[str, str] }] params will always contain an instructions key, the only required param. All others optional and if provided will override any AI guesses (see “understanding the AI guessing flow” here: https://nla.zapier.com/api/v1/docs) async alist_as_str() → str[source]¶ Same as list, but returns a stringified version of the JSON for insertting back into an LLM. async apreview(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶ Same as run, but instead of actually executing the action, will instead return a preview of params that have been guessed by the AI in case you need to explicitly review before executing. async apreview_as_str(*args, **kwargs) → str[source]¶ Same as preview, but returns a stringified version of the JSON for insertting back into an LLM. async arun(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶ Executes an action that is identified by action_id, must be exposed (enabled) by the current user (associated with the set api_key). Change your exposed actions here: https://nla.zapier.com/demo/start/ The return JSON is guaranteed to be less than ~500 words (350 tokens) making it safe to inject into the prompt of another LLM call. async arun_as_str(*args, **kwargs) → str[source]¶ Same as run, but returns a stringified version of the JSON for insertting back into an LLM.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
c6fb82124f37-2
insertting back into an LLM. list() → List[Dict][source]¶ Returns a list of all exposed (enabled) actions associated with current user (associated with the set api_key). Change your exposed actions here: https://nla.zapier.com/demo/start/ The return list can be empty if no actions exposed. Else will contain a list of action objects: [{“id”: str, “description”: str, “params”: Dict[str, str] }] params will always contain an instructions key, the only required param. All others optional and if provided will override any AI guesses (see “understanding the AI guessing flow” here: https://nla.zapier.com/docs/using-the-api#ai-guessing) list_as_str() → str[source]¶ Same as list, but returns a stringified version of the JSON for insertting back into an LLM. preview(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶ Same as run, but instead of actually executing the action, will instead return a preview of params that have been guessed by the AI in case you need to explicitly review before executing. preview_as_str(*args, **kwargs) → str[source]¶ Same as preview, but returns a stringified version of the JSON for insertting back into an LLM. run(action_id: str, instructions: str, params: Optional[Dict] = None) → Dict[source]¶ Executes an action that is identified by action_id, must be exposed (enabled) by the current user (associated with the set api_key). Change your exposed actions here: https://nla.zapier.com/demo/start/ The return JSON is guaranteed to be less than ~500 words (350
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
c6fb82124f37-3
The return JSON is guaranteed to be less than ~500 words (350 tokens) making it safe to inject into the prompt of another LLM call. run_as_str(*args, **kwargs) → str[source]¶ Same as run, but returns a stringified version of the JSON for insertting back into an LLM. validator validate_environment  »  all fields[source]¶ Validate that api key exists in environment. model Config[source]¶ Bases: object Configuration for this pydantic object. extra = 'forbid'¶ Examples using ZapierNLAWrapper¶ Zapier Natural Language Actions API
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html