id
stringlengths
14
16
text
stringlengths
13
2.7k
source
stringlengths
57
178
d8c216c9cf77-1
Return type ApifyDatasetLoader async acall_actor_task(task_id: str, task_input: Dict, dataset_mapping_function: Callable[[Dict], Document], *, build: Optional[str] = None, memory_mbytes: Optional[int] = None, timeout_secs: Optional[int] = None) → ApifyDatasetLoader[source]¶ Run a saved Actor task on Apify and wait for results to be ready. :param task_id: The ID or name of the task on the Apify platform. :type task_id: str :param task_input: The input object of the task that you’re trying to run. Overrides the task’s saved input. Parameters dataset_mapping_function (Callable) – A function that takes a single dictionary (an Apify dataset item) and converts it to an instance of the Document class. build (str, optional) – Optionally specifies the actor build to run. It can be either a build tag or build number. memory_mbytes (int, optional) – Optional memory limit for the run, in megabytes. timeout_secs (int, optional) – Optional timeout for the run, in seconds. Returns A loader that will fetch the records from thetask run’s default dataset. Return type ApifyDatasetLoader call_actor(actor_id: str, run_input: Dict, dataset_mapping_function: Callable[[Dict], Document], *, build: Optional[str] = None, memory_mbytes: Optional[int] = None, timeout_secs: Optional[int] = None) → ApifyDatasetLoader[source]¶ Run an Actor on the Apify platform and wait for results to be ready. :param actor_id: The ID or name of the Actor on the Apify platform. :type actor_id: str :param run_input: The input object of the Actor that you’re trying to run. :type run_input: Dict
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.apify.ApifyWrapper.html
d8c216c9cf77-2
:type run_input: Dict :param dataset_mapping_function: A function that takes a single dictionary (an Apify dataset item) and converts it to an instance of the Document class. Parameters build (str, optional) – Optionally specifies the actor build to run. It can be either a build tag or build number. memory_mbytes (int, optional) – Optional memory limit for the run, in megabytes. timeout_secs (int, optional) – Optional timeout for the run, in seconds. Returns A loader that will fetch the records from theActor run’s default dataset. Return type ApifyDatasetLoader call_actor_task(task_id: str, task_input: Dict, dataset_mapping_function: Callable[[Dict], Document], *, build: Optional[str] = None, memory_mbytes: Optional[int] = None, timeout_secs: Optional[int] = None) → ApifyDatasetLoader[source]¶ Run a saved Actor task on Apify and wait for results to be ready. :param task_id: The ID or name of the task on the Apify platform. :type task_id: str :param task_input: The input object of the task that you’re trying to run. Overrides the task’s saved input. Parameters dataset_mapping_function (Callable) – A function that takes a single dictionary (an Apify dataset item) and converts it to an instance of the Document class. build (str, optional) – Optionally specifies the actor build to run. It can be either a build tag or build number. memory_mbytes (int, optional) – Optional memory limit for the run, in megabytes. timeout_secs (int, optional) – Optional timeout for the run, in seconds. Returns A loader that will fetch the records from thetask run’s default dataset. Return type ApifyDatasetLoader
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.apify.ApifyWrapper.html
d8c216c9cf77-3
Return type ApifyDatasetLoader 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.apify.ApifyWrapper.html
d8c216c9cf77-4
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_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using ApifyWrapper¶ Apify
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.apify.ApifyWrapper.html
84b49a245ab5-0
langchain.utilities.vertexai.init_vertexai¶ langchain.utilities.vertexai.init_vertexai(project: Optional[str] = None, location: Optional[str] = None, credentials: Optional[Credentials] = None) → None[source]¶ Init vertexai. Parameters project – The default GCP project to use when making Vertex API calls. location – The default location to use when making API calls. credentials – The default custom credentials to use when making API calls. If not provided credentials will be ascertained from the environment. Raises ImportError – If importing vertexai SDK did not succeed.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.vertexai.init_vertexai.html
9bdbc5d2bd69-0
langchain.utilities.clickup.Member¶ class langchain.utilities.clickup.Member(id: int, username: str, email: str, initials: str)[source]¶ Component class for a member. Attributes id username email initials Methods __init__(id, username, email, initials) from_data(data) __init__(id: int, username: str, email: str, initials: str) → None¶ classmethod from_data(data: Dict) → Member[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.Member.html
4e3b2afc24f8-0
langchain.utilities.zapier.ZapierNLAWrapper¶ class langchain.utilities.zapier.ZapierNLAWrapper[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 a list of action objects: [{“id”: str, “description”: str, “params”: Dict[str, str] }] params will always contain an instructions key, the only required
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
4e3b2afc24f8-1
}] 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. 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.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
4e3b2afc24f8-2
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] = None, deep: bool = False) → Model¶ Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
4e3b2afc24f8-3
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_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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(). 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. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
4e3b2afc24f8-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¶ 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 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. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
4e3b2afc24f8-5
Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using ZapierNLAWrapper¶ Zapier Natural Language Actions
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.zapier.ZapierNLAWrapper.html
e7ba515370d9-0
langchain.utilities.vertexai.raise_vertex_import_error¶ langchain.utilities.vertexai.raise_vertex_import_error(minimum_expected_version: str = '1.35.0') → None[source]¶ Raise ImportError related to Vertex SDK being not available. Parameters minimum_expected_version – The lowest expected version of the SDK. Raises ImportError – an ImportError that mentions a required version of the SDK.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.vertexai.raise_vertex_import_error.html
d72628a95b60-0
langchain.utilities.searx_search.SearxResults¶ class langchain.utilities.searx_search.SearxResults(data: str)[source]¶ Dict like wrapper around search api results. Take a raw result from Searx and make it into a dict like object. Attributes answers Helper accessor on the json result. results Silence mypy for accessing this field. 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() __init__(data: str)[source]¶ Take a raw result from Searx and make it into a dict like object. clear() → None.  Remove all items from D.¶ copy() → a shallow copy of D¶ fromkeys(value=None, /)¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxResults.html
d72628a95b60-1
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, /)¶ 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¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxResults.html
1f37c033c62f-0
langchain.utilities.github.GitHubAPIWrapper¶ class langchain.utilities.github.GitHubAPIWrapper[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 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
1f37c033c62f-1
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance 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: 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 dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
1f37c033c62f-2
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ 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 json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ 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
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
1f37c033c62f-3
:type issues: List[Issue] Returns A dictionary of issue titles and numbers Return type List[dict] 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¶ 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]¶ 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¶ update_file(file_query: str) → str[source]¶ 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 classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using GitHubAPIWrapper¶ Github
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.github.GitHubAPIWrapper.html
2dc352e9ea14-0
langchain.utilities.gitlab.GitLabAPIWrapper¶ class langchain.utilities.gitlab.GitLabAPIWrapper[source]¶ Bases: BaseModel Wrapper for GitLab 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 gitlab_base_branch: Optional[str] = None¶ The base branch in the GitLab repository, used for comparisons. Usually ‘main’ or ‘master’. Defaults to ‘main’. param gitlab_branch: Optional[str] = None¶ The specific branch in the GitLab repository where the bot will make its commits. Defaults to ‘main’. param gitlab_personal_access_token: Optional[str] = None¶ Personal access token for the GitLab service, used for authentication. param gitlab_repository: Optional[str] = None¶ The name of the GitLab repository, in the form {username}/{repo-name}. comment_on_issue(comment_query: str) → str[source]¶ Adds a comment to a gitlab 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 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.extra = ‘allow’ was set since it adds all passed values
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.gitlab.GitLabAPIWrapper.html
2dc352e9ea14-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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance create_file(file_query: str) → str[source]¶ Creates a new file on the gitlab 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: 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
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.gitlab.GitLabAPIWrapper.html
2dc352e9ea14-2
:type file_path: str Returns Success or failure message Return type str dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ 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 gitlab issue :type issue_number: int Returns A dictionary 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 json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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().
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.gitlab.GitLabAPIWrapper.html
2dc352e9ea14-3
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ 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 gitlab Issue objects :type issues: List[Issue] Returns A dictionary of issue titles and numbers Return type List[dict] 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¶ read_file(file_path: str) → str[source]¶ Reads a file from the gitlab 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]¶ 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¶ update_file(file_query: str) → str[source]¶ 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
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.gitlab.GitLabAPIWrapper.html
2dc352e9ea14-4
NEW <<<< Hello Mars! >>>> NEW Returns A success or failure message classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using GitLabAPIWrapper¶ Gitlab
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.gitlab.GitLabAPIWrapper.html
564809938d74-0
langchain.utilities.pubmed.PubMedAPIWrapper¶ class langchain.utilities.pubmed.PubMedAPIWrapper[source]¶ Bases: BaseModel Wrapper around PubMed API. This wrapper will use the PubMed API to conduct searches and fetch document summaries. By default, it will return the document summaries of the top-k results of an input search. Parameters top_k_results – number of the top-scored document used for the PubMed tool MAX_QUERY_LENGTH – maximum length of the query. Default is 300 characters. doc_content_chars_max – maximum length of the document content. Content will be truncated if it exceeds this length. Default is 2000 characters. max_retry – maximum number of retries for a request. Default is 5. sleep_time – time to wait between retries. Default is 0.2 seconds. email – email address to be used for the PubMed 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 MAX_QUERY_LENGTH: int = 300¶ param base_url_efetch: str = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?'¶ param base_url_esearch: str = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?'¶ param doc_content_chars_max: int = 2000¶ param email: str = '[email protected]'¶ param max_retry: int = 5¶ param sleep_time: float = 0.2¶ param top_k_results: int = 3¶ 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.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.pubmed.PubMedAPIWrapper.html
564809938d74-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] = None, deep: bool = False) → Model¶ Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.pubmed.PubMedAPIWrapper.html
564809938d74-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_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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(). lazy_load(query: str) → Iterator[dict][source]¶ Search PubMed for documents matching the query. Return an iterator of dictionaries containing the document metadata. lazy_load_docs(query: str) → Iterator[Document][source]¶ load(query: str) → List[dict][source]¶ Search PubMed for documents matching the query. Return a list of dictionaries containing the document metadata. load_docs(query: str) → List[Document][source]¶ classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ retrieve_article(uid: str, webenv: str) → dict[source]¶ run(query: str) → str[source]¶ Run PubMed search and get the article meta information.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.pubmed.PubMedAPIWrapper.html
564809938d74-3
Run PubMed search and get the article meta information. See https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch It uses only the most informative fields of article meta information. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.pubmed.PubMedAPIWrapper.html
aa851b9aa29e-0
langchain.utilities.redis.get_client¶ langchain.utilities.redis.get_client(redis_url: str, **kwargs: Any) → RedisType[source]¶ Get a redis client from the connection url given. This helper accepts urls for Redis server (TCP with/without TLS or UnixSocket) as well as Redis Sentinel connections. Redis Cluster is not supported. Before creating a connection the existence of the database driver is checked an and ValueError raised otherwise To use, you should have the redis python package installed. Example from langchain.utilities.redis import get_client redis_client = get_client( redis_url="redis://username:password@localhost:6379" index_name="my-index", embedding_function=embeddings.embed_query, ) To use a redis replication setup with multiple redis server and redis sentinels set “redis_url” to “redis+sentinel://” scheme. With this url format a path is needed holding the name of the redis service within the sentinels to get the correct redis server connection. The default service name is “mymaster”. The optional second part of the path is the redis db number to connect to. An optional username or password is used for booth connections to the rediserver and the sentinel, different passwords for server and sentinel are not supported. And as another constraint only one sentinel instance can be given: Example from langchain.utilities.redis import get_client redis_client = get_client( redis_url="redis+sentinel://username:password@sentinelhost:26379/mymaster/0" index_name="my-index", embedding_function=embeddings.embed_query, )
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.redis.get_client.html
4b6a72bc5f1c-0
langchain.utilities.clickup.extract_dict_elements_from_component_fields¶ langchain.utilities.clickup.extract_dict_elements_from_component_fields(data: dict, component: Type[Component]) → dict[source]¶ Extract elements from a dictionary. Parameters data – The dictionary to extract elements from. component – The component to extract elements from. Returns A dictionary containing the elements from the input dictionary that are also in the component.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.extract_dict_elements_from_component_fields.html
642e6c6936c9-0
langchain.utilities.arcee.ArceeWrapper¶ class langchain.utilities.arcee.ArceeWrapper(arcee_api_key: str, arcee_api_url: str, arcee_api_version: str, model_kwargs: Optional[Dict[str, Any]], model_name: str)[source]¶ Wrapper for Arcee API. Initialize ArceeWrapper. Parameters arcee_api_key – API key for Arcee API. arcee_api_url – URL for Arcee API. arcee_api_version – Version of Arcee API. model_kwargs – Keyword arguments for Arcee API. model_name – Name of an Arcee model. Methods __init__(arcee_api_key, arcee_api_url, ...) Initialize ArceeWrapper. generate(prompt, **kwargs) Generate text from Arcee DALM. retrieve(query, **kwargs) Retrieve {size} contexts with your retriever for a given query validate_model_training_status() __init__(arcee_api_key: str, arcee_api_url: str, arcee_api_version: str, model_kwargs: Optional[Dict[str, Any]], model_name: str)[source]¶ Initialize ArceeWrapper. Parameters arcee_api_key – API key for Arcee API. arcee_api_url – URL for Arcee API. arcee_api_version – Version of Arcee API. model_kwargs – Keyword arguments for Arcee API. model_name – Name of an Arcee model. generate(prompt: str, **kwargs: Any) → str[source]¶ Generate text from Arcee DALM. Parameters prompt – Prompt to generate text from. size – The max number of context results to retrieve. Defaults to 3. (Can be less if filters are provided). filters – Filters to apply to the context dataset.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeWrapper.html
642e6c6936c9-1
filters – Filters to apply to the context dataset. retrieve(query: str, **kwargs: Any) → List[Document][source]¶ Retrieve {size} contexts with your retriever for a given query Parameters query – Query to submit to the model size – The max number of context results to retrieve. Defaults to 3. (Can be less if filters are provided). filters – Filters to apply to the context dataset. validate_model_training_status() → None[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeWrapper.html
d306b5f6dad5-0
langchain.utilities.arcee.ArceeDocument¶ class langchain.utilities.arcee.ArceeDocument[source]¶ Bases: BaseModel Arcee document. 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 id: str [Required]¶ param index: str [Required]¶ param score: float [Required]¶ param source: langchain.utilities.arcee.ArceeDocumentSource [Required]¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeDocument.html
d306b5f6dad5-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeDocument.html
d306b5f6dad5-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeDocument.html
9060ed13ccd3-0
langchain.utilities.graphql.GraphQLAPIWrapper¶ class langchain.utilities.graphql.GraphQLAPIWrapper[source]¶ Bases: BaseModel Wrapper around GraphQL API. To use, you should have the gql python package installed. This wrapper will use the GraphQL API to conduct queries. 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 custom_headers: Optional[Dict[str, str]] = None¶ param graphql_endpoint: str [Required]¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.graphql.GraphQLAPIWrapper.html
9060ed13ccd3-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(query: str) → str[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.graphql.GraphQLAPIWrapper.html
9060ed13ccd3-2
run(query: str) → str[source]¶ Run a GraphQL query and get the results. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using GraphQLAPIWrapper¶ GraphQL
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.graphql.GraphQLAPIWrapper.html
362f095afe57-0
langchain.utilities.arcee.ArceeRoute¶ class langchain.utilities.arcee.ArceeRoute(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶ Routes available for the Arcee API as enumerator. generate = 'models/generate'¶ retrieve = 'models/retrieve'¶ model_training_status = 'models/status/{id_or_name}'¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeRoute.html
a25de96e4ea9-0
langchain_experimental.utilities.python.PythonREPL¶ class langchain_experimental.utilities.python.PythonREPL[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')¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain_experimental.utilities.python.PythonREPL.html
a25de96e4ea9-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(command: str, timeout: Optional[int] = None) → str[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain_experimental.utilities.python.PythonREPL.html
a25de96e4ea9-2
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 schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ classmethod worker(command: str, globals: Optional[Dict], locals: Optional[Dict], queue: Queue) → None[source]¶ Examples using PythonREPL¶ Dynamodb Chat Message History Python Code writing
lang/api.python.langchain.com/en/latest/utilities/langchain_experimental.utilities.python.PythonREPL.html
0540c8df4d9c-0
langchain.utilities.requests.Requests¶ class langchain.utilities.requests.Requests[source]¶ Bases: BaseModel Wrapper around requests to handle auth and async. The main purpose of this wrapper is to handle authentication (by saving headers) and enable easy async methods on the same base 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 aiosession: Optional[aiohttp.client.ClientSession] = None¶ param auth: Optional[Any] = None¶ param headers: Optional[Dict[str, str]] = None¶ adelete(url: str, **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶ DELETE the URL and return the text asynchronously. aget(url: str, **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶ GET the URL and return the text asynchronously. apatch(url: str, data: Dict[str, Any], **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶ PATCH the URL and return the text asynchronously. apost(url: str, data: Dict[str, Any], **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶ POST to the URL and return the text asynchronously. aput(url: str, data: Dict[str, Any], **kwargs: Any) → AsyncGenerator[ClientResponse, None][source]¶ PUT the URL and return the text asynchronously. 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.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.Requests.html
0540c8df4d9c-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] = None, deep: bool = False) → Model¶ Duplicate a model, optionally choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance delete(url: str, **kwargs: Any) → Response[source]¶ DELETE the URL and return the text. dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ get(url: str, **kwargs: Any) → Response[source]¶ GET the URL and return the text.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.Requests.html
0540c8df4d9c-2
GET the URL and return the text. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ patch(url: str, data: Dict[str, Any], **kwargs: Any) → Response[source]¶ PATCH the URL and return the text. post(url: str, data: Dict[str, Any], **kwargs: Any) → Response[source]¶ POST to the URL and return the text. put(url: str, data: Dict[str, Any], **kwargs: Any) → Response[source]¶ PUT the URL and return the text. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.Requests.html
0540c8df4d9c-3
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using Requests¶ Natural Language APIs
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.Requests.html
82ff844c6ed8-0
langchain.utilities.requests.TextRequestsWrapper¶ class langchain.utilities.requests.TextRequestsWrapper[source]¶ Bases: BaseModel Lightweight wrapper around requests library. The main purpose of this wrapper is to always return a text 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 aiosession: Optional[aiohttp.client.ClientSession] = None¶ param auth: Optional[Any] = None¶ param headers: Optional[Dict[str, str]] = None¶ async adelete(url: str, **kwargs: Any) → str[source]¶ DELETE the URL and return the text asynchronously. async aget(url: str, **kwargs: Any) → str[source]¶ GET the URL and return the text asynchronously. async apatch(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶ PATCH the URL and return the text asynchronously. async apost(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶ POST to the URL and return the text asynchronously. async aput(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶ PUT the URL and return the text asynchronously. 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.extra = ‘allow’ was set since it adds all passed values
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.TextRequestsWrapper.html
82ff844c6ed8-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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance delete(url: str, **kwargs: Any) → str[source]¶ DELETE the URL and return the text. dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ get(url: str, **kwargs: Any) → str[source]¶ GET the URL and return the text.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.TextRequestsWrapper.html
82ff844c6ed8-2
GET the URL and return the text. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ patch(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶ PATCH the URL and return the text. post(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶ POST to the URL and return the text. put(url: str, data: Dict[str, Any], **kwargs: Any) → str[source]¶ PUT the URL and return the text. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.TextRequestsWrapper.html
82ff844c6ed8-3
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ property requests: langchain.utilities.requests.Requests¶ Examples using TextRequestsWrapper¶ Requests JSON OpenAPI Tool Input Schema
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.requests.TextRequestsWrapper.html
0a36fec64932-0
langchain.utilities.arcee.ArceeDocumentAdapter¶ class langchain.utilities.arcee.ArceeDocumentAdapter[source]¶ Adapter for Arcee documents Methods __init__() adapt(arcee_document) Adapts an ArceeDocument to a langchain's Document object. __init__()¶ classmethod adapt(arcee_document: ArceeDocument) → Document[source]¶ Adapts an ArceeDocument to a langchain’s Document object.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.arcee.ArceeDocumentAdapter.html
6ddac03f1f4a-0
langchain.utilities.searx_search.SearxSearchWrapper¶ class langchain.utilities.searx_search.SearxSearchWrapper[source]¶ Bases: BaseModel Wrapper for Searx API. To use you need to provide the searx host by passing the named parameter searx_host or exporting the environment variable SEARX_HOST. In some situations you might want to disable SSL verification, for example if you are running searx locally. You can do this by passing the named parameter unsecure. You can also pass the host url scheme as http to disable SSL. Example from langchain.utilities import SearxSearchWrapper searx = SearxSearchWrapper(searx_host="http://localhost:8888") Example with SSL disabled:from langchain.utilities import SearxSearchWrapper # note the unsecure parameter is not needed if you pass the url scheme as # http searx = SearxSearchWrapper(searx_host="http://localhost:8888", unsecure=True) 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[Any] = None¶ param categories: Optional[List[str]] = []¶ param engines: Optional[List[str]] = []¶ param headers: Optional[dict] = None¶ param k: int = 10¶ param params: dict [Optional]¶ param query_suffix: Optional[str] = ''¶ param searx_host: str = ''¶ param unsecure: bool = False¶ async aresults(query: str, num_results: int, engines: Optional[List[str]] = None, query_suffix: Optional[str] = '', **kwargs: Any) → List[Dict][source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxSearchWrapper.html
6ddac03f1f4a-1
Asynchronously query with json results. Uses aiohttp. See results for more info. async arun(query: str, engines: Optional[List[str]] = None, query_suffix: Optional[str] = '', **kwargs: Any) → str[source]¶ Asynchronously version of run. 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxSearchWrapper.html
6ddac03f1f4a-2
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ results(query: str, num_results: int, engines: Optional[List[str]] = None, categories: Optional[List[str]] = None, query_suffix: Optional[str] = '', **kwargs: Any) → List[Dict][source]¶ Run query through Searx API and returns the results with metadata. Parameters query – The query to search for. query_suffix – Extra suffix appended to the query. num_results – Limit the number of results to return. engines – List of engines to use for the query. categories – List of categories to use for the query.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxSearchWrapper.html
6ddac03f1f4a-3
categories – List of categories to use for the query. **kwargs – extra parameters to pass to the searx API. Returns {snippet: The description of the result. title: The title of the result. link: The link to the result. engines: The engines used for the result. category: Searx category of the result. } Return type Dict with the following keys run(query: str, engines: Optional[List[str]] = None, categories: Optional[List[str]] = None, query_suffix: Optional[str] = '', **kwargs: Any) → str[source]¶ Run query through Searx API and parse results. You can pass any other params to the searx query API. Parameters query – The query to search for. query_suffix – Extra suffix appended to the query. engines – List of engines to use for the query. categories – List of categories to use for the query. **kwargs – extra parameters to pass to the searx API. Returns The result of the query. Return type str Raises ValueError – If an error occurred with the query. Example This will make a query to the qwant engine: from langchain.utilities import SearxSearchWrapper searx = SearxSearchWrapper(searx_host="http://my.searx.host") searx.run("what is the weather in France ?", engine="qwant") # the same result can be achieved using the `!` syntax of searx # to select the engine using `query_suffix` searx.run("what is the weather in France ?", query_suffix="!qwant") classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxSearchWrapper.html
6ddac03f1f4a-4
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using SearxSearchWrapper¶ SearxNG Search SearxNG Search API
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searx_search.SearxSearchWrapper.html
e0d8a7433728-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.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.powerbi.fix_table_name.html
50938d4643cc-0
langchain.utilities.clickup.fetch_list_id¶ langchain.utilities.clickup.fetch_list_id(space_id: int, folder_id: int, access_token: str) → Optional[int][source]¶ Fetch the list id.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.fetch_list_id.html
c96e96c956f0-0
langchain.utilities.bing_search.BingSearchAPIWrapper¶ class langchain.utilities.bing_search.BingSearchAPIWrapper[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¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.bing_search.BingSearchAPIWrapper.html
c96e96c956f0-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ results(query: str, num_results: int) → List[Dict][source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.bing_search.BingSearchAPIWrapper.html
c96e96c956f0-2
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. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using BingSearchAPIWrapper¶ Bing Search
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.bing_search.BingSearchAPIWrapper.html
a5ccc169a123-0
langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper¶ class langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper[source]¶ Bases: BaseModel Wrapper for DuckDuckGo Search API. Free and does not require any setup. 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 max_results: int = 5¶ param region: Optional[str] = 'wt-wt'¶ param safesearch: str = 'moderate'¶ param time: Optional[str] = 'y'¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper.html
a5ccc169a123-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ get_snippets(query: str) → List[str][source]¶ Run query through DuckDuckGo and return concatenated results. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper.html
a5ccc169a123-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¶ results(query: str, num_results: int, backend: str = 'api') → List[Dict[str, str]][source]¶ Run query through DuckDuckGo 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]¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using DuckDuckGoSearchAPIWrapper¶ DuckDuckGo Search
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper.html
87af5191b174-0
langchain.utilities.clickup.CUList¶ class langchain.utilities.clickup.CUList(folder_id: float, name: str, content: Optional[str] = None, due_date: Optional[int] = None, due_date_time: Optional[bool] = None, priority: Optional[int] = None, assignee: Optional[int] = None, status: Optional[str] = None)[source]¶ Component class for a list. Attributes assignee content due_date due_date_time priority status folder_id name Methods __init__(folder_id, name[, content, ...]) from_data(data) __init__(folder_id: float, name: str, content: Optional[str] = None, due_date: Optional[int] = None, due_date_time: Optional[bool] = None, priority: Optional[int] = None, assignee: Optional[int] = None, status: Optional[str] = None) → None¶ classmethod from_data(data: dict) → CUList[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.CUList.html
2faf1199b577-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. 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
2faf1199b577-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ get_metadata(entry: Mapping[str, Any], load_extra: bool = False) → Dict[str, Any][source]¶ Get metadata for the given entry. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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(). load_bibtex_entries(path: str) → List[Dict[str, Any]][source]¶ Load bibtex entries from the bibtex file at the given path. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
2faf1199b577-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¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.bibtex.BibtexparserWrapper.html
d2b828562d91-0
langchain.utilities.max_compute.MaxComputeAPIWrapper¶ class langchain.utilities.max_compute.MaxComputeAPIWrapper(client: ODPS)[source]¶ Interface for querying Alibaba Cloud MaxCompute tables. Initialize MaxCompute document loader. Parameters client – odps.ODPS MaxCompute client object. Methods __init__(client) Initialize MaxCompute document loader. from_params(endpoint, project, *[, ...]) Convenience constructor that builds the odsp.ODPS MaxCompute client from lazy_query(query) query(query) __init__(client: ODPS)[source]¶ Initialize MaxCompute document loader. Parameters client – odps.ODPS MaxCompute client object. classmethod from_params(endpoint: str, project: str, *, access_id: Optional[str] = None, secret_access_key: Optional[str] = None) → MaxComputeAPIWrapper[source]¶ Convenience constructor that builds the odsp.ODPS MaxCompute client fromgiven parameters. Parameters endpoint – MaxCompute endpoint. project – A project is a basic organizational unit of MaxCompute, which is similar to a database. access_id – MaxCompute access ID. Should be passed in directly or set as the environment variable MAX_COMPUTE_ACCESS_ID. secret_access_key – MaxCompute secret access key. Should be passed in directly or set as the environment variable MAX_COMPUTE_SECRET_ACCESS_KEY. lazy_query(query: str) → Iterator[dict][source]¶ query(query: str) → List[dict][source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.max_compute.MaxComputeAPIWrapper.html
b6f3bb8f5cec-0
langchain.utilities.openweathermap.OpenWeatherMapAPIWrapper¶ class langchain.utilities.openweathermap.OpenWeatherMapAPIWrapper[source]¶ Bases: BaseModel Wrapper for OpenWeatherMap API using PyOWM. Docs for using: Go to OpenWeatherMap and sign up for an API key Save your API KEY into OPENWEATHERMAP_API_KEY env variable pip install pyowm 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 openweathermap_api_key: Optional[str] = None¶ param owm: Any = None¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.openweathermap.OpenWeatherMapAPIWrapper.html
b6f3bb8f5cec-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(location: str) → str[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.openweathermap.OpenWeatherMapAPIWrapper.html
b6f3bb8f5cec-2
run(location: str) → str[source]¶ Get the current weather information for a specified location. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using OpenWeatherMapAPIWrapper¶ OpenWeatherMap
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.openweathermap.OpenWeatherMapAPIWrapper.html
ac6f64fe2eb6-0
langchain.utilities.searchapi.SearchApiAPIWrapper¶ class langchain.utilities.searchapi.SearchApiAPIWrapper[source]¶ Bases: BaseModel Wrapper around SearchApi API. To use, you should have the environment variable SEARCHAPI_API_KEY set with your API key, or pass searchapi_api_key as a named parameter to the constructor. Example from langchain.utilities import SearchApiAPIWrapper searchapi = SearchApiAPIWrapper() 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 engine: str = 'google'¶ param searchapi_api_key: Optional[str] = None¶ async aresults(query: str, **kwargs: Any) → dict[source]¶ async arun(query: str, **kwargs: Any) → str[source]¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searchapi.SearchApiAPIWrapper.html
ac6f64fe2eb6-1
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep 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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searchapi.SearchApiAPIWrapper.html
ac6f64fe2eb6-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¶ results(query: str, **kwargs: Any) → dict[source]¶ run(query: str, **kwargs: Any) → str[source]¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.searchapi.SearchApiAPIWrapper.html
d8b8fdd14a31-0
langchain.utilities.tavily_search.TavilySearchAPIWrapper¶ class langchain.utilities.tavily_search.TavilySearchAPIWrapper[source]¶ Bases: BaseModel Wrapper for Tavily 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 tavily_api_key: str [Required]¶ clean_results(results: List[Dict]) → List[Dict][source]¶ Clean results from Tavily Search API. 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.tavily_search.TavilySearchAPIWrapper.html
d8b8fdd14a31-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.tavily_search.TavilySearchAPIWrapper.html
d8b8fdd14a31-2
raw_results(query: str, max_results: Optional[int] = 5, search_depth: Optional[str] = 'advanced', include_domains: Optional[List[str]] = [], exclude_domains: Optional[List[str]] = [], include_answer: Optional[bool] = False, include_raw_content: Optional[bool] = False, include_images: Optional[bool] = False) → Dict[source]¶ async raw_results_async(query: str, max_results: Optional[int] = 5, search_depth: Optional[str] = 'advanced', include_domains: Optional[List[str]] = [], exclude_domains: Optional[List[str]] = [], include_answer: Optional[bool] = False, include_raw_content: Optional[bool] = False, include_images: Optional[bool] = False) → Dict[source]¶ Get results from the Tavily Search API asynchronously. results(query: str, max_results: Optional[int] = 5, search_depth: Optional[str] = 'advanced', include_domains: Optional[List[str]] = [], exclude_domains: Optional[List[str]] = [], include_answer: Optional[bool] = False, include_raw_content: Optional[bool] = False, include_images: Optional[bool] = False) → List[Dict][source]¶ Run query through Tavily Search and return metadata. Parameters query – The query to search for. max_results – The maximum number of results to return. search_depth – The depth of the search. Can be “basic” or “advanced”. include_domains – A list of domains to include in the search. exclude_domains – A list of domains to exclude from the search. include_answer – Whether to include the answer in the results. include_raw_content – Whether to include the raw content in the results. include_images – Whether to include images in the results. Returns The query that was searched for.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.tavily_search.TavilySearchAPIWrapper.html
d8b8fdd14a31-3
Returns The query that was searched for. follow_up_questions: A list of follow up questions. response_time: The response time of the query. answer: The answer to the query. images: A list of images. results: A list of dictionaries containing the results: title: The title of the result. url: The url of the result. content: The content of the result. score: The score of the result. raw_content: The raw content of the result. Return type query async results_async(query: str, max_results: Optional[int] = 5, search_depth: Optional[str] = 'advanced', include_domains: Optional[List[str]] = [], exclude_domains: Optional[List[str]] = [], include_answer: Optional[bool] = False, include_raw_content: Optional[bool] = False, include_images: Optional[bool] = False) → List[Dict][source]¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.tavily_search.TavilySearchAPIWrapper.html
77b5e4f1e2b5-0
langchain.utilities.clickup.Task¶ class langchain.utilities.clickup.Task(id: int, name: str, text_content: str, description: str, status: str, creator_id: int, creator_username: str, creator_email: str, assignees: List[Dict[str, Any]], watchers: List[Dict[str, Any]], priority: Optional[str], due_date: Optional[str], start_date: Optional[str], points: int, team_id: int, project_id: int)[source]¶ Class for a task. Attributes id name text_content description status creator_id creator_username creator_email assignees watchers priority due_date start_date points team_id project_id Methods __init__(id, name, text_content, ...) from_data(data) __init__(id: int, name: str, text_content: str, description: str, status: str, creator_id: int, creator_username: str, creator_email: str, assignees: List[Dict[str, Any]], watchers: List[Dict[str, Any]], priority: Optional[str], due_date: Optional[str], start_date: Optional[str], points: int, team_id: int, project_id: int) → None¶ classmethod from_data(data: Dict[str, Any]) → Task[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.Task.html
8e7fe87d3e5a-0
langchain.utilities.dalle_image_generator.DallEAPIWrapper¶ class langchain.utilities.dalle_image_generator.DallEAPIWrapper[source]¶ Bases: BaseModel Wrapper for OpenAI’s DALL-E Image Generator. https://platform.openai.com/docs/guides/images/generations?context=node Usage instructions: pip install openai save your OPENAI_API_KEY in an environment variable 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 model: Optional[str] = None¶ Model to use for image generation. param n: int = 1¶ Number of images to generate param openai_api_key: Optional[str] = None¶ param separator: str = '\n'¶ Separator to use when multiple URLs are returned. param size: str = '1024x1024'¶ Size of image to generate 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.dalle_image_generator.DallEAPIWrapper.html
8e7fe87d3e5a-1
exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep 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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.dalle_image_generator.DallEAPIWrapper.html
8e7fe87d3e5a-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 query through OpenAI 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¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using DallEAPIWrapper¶ Dall-E Image Generator
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.dalle_image_generator.DallEAPIWrapper.html
03d1297aec3f-0
langchain.utilities.google_search.GoogleSearchAPIWrapper¶ class langchain.utilities.google_search.GoogleSearchAPIWrapper[source]¶ Bases: BaseModel Wrapper for Google Search API. Adapted from: Instructions adapted from https://stackoverflow.com/questions/ 37083058/ programmatically-searching-google-in-python-using-custom-search TODO: DOCS for using it 1. Install google-api-python-client - If you don’t already have a Google account, sign up. - If you have never created a Google APIs Console project, read the Managing Projects page and create a project in the Google API Console. - Install the library using pip install google-api-python-client 2. Enable the Custom Search API - Navigate to the APIs & Services→Dashboard panel in Cloud Console. - Click Enable APIs and Services. - Search for Custom Search API and click on it. - Click Enable. URL for it: https://console.cloud.google.com/apis/library/customsearch.googleapis .com 3. To create an API key: - Navigate to the APIs & Services → Credentials panel in Cloud Console. - Select Create credentials, then select API key from the drop-down menu. - The API key created dialog box displays your newly created key. - You now have an API_KEY Alternatively, you can just generate an API key here: https://developers.google.com/custom-search/docs/paid_element#api_key 4. Setup Custom Search Engine so you can search the entire web - Create a custom search engine here: https://programmablesearchengine.google.com/. - In What to search to search, pick the Search the entire Web option. After search engine is created, you can click on it and find Search engine ID on the Overview page. 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.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.google_search.GoogleSearchAPIWrapper.html
03d1297aec3f-1
Raises ValidationError if the input data cannot be parsed to form a valid model. param google_api_key: Optional[str] = None¶ param google_cse_id: Optional[str] = None¶ param k: int = 10¶ param siterestrict: bool = False¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.google_search.GoogleSearchAPIWrapper.html
03d1297aec3f-2
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ results(query: str, num_results: int, search_params: Optional[Dict[str, str]] = None) → List[Dict][source]¶ Run query through GoogleSearch and return metadata. Parameters query – The query to search for. num_results – The number of results to return. search_params – Parameters to be passed on search 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
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.google_search.GoogleSearchAPIWrapper.html
03d1297aec3f-3
Return type A list of dictionaries with the following keys run(query: str) → str[source]¶ Run query through GoogleSearch 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¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ Examples using GoogleSearchAPIWrapper¶ Google Search Bittensor Set env var OPENAI_API_KEY or load from a .env file: Agents WebResearchRetriever Message Memory in Agent backed by a database Memory in Agent Shared memory across agents and tools
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.google_search.GoogleSearchAPIWrapper.html
2a7227c78253-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.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.sql_database.truncate_word.html
0c48a14862c9-0
langchain.utilities.clickup.Team¶ class langchain.utilities.clickup.Team(id: int, name: str, members: List[Member])[source]¶ Component class for a team. Attributes id name members Methods __init__(id, name, members) from_data(data) __init__(id: int, name: str, members: List[Member]) → None¶ classmethod from_data(data: Dict) → Team[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.Team.html
7c01ae16e273-0
langchain.utilities.clickup.fetch_folder_id¶ langchain.utilities.clickup.fetch_folder_id(space_id: int, access_token: str) → Optional[int][source]¶ Fetch the folder id.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.fetch_folder_id.html
2b1cf88a1def-0
langchain.utilities.clickup.Component¶ class langchain.utilities.clickup.Component[source]¶ Base class for all components. Methods __init__() from_data(data) __init__() → None¶ classmethod from_data(data: Dict[str, Any]) → Component[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.Component.html
0ccbea45c065-0
langchain.utilities.opaqueprompts.desanitize¶ langchain.utilities.opaqueprompts.desanitize(sanitized_text: str, secure_context: bytes) → str[source]¶ Restore the original sensitive data from the sanitized text. Parameters sanitized_text – Sanitized text. secure_context – Secure context returned by the sanitize function. Returns De-sanitized text.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.opaqueprompts.desanitize.html
b0431ae01cf1-0
langchain.utilities.redis.check_redis_module_exist¶ langchain.utilities.redis.check_redis_module_exist(client: RedisType, required_modules: List[dict]) → None[source]¶ Check if the correct Redis modules are installed.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.redis.check_redis_module_exist.html
8f085c1c5a8b-0
langchain.utilities.clickup.fetch_first_id¶ langchain.utilities.clickup.fetch_first_id(data: dict, key: str) → Optional[int][source]¶ Fetch the first id from a dictionary.
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.clickup.fetch_first_id.html
3aee540d7437-0
langchain.utilities.openapi.OpenAPISpec¶ class langchain.utilities.openapi.OpenAPISpec[source]¶ OpenAPI Model that removes mis-formatted parts of the spec. Attributes base_url Get the base url. openapi Methods __init__() from_file(path) Get an OpenAPI spec from a file path. from_spec_dict(spec_dict) Get an OpenAPI spec from a dict. from_text(text) Get an OpenAPI spec from a text. from_url(url) Get an OpenAPI spec from a URL. get_cleaned_operation_id(operation, path, method) Get a cleaned operation id from an operation id. get_methods_for_path(path) Return a list of valid methods for the specified path. get_operation(path, method) Get the operation object for a given path and HTTP method. get_parameters_for_operation(operation) Get the components for a given operation. get_parameters_for_path(path) get_referenced_schema(ref) Get a schema (or nested reference) or err. get_request_body_for_operation(operation) Get the request body for a given operation. get_schema(schema) parse_obj(obj) __init__()¶ classmethod from_file(path: Union[str, Path]) → OpenAPISpec[source]¶ Get an OpenAPI spec from a file path. classmethod from_spec_dict(spec_dict: dict) → OpenAPISpec[source]¶ Get an OpenAPI spec from a dict. classmethod from_text(text: str) → OpenAPISpec[source]¶ Get an OpenAPI spec from a text. classmethod from_url(url: str) → OpenAPISpec[source]¶ Get an OpenAPI spec from a URL. static get_cleaned_operation_id(operation: Operation, path: str, method: str) → str[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.OpenAPISpec.html
3aee540d7437-1
Get a cleaned operation id from an operation id. get_methods_for_path(path: str) → List[str][source]¶ Return a list of valid methods for the specified path. get_operation(path: str, method: str) → Operation[source]¶ Get the operation object for a given path and HTTP method. get_parameters_for_operation(operation: Operation) → List[Parameter][source]¶ Get the components for a given operation. get_parameters_for_path(path: str) → List[Parameter][source]¶ get_referenced_schema(ref: Reference) → Schema[source]¶ Get a schema (or nested reference) or err. get_request_body_for_operation(operation: Operation) → Optional[RequestBody][source]¶ Get the request body for a given operation. get_schema(schema: Union[Reference, Schema]) → Schema[source]¶ classmethod parse_obj(obj: dict) → OpenAPISpec[source]¶ Examples using OpenAPISpec¶ Natural Language APIs
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.openapi.OpenAPISpec.html
bc653ec49efe-0
langchain.utilities.alpha_vantage.AlphaVantageAPIWrapper¶ class langchain.utilities.alpha_vantage.AlphaVantageAPIWrapper[source]¶ Bases: BaseModel Wrapper for AlphaVantage API for Currency Exchange Rate. Docs for using: Go to AlphaVantage and sign up for an API key Save your API KEY into ALPHAVANTAGE_API_KEY env variable 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 alphavantage_api_key: Optional[str] = None¶ 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.alpha_vantage.AlphaVantageAPIWrapper.html
bc653ec49efe-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, exclude_defaults: bool = False, exclude_none: bool = False) → DictStrAny¶ Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶ 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 = None, allow_pickle: bool = False) → Model¶ classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ run(from_currency: str, to_currency: str) → str[source]¶
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.alpha_vantage.AlphaVantageAPIWrapper.html
bc653ec49efe-2
run(from_currency: str, to_currency: str) → str[source]¶ Get the current exchange rate for a specified currency pair. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and localns. classmethod validate(value: Any) → Model¶ property standard_currencies: List[str]¶ Examples using AlphaVantageAPIWrapper¶ Alpha Vantage
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.alpha_vantage.AlphaVantageAPIWrapper.html
d2f9ba547695-0
langchain.utilities.brave_search.BraveSearchWrapper¶ class langchain.utilities.brave_search.BraveSearchWrapper[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: str = '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. 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.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 choose which fields to include, exclude and change. Parameters include – fields to include in new model exclude – fields to exclude from new model, as with values this takes precedence over include update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance
lang/api.python.langchain.com/en/latest/utilities/langchain.utilities.brave_search.BraveSearchWrapper.html