id
stringlengths
14
15
text
stringlengths
44
2.47k
source
stringlengths
61
181
d111f581e727-0
langchain.utilities.twilio.TwilioAPIWrapper¶ class langchain.utilities.twilio.TwilioAPIWrapper[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 accoun...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.twilio.TwilioAPIWrapper.html
d111f581e727-1
cell phone number. If you are using messaging_service_sid, this parameter must be empty. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation i...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.twilio.TwilioAPIWrapper.html
d111f581e727-2
classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.twilio.TwilioAPIWrapper.html
d111f581e727-3
for other 3rd-party channels. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.twilio.TwilioAPIWrapper.html
4c0cd678eab9-0
langchain.utilities.sql_database.SQLDatabase¶ class langchain.utilities.sql_database.SQLDatabase(engine: Engine, schema: Optional[str] = None, metadata: Optional[MetaData] = None, ignore_tables: Optional[List[str]] = None, include_tables: Optional[List[str]] = None, sample_rows_in_table_info: int = 3, indexes_in_table_...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.SQLDatabase.html
4c0cd678eab9-1
Execute a SQL command and return a string representing the results. __init__(engine: Engine, schema: Optional[str] = None, metadata: Optional[MetaData] = None, ignore_tables: Optional[List[str]] = None, include_tables: Optional[List[str]] = None, sample_rows_in_table_info: int = 3, indexes_in_table_info: bool = False, ...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.SQLDatabase.html
4c0cd678eab9-2
CnosDB connection details. Return type SQLDatabase classmethod from_databricks(catalog: str, schema: str, host: Optional[str] = None, api_token: Optional[str] = None, warehouse_id: Optional[str] = None, cluster_id: Optional[str] = None, engine_args: Optional[dict] = None, **kwargs: Any) → SQLDatabase[source]¶ Class met...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.SQLDatabase.html
4c0cd678eab9-3
provided, the method configures the connection to use this cluster. Cannot be used with ‘warehouse_id’. If running in a Databricks notebook and both ‘warehouse_id’ and ‘cluster_id’ are None, it uses the ID of the cluster the notebook is attached to. Defaults to None. engine_args (Optional[dict]) – The arguments to be u...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.SQLDatabase.html
4c0cd678eab9-4
(https://arxiv.org/abs/2204.00498) If sample_rows_in_table_info, the specified number of sample rows will be appended to each table description. This can increase performance as demonstrated in the paper. get_table_names() → Iterable[str][source]¶ Get names of tables available. get_usable_table_names() → Iterable[str][...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.SQLDatabase.html
d4e3b334c572-0
langchain.utilities.wikipedia.WikipediaAPIWrapper¶ class langchain.utilities.wikipedia.WikipediaAPIWrapper[source]¶ Bases: BaseModel Wrapper around WikipediaAPI. To use, you should have the wikipedia python package installed. This wrapper will use the Wikipedia API to conduct searches and fetch page summaries. By defau...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.wikipedia.WikipediaAPIWrapper.html
d4e3b334c572-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.wikipedia.WikipediaAPIWrapper.html
d4e3b334c572-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(query: str) → str[source]¶ Run Wikipedia search and get page summaries. classmethod schema(by_alias: bool = T...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.wikipedia.WikipediaAPIWrapper.html
d6817944072b-0
langchain.utilities.spark_sql.SparkSQL¶ class langchain.utilities.spark_sql.SparkSQL(spark_session: Optional[SparkSession] = None, catalog: Optional[str] = None, schema: Optional[str] = None, ignore_tables: Optional[List[str]] = None, include_tables: Optional[List[str]] = None, sample_rows_in_table_info: int = 3)[sourc...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.spark_sql.SparkSQL.html
d6817944072b-1
Execute a SQL command and return a string representing the results. __init__(spark_session: Optional[SparkSession] = None, catalog: Optional[str] = None, schema: Optional[str] = None, ignore_tables: Optional[List[str]] = None, include_tables: Optional[List[str]] = None, sample_rows_in_table_info: int = 3)[source]¶ Init...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.spark_sql.SparkSQL.html
d6817944072b-2
demonstrated in the paper. get_usable_table_names() → Iterable[str][source]¶ Get names of tables available. run(command: str, fetch: str = 'all') → str[source]¶ run_no_throw(command: str, fetch: str = 'all') → str[source]¶ Execute a SQL command and return a string representing the results. If the statement returns rows...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.spark_sql.SparkSQL.html
f7edffacc3e4-0
langchain.utilities.opaqueprompts.sanitize¶ langchain.utilities.opaqueprompts.sanitize(input: Union[str, Dict[str, str]]) → Dict[str, Union[str, Dict[str, str]]][source]¶ Sanitize input string or dict of strings by replacing sensitive data with placeholders. It returns the sanitized input string or dict of strings and ...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.opaqueprompts.sanitize.html
e2b91eb3037d-0
langchain.utilities.powerbi.fix_table_name¶ langchain.utilities.powerbi.fix_table_name(table: str) → str[source]¶ Add single quotes around table names that contain spaces.
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.powerbi.fix_table_name.html
03c3424a8c6c-0
langchain.utilities.tensorflow_datasets.TensorflowDatasets¶ class langchain.utilities.tensorflow_datasets.TensorflowDatasets[source]¶ Bases: BaseModel Access to the TensorFlow Datasets. The Current implementation can work only with datasets that fit in a memory. TensorFlow Datasets is a collection of datasets ready to ...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.tensorflow_datasets.TensorflowDatasets.html
03c3424a8c6c-1
) 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 dataset_name: str = ''¶ param load_max_docs: int = 100¶ param sample_to_document_function: Optional[Callable[[Dict], langchain.schema.document.Document...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.tensorflow_datasets.TensorflowDatasets.html
03c3424a8c6c-2
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.tensorflow_datasets.TensorflowDatasets.html
03c3424a8c6c-3
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.tensorflow_datasets.TensorflowDatasets.html
1f220d3fc70c-0
langchain.utilities.wolfram_alpha.WolframAlphaAPIWrapper¶ class langchain.utilities.wolfram_alpha.WolframAlphaAPIWrapper[source]¶ Bases: BaseModel Wrapper for Wolfram Alpha. Docs for using: Go to wolfram alpha and sign up for a developer account Create an app and get your APP ID Save your APP ID into WOLFRAM_ALPHA_APPI...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.wolfram_alpha.WolframAlphaAPIWrapper.html
1f220d3fc70c-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.wolfram_alpha.WolframAlphaAPIWrapper.html
1f220d3fc70c-2
run(query: str) → str[source]¶ Run query through WolframAlpha and parse result. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ clas...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.wolfram_alpha.WolframAlphaAPIWrapper.html
e992ebe4d127-0
langchain.utilities.serpapi.HiddenPrints¶ class langchain.utilities.serpapi.HiddenPrints[source]¶ Context manager to hide prints. Methods __init__() __init__()¶
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.serpapi.HiddenPrints.html
85df0f76f92d-0
langchain.utilities.bash.BashProcess¶ class langchain.utilities.bash.BashProcess(strip_newlines: bool = False, return_err_output: bool = False, persistent: bool = False)[source]¶ Wrapper class for starting subprocesses. Uses the python built-in subprocesses.run() Persistent processes are not available on Windows system...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bash.BashProcess.html
85df0f76f92d-1
Parameters commands (List[str]) – a list of commands to execute in the session Examples using BashProcess¶ Bash chain
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bash.BashProcess.html
f01fa47e7dc0-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
a46cf1b93213-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 colle...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
a46cf1b93213-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
a46cf1b93213-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
f38d87d272ea-0
langchain.utilities.arxiv.ArxivAPIWrapper¶ class langchain.utilities.arxiv.ArxivAPIWrapper[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 ...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html
f38d87d272ea-1
) 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_MAX_QUERY_LENGTH: int = 300¶ param arxiv_exceptions: Any = None¶ param doc_content_chars_max: Optional[int] = 400...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html
f38d87d272ea-2
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html
f38d87d272ea-3
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 classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) ...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.arxiv.ArxivAPIWrapper.html
f4ac28b5e1a4-0
langchain.utilities.dataforseo_api_search.DataForSeoAPIWrapper¶ class langchain.utilities.dataforseo_api_search.DataForSeoAPIWrapper[source]¶ Bases: BaseModel Wrapper around the DataForSeo API. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data canno...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.dataforseo_api_search.DataForSeoAPIWrapper.html
f4ac28b5e1a4-1
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.dataforseo_api_search.DataForSeoAPIWrapper.html
f4ac28b5e1a4-2
classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n...
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.dataforseo_api_search.DataForSeoAPIWrapper.html
f4ac28b5e1a4-3
classmethod validate(value: Any) → Model¶ Examples using DataForSeoAPIWrapper¶ DataForSeo DataForSEO
https://api.python.langchain.com/en/latest/utilities/langchain.utilities.dataforseo_api_search.DataForSeoAPIWrapper.html
e0740d60cc56-0
langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer¶ class langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer(diffbot_api_key: Optional[str] = None, fact_confidence_threshold: float = 0.7, include_qualifiers: bool = True, include_evidence: bool = True, simplified_schema: boo...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html
e0740d60cc56-1
nlp_request(text) Make an API request to the Diffbot NLP endpoint. process_response(payload, document) Transform the Diffbot NLP response into a GraphDocument. __init__(diffbot_api_key: Optional[str] = None, fact_confidence_threshold: float = 0.7, include_qualifiers: bool = True, include_evidence: bool = True, simplifi...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html
e0740d60cc56-2
document (Document) – The original document. Returns The transformed document as a graph. Return type GraphDocument
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html
9990182d52fe-0
langchain_experimental.graph_transformers.diffbot.SimplifiedSchema¶ class langchain_experimental.graph_transformers.diffbot.SimplifiedSchema[source]¶ Provides functionality for working with a simplified schema mapping. schema¶ A dictionary containing the mapping to simplified schema types. Type Dict Initializes the sch...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.SimplifiedSchema.html
484d0d23b8ab-0
langchain_experimental.graph_transformers.diffbot.NodesList¶ class langchain_experimental.graph_transformers.diffbot.NodesList[source]¶ Manages a list of nodes with associated properties. nodes¶ Stores nodes as keys and their properties as values. Each key is a tuple where the first element is the node ID and the secon...
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.NodesList.html
6a66c909a183-0
langchain_experimental.graph_transformers.diffbot.format_property_key¶ langchain_experimental.graph_transformers.diffbot.format_property_key(s: str) → str[source]¶
https://api.python.langchain.com/en/latest/graph_transformers/langchain_experimental.graph_transformers.diffbot.format_property_key.html
7b110f4d6c7a-0
langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier¶ class langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier[source]¶ Bases: BaseTool Tool that uses deberta-v3-base-injection to detect prompt injection attacks....
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
7b110f4d6c7a-1
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...
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
7b110f4d6c7a-2
Run the tool asynchronously. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optio...
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
7b110f4d6c7a-3
Subclasses should override this method if they can batch more efficiently. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ fr...
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
7b110f4d6c7a-4
classmethod from_orm(obj: Any) → Model¶ invoke(input: Union[str, Dict], config: Optional[RunnableConfig] = None, **kwargs: Any) → Any¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults...
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
7b110f4d6c7a-5
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, run_name: Optional[st...
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
7b110f4d6c7a-6
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →...
https://api.python.langchain.com/en/latest/prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html
f6869b5fa7b0-0
langchain.tools.render.render_text_description_and_args¶ langchain.tools.render.render_text_description_and_args(tools: List[BaseTool]) → str[source]¶ Render the tool name, description, and args in plain text. Output will be in the format of: search: This tool is used for search, args: {"query": {"type": "string"}} cal...
https://api.python.langchain.com/en/latest/tools.render/langchain.tools.render.render_text_description_and_args.html
d3de36a22bcb-0
langchain.tools.render.format_tool_to_openai_function¶ langchain.tools.render.format_tool_to_openai_function(tool: BaseTool) → FunctionDescription[source]¶ Format tool into the OpenAI function API. Examples using format_tool_to_openai_function¶ Tools as OpenAI Functions
https://api.python.langchain.com/en/latest/tools.render/langchain.tools.render.format_tool_to_openai_function.html
5aef020851d8-0
langchain.tools.render.render_text_description¶ langchain.tools.render.render_text_description(tools: List[BaseTool]) → str[source]¶ Render the tool name and description in plain text. Output will be in the format of: search: This tool is used for search calculator: This tool is used for math
https://api.python.langchain.com/en/latest/tools.render/langchain.tools.render.render_text_description.html
34e8d0c3d0db-0
langchain.docstore.base.AddableMixin¶ class langchain.docstore.base.AddableMixin[source]¶ Mixin class that supports adding texts. Methods __init__() add(texts) Add more documents. __init__()¶ abstract add(texts: Dict[str, Document]) → None[source]¶ Add more documents.
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.base.AddableMixin.html
5a39189e1adb-0
langchain.docstore.wikipedia.Wikipedia¶ class langchain.docstore.wikipedia.Wikipedia[source]¶ Wrapper around wikipedia API. Check that wikipedia package is installed. Methods __init__() Check that wikipedia package is installed. delete(ids) Deleting IDs from in memory dictionary. search(search) Try to search for wiki p...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.wikipedia.Wikipedia.html
ad068b7251d5-0
langchain.docstore.base.Docstore¶ class langchain.docstore.base.Docstore[source]¶ Interface to access to place that stores documents. Methods __init__() delete(ids) Deleting IDs from in memory dictionary. search(search) Search for document. __init__()¶ delete(ids: List) → None[source]¶ Deleting IDs from in memory dicti...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.base.Docstore.html
6db9b7ed710e-0
langchain.docstore.arbitrary_fn.DocstoreFn¶ class langchain.docstore.arbitrary_fn.DocstoreFn(lookup_fn: Callable[[str], Union[Document, str]])[source]¶ Langchain Docstore via arbitrary lookup function. This is useful when: it’s expensive to construct an InMemoryDocstore/dict you retrieve documents from remote sources y...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.arbitrary_fn.DocstoreFn.html
6b98634e1c2f-0
langchain.docstore.in_memory.InMemoryDocstore¶ class langchain.docstore.in_memory.InMemoryDocstore(_dict: Optional[Dict[str, Document]] = None)[source]¶ Simple in memory docstore in the form of a dict. Initialize with dict. Methods __init__([_dict]) Initialize with dict. add(texts) Add texts to in memory dictionary. de...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.in_memory.InMemoryDocstore.html
ad9a9e8dd6e3-0
langchain.hub.push¶ langchain.hub.push(repo_full_name: str, object: Any, *, api_url: Optional[str] = None, api_key: Optional[str] = None, parent_commit_hash: Optional[str] = 'latest', new_repo_is_public: bool = True, new_repo_description: str = '') → str[source]¶ Pushes an object to the hub and returns the URL it can b...
https://api.python.langchain.com/en/latest/hub/langchain.hub.push.html
60ad2e43a5fc-0
langchain.hub.pull¶ langchain.hub.pull(owner_repo_commit: str, *, api_url: Optional[str] = None, api_key: Optional[str] = None) → Any[source]¶ Pulls an object from the hub and returns it as a LangChain object. Parameters owner_repo_commit – The full name of the repo to pull from in the format of owner/repo:commit_hash....
https://api.python.langchain.com/en/latest/hub/langchain.hub.pull.html
e954ca9ab9be-0
langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit¶ class langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit[source]¶ Bases: BaseToolkit Toolkit for interacting with the Browser Agent Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the in...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit.html
e954ca9ab9be-1
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ get_tools() → List[BaseTool][source]¶ Get the tools in the toolkit. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[A...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit.html
e954ca9ab9be-2
classmethod validate(value: Any) → Model¶ Examples using MultionToolkit¶ MultiOn
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.multion.toolkit.MultionToolkit.html
fb63eaf5b00b-0
langchain.agents.chat.output_parser.ChatOutputParser¶ class langchain.agents.chat.output_parser.ChatOutputParser[source]¶ Bases: AgentOutputParser Output parser for the chat agent. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed t...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
fb63eaf5b00b-1
to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support str...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
fb63eaf5b00b-2
Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Mode...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
fb63eaf5b00b-3
namespace is [“langchain”, “llms”, “openai”] invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶ classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
fb63eaf5b00b-4
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
fb63eaf5b00b-5
to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing...
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
fb63eaf5b00b-6
For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶
https://api.python.langchain.com/en/latest/agents/langchain.agents.chat.output_parser.ChatOutputParser.html
3fb1df070029-0
langchain.agents.load_tools.load_tools¶ langchain.agents.load_tools.load_tools(tool_names: List[str], llm: Optional[BaseLanguageModel] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → List[BaseTool][source]¶ Load tools based on their name. Parameters tool_names...
https://api.python.langchain.com/en/latest/agents/langchain.agents.load_tools.load_tools.html
4e843e8aefe9-0
langchain.agents.react.base.DocstoreExplorer¶ class langchain.agents.react.base.DocstoreExplorer(docstore: Docstore)[source]¶ Class to assist with exploration of a document store. Initialize with a docstore, and set initial document to None. Methods __init__(docstore) Initialize with a docstore, and set initial documen...
https://api.python.langchain.com/en/latest/agents/langchain.agents.react.base.DocstoreExplorer.html
9cd5f7f704fd-0
langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries¶ class langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries[source]¶ Bases: AgentOutputParser Output parser with retries for the structured chat agent. Create a new model by parsing and validating input ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
9cd5f7f704fd-1
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. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astr...
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
9cd5f7f704fd-2
Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Mode...
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
9cd5f7f704fd-3
classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then the namespace is [“langchain”, “llms”, “openai”] invoke(input: Union[str, BaseMessage], config: Optional[RunnableConfig] = None) → T¶ classmethod is_lc_serializable() → ...
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
9cd5f7f704fd-4
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ parse_result(result: List[Generation], *, partial: bool = False) → T¶ Parse a list of candidate model Generations...
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
9cd5f7f704fd-5
to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing...
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
9cd5f7f704fd-6
For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: Type[pydantic.main.BaseModel]¶
https://api.python.langchain.com/en/latest/agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html
5b2ce2925f33-0
langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent¶ langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent(llm: BaseLanguageModel, toolkit: VectorStoreToolkit, callback_manager: Optional[BaseCallbackManager] = None, prefix: str = 'You are an agent designed to answer questions a...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent.html
ce792c875c52-0
langchain.agents.agent_toolkits.csv.base.create_csv_agent¶ langchain.agents.agent_toolkits.csv.base.create_csv_agent(llm: BaseLanguageModel, path: Union[str, IOBase, List[Union[str, IOBase]]], pandas_kwargs: Optional[dict] = None, **kwargs: Any) → AgentExecutor[source]¶ Create csv agent by loading to a dataframe and us...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.csv.base.create_csv_agent.html
aa942fa67f92-0
langchain.agents.xml.base.XMLAgent¶ class langchain.agents.xml.base.XMLAgent[source]¶ Bases: BaseSingleActionAgent Agent that uses XML tags. Parameters tools – list of tools the agent can choose from llm_chain – The LLMChain to call to predict the next action Examples from langchain.agents import XMLAgent from langchai...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html
aa942fa67f92-1
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html
aa942fa67f92-2
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html
aa942fa67f92-3
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ tool_run_logging_kwargs() → Dict¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate...
https://api.python.langchain.com/en/latest/agents/langchain.agents.xml.base.XMLAgent.html
6779e5de1547-0
langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit¶ class langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit[source]¶ Bases: BaseToolkit Toolkit for routing between Vector Stores. Create a new model by parsing and validating input data from keyword arguments. Raises V...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html
6779e5de1547-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html
6779e5de1547-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html
534ba233c329-0
langchain.agents.agent_toolkits.nla.tool.NLATool¶ class langchain.agents.agent_toolkits.nla.tool.NLATool[source]¶ Bases: Tool Natural Language API Tool. Initialize tool. param args_schema: Optional[Type[BaseModel]] = None¶ Pydantic model class to validate and parse the tool’s input arguments. param callback_manager: Op...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
534ba233c329-1
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...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
534ba233c329-2
Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
534ba233c329-3
Bind arguments to a Runnable, returning a new Runnable. classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶ Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
534ba233c329-4
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_function(func: Optional[Callable], name: str, description: str, return_direct: bool = False, args_schema: Optional[Type[BaseModel]] = None, coroutine: Optional[Callable[[...], Awaitable[Any]]] =...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
534ba233c329-5
map() → Runnable[List[Input], List[Output]]¶ Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
534ba233c329-6
Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and lo...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.nla.tool.NLATool.html
c8aad984bb0f-0
langchain.agents.agent_toolkits.amadeus.toolkit.AmadeusToolkit¶ class langchain.agents.agent_toolkits.amadeus.toolkit.AmadeusToolkit[source]¶ Bases: BaseToolkit Toolkit for interacting with Office365. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input dat...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.amadeus.toolkit.AmadeusToolkit.html
c8aad984bb0f-1
deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.amadeus.toolkit.AmadeusToolkit.html
c8aad984bb0f-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.amadeus.toolkit.AmadeusToolkit.html