id stringlengths 14 16 | text stringlengths 31 2.41k | source stringlengths 53 121 |
|---|---|---|
46d47edcfcf7-12 | Returns
List of embeddings, one for each text.
Return type
List[List[float]]
embed_query(text)[source]ο
Compute query embeddings using a TensorflowHub embedding model.
Parameters
text (str) β The text to embed.
Returns
Embeddings for the text.
Return type
List[float]
class langchain.embeddings.SagemakerEndpointEmbeddin... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-13 | The content handler class that provides an input and
output transform functions to handle formats between LLM
and the endpoint.
attribute credentials_profile_name: Optional[str] = Noneο
The name of the profile in the ~/.aws/credentials or ~/.aws/config files, which
has either access keys or role information specified.
... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-14 | Parameters
text (str) β The text to embed.
Returns
Embeddings for the text.
Return type
List[float]
class langchain.embeddings.HuggingFaceInstructEmbeddings(*, client=None, model_name='hkunlp/instructor-large', cache_folder=None, model_kwargs=None, encode_kwargs=None, embed_instruction='Represent the document for retri... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-15 | attribute model_kwargs: Dict[str, Any] [Optional]ο
Key word arguments to pass to the model.
attribute model_name: str = 'hkunlp/instructor-large'ο
Model name to use.
attribute query_instruction: str = 'Represent the question for retrieving supporting documents: 'ο
Instruction to use for embedding query.
embed_documents... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-16 | endpoint_url=endpoint_url,
mosaicml_api_token="my-api-key"
)
Parameters
endpoint_url (str) β
embed_instruction (str) β
query_instruction (str) β
retry_sleep (float) β
mosaicml_api_token (Optional[str]) β
Return type
None
attribute embed_instruction: str = 'Represent the document for retrieval: 'ο
Instruction u... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-17 | Runs custom embedding models on self-hosted remote hardware.
Supported hardware includes auto-launched instances on AWS, GCP, Azure,
and Lambda, as well as servers specified
by IP address and SSH credentials (such as on-prem, or another
cloud like Paperspace, Coreweave, etc.).
To use, you should have the runhouse pytho... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-18 | )
Parameters
cache (Optional[bool]) β
verbose (bool) β
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
tags (Optional[List[str]]) β
pipeline_ref (Any) β
clien... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-19 | Returns
Embeddings for the text.
Return type
List[float]
class langchain.embeddings.SelfHostedHuggingFaceEmbeddings(*, cache=None, verbose=None, callbacks=None, callback_manager=None, tags=None, pipeline_ref=None, client=None, inference_fn=<function _embed_documents>, hardware=None, model_load_fn=<function load_embeddi... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-20 | inference_fn (Callable) β
hardware (Any) β
model_load_fn (Callable) β
load_fn_kwargs (Optional[dict]) β
model_reqs (List[str]) β
inference_kwargs (Any) β
model_id (str) β
Return type
None
attribute hardware: Any = Noneο
Remote hardware to send the inference function to.
attribute inference_fn: Callable = <functi... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-21 | Supported hardware includes auto-launched instances on AWS, GCP, Azure,
and Lambda, as well as servers specified
by IP address and SSH credentials (such as on-prem, or another
cloud like Paperspace, Coreweave, etc.).
To use, you should have the runhouse python package installed.
Example
from langchain.embeddings import... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-22 | Requirements to install on hardware to inference the model.
attribute query_instruction: str = 'Represent the question for retrieving supporting documents: 'ο
Instruction to use for embedding query.
embed_documents(texts)[source]ο
Compute doc embeddings using a HuggingFace instruct model.
Parameters
texts (List[str]) β... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-23 | the query for a document as similar as possible.
To learn more, check out: https://docs.aleph-alpha.com/docs/tasks/semantic_embed/
Example
from aleph_alpha import AlephAlphaAsymmetricSemanticEmbedding
embeddings = AlephAlphaSymmetricSemanticEmbedding()
document = "This is a content of the document"
query = "What is the... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-24 | attribute normalize: Optional[bool] = Trueο
Should returned embeddings be normalized
embed_documents(texts)[source]ο
Call out to Aleph Alphaβs asymmetric Document endpoint.
Parameters
texts (List[str]) β The list of texts to embed.
Returns
List of embeddings, one for each text.
Return type
List[List[float]]
embed_query... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-25 | aleph_alpha_api_key (Optional[str]) β
Return type
None
embed_documents(texts)[source]ο
Call out to Aleph Alphaβs Document endpoint.
Parameters
texts (List[str]) β The list of texts to embed.
Returns
List of embeddings, one for each text.
Return type
List[List[float]]
embed_query(text)[source]ο
Call out to Aleph Alphaβ... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-26 | embed_type_query (str) β
minimax_group_id (Optional[str]) β
minimax_api_key (Optional[str]) β
Return type
None
attribute embed_type_db: str = 'db'ο
For embed_documents
attribute embed_type_query: str = 'query'ο
For embed_query
attribute endpoint_url: str = 'https://api.minimax.chat/v1/embeddings'ο
Endpoint URL to us... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-27 | If a specific credential profile should be used, you must pass
the name of the profile from the ~/.aws/credentials file that is to be used.
Make sure the credentials / roles used have the required policies to
access the Bedrock service.
Parameters
client (Any) β
region_name (Optional[str]) β
credentials_profile_name ... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-28 | only for compatibility with the embeddings interface.
Returns
List of embeddings, one for each text.
Return type
List[List[float]]
embed_query(text)[source]ο
Compute query embeddings using a Bedrock model.
Parameters
text (str) β The text to embed.
Returns
Embeddings for the text.
Return type
List[float]
class langchai... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-29 | deepinfra_api_token (Optional[str]) β
Return type
None
attribute embed_instruction: str = 'passage: 'ο
Instruction used to embed documents.
attribute model_id: str = 'sentence-transformers/clip-ViT-B-32'ο
Embeddings model to use.
attribute model_kwargs: Optional[dict] = Noneο
Other model keyword args
attribute normali... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-30 | os.environ["DASHSCOPE_API_KEY"] = "your DashScope API KEY"
from langchain.embeddings.dashscope import DashScopeEmbeddings
embeddings = DashScopeEmbeddings(
model="text-embedding-v1",
)
text = "This is a test query."
query_result = embeddings.embed_query(text)
Parameters
client (Any) β
model (str) β
dashscope_api_... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
46d47edcfcf7-31 | it as a named parameter to the constructor.
Example
# Initialise with default model and instruction
from langchain.embeddings import EmbaasEmbeddings
emb = EmbaasEmbeddings()
# Initialise with custom model and instruction
from langchain.embeddings import EmbaasEmbeddings
emb_model = "instructor-large"
emb_inst = "Repre... | https://api.python.langchain.com/en/latest/modules/embeddings.html |
897ef9cfbf02-0 | Utilitiesο
General utilities.
class langchain.utilities.ApifyWrapper(*, apify_client=None, apify_client_async=None)[source]ο
Bases: pydantic.main.BaseModel
Wrapper around Apify.
To use, you should have the apify-client python package installed,
and the environment variable APIFY_API_TOKEN set with your API key, or pass... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-1 | Run a saved Actor task on Apify and wait for results to be ready.
Parameters
task_id (str) β The ID or name of the task on the Apify platform.
task_input (Dict) β The input object of the task that youβre trying to run.
Overrides the taskβs saved input.
dataset_mapping_function (Callable) β A function that takes a singl... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-2 | 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, task_input, dataset_mapping_function, *, build=None, memory_mbytes=None, timeout_secs=None)[source]ο
Run a sa... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-3 | This wrapper will use the Arxiv API to conduct searches and
fetch document summaries. By default, it will return the document summaries
of the top-k results.
It limits the Document content by doc_content_chars_max.
Set doc_content_chars_max=None if you donβt want to limit the content size.
Parameters
top_k_results (int... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-4 | See https://lukasschwab.me/arxiv.py/index.html#Search
See https://lukasschwab.me/arxiv.py/index.html#Result
It uses only the most informative fields of article meta information.
Parameters
query (str) β
Return type
str
class langchain.utilities.BashProcess(strip_newlines=False, return_err_output=False, persistent=Fals... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-5 | Parameters
path (str) β
Return type
List[Dict[str, Any]]
class langchain.utilities.BingSearchAPIWrapper(*, bing_subscription_key, bing_search_url, k=10)[source]ο
Bases: pydantic.main.BaseModel
Wrapper for Bing Search API.
In order to set this up, follow instructions at:
https://levelup.gitconnected.com/api-tutorial-ho... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-6 | Parameters
query (str) β
Return type
str
class langchain.utilities.DuckDuckGoSearchAPIWrapper(*, k=10, region='wt-wt', safesearch='moderate', time='y', max_results=5)[source]ο
Bases: pydantic.main.BaseModel
Wrapper for DuckDuckGo Search API.
Free and does not require any setup
Parameters
k (int) β
region (Optional[st... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-7 | Bases: pydantic.main.BaseModel
Wrapper around Google Places API.
To use, you should have the googlemaps python package installed,an API key for the google maps platform,
and the enviroment variable ββGPLACES_API_KEYββ
set with your API key , or pass βgplaces_api_keyβ
as a named parameter to the constructor.
By default,... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-8 | 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
T... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-9 | siterestrict (bool) β
Return type
None
attribute google_api_key: Optional[str] = Noneο
attribute google_cse_id: Optional[str] = Noneο
attribute k: int = 10ο
attribute siterestrict: bool = Falseο
results(query, num_results)[source]ο
Run query through GoogleSearch and return metadata.
Parameters
query (str) β The query ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-10 | type (Literal['news', 'search', 'places', 'images']) β
tbs (Optional[str]) β
serper_api_key (Optional[str]) β
aiosession (Optional[aiohttp.client.ClientSession]) β
result_key_for_type (dict) β
Return type
None
attribute aiosession: Optional[aiohttp.client.ClientSession] = Noneο
attribute gl: str = 'us'ο
attribute ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-11 | Wrapper around GraphQL API.
To use, you should have the gql python package installed.
This wrapper will use the GraphQL API to conduct queries.
Parameters
custom_headers (Optional[Dict[str, str]]) β
graphql_endpoint (str) β
gql_client (Any) β
gql_function (Callable[[str], Any]) β
Return type
None
attribute custom_h... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-12 | class langchain.utilities.JiraAPIWrapper(*, jira=None, confluence=None, jira_username=None, jira_api_token=None, jira_instance_url=None, operations=[{'mode': 'jql', 'name': 'JQL Query', 'description': '\nΒ Β Β This tool is a wrapper around atlassian-python-api\'s Jira jql API, useful when you need to search for Jira issu... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-13 | low priority task called "test issue" with description "test description", you would pass in the following dictionary: \nΒ Β Β {{"summary": "test issue", "description": "test description", "issuetype": {{"name": "Task"}}, "priority": {{"name": "Low"}}}}\nΒ Β Β '}, {'mode': 'other', 'name': 'Catch all Jira API call', 'descr... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-14 | the DEMO space titled "This is the title" with body "This is the body. You can use \n<strong>HTML tags</strong>!", you would pass in the following dictionary: {{"space": "DEMO", "title":"This is the \ntitle","body":"This is the body. You can use <strong>HTML tags</strong>!"}} '}])[source]ο | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-15 | Bases: pydantic.main.BaseModel
Wrapper for Jira API.
Parameters
jira (Any) β
confluence (Any) β
jira_username (Optional[str]) β
jira_api_token (Optional[str]) β
jira_instance_url (Optional[str]) β
operations (List[Dict]) β
Return type
None
attribute confluence: Any = Noneο
attribute jira_api_token: Optional[str] ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-16 | attribute operations: List[Dict] = [{'mode': 'jql', 'name': 'JQL Query', 'description': '\nΒ Β Β This tool is a wrapper around atlassian-python-api\'s Jira jql API, useful when you need to search for Jira issues.\nΒ Β Β The input to this tool is a JQL query string, and will be passed into atlassian-python-api\'s Jira `jql`... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-17 | "test issue", "description": "test description", "issuetype": {{"name": "Task"}}, "priority": {{"name": "Low"}}}}\nΒ Β Β '}, {'mode': 'other', 'name': 'Catch all Jira API call', 'description': '\nΒ Β Β This tool is a wrapper around atlassian-python-api\'s Jira API.\nΒ Β Β There are other dedicated tools for fetching all proj... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-18 | you would pass in the following dictionary: {{"space": "DEMO", "title":"This is the \ntitle","body":"This is the body. You can use <strong>HTML tags</strong>!"}} '}]ο | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-19 | issue_create(query)[source]ο
Parameters
query (str) β
Return type
str
list()[source]ο
Return type
List[Dict]
other(query)[source]ο
Parameters
query (str) β
Return type
str
page_create(query)[source]ο
Parameters
query (str) β
Return type
str
parse_issues(issues)[source]ο
Parameters
issues (Dict) β
Return type
List[d... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-20 | run(query)[source]ο
Invoke Lambda function and parse result.
Parameters
query (str) β
Return type
str
class langchain.utilities.MaxComputeAPIWrapper(client)[source]ο
Bases: object
Interface for querying Alibaba Cloud MaxCompute tables.
Parameters
client (ODPS) β
classmethod from_params(endpoint, project, *, access_id... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-21 | attribute metaphor_api_key: str [Required]ο
results(query, num_results, include_domains=None, exclude_domains=None, start_crawl_date=None, end_crawl_date=None, start_published_date=None, end_published_date=None)[source]ο
Run query through Metaphor Search and return metadata.
Parameters
query (str) β The query to search... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-22 | Bases: pydantic.main.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
Parameters
owm (Any) β
openweathermap_api_key (Optional[str]) β
Return type
None
attribute openweather... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-23 | aiosession (Optional[aiohttp.client.ClientSession]) β
Return type
None
attribute aiosession: Optional[aiohttp.ClientSession] = Noneο
attribute credential: Optional[TokenCredential] = Noneο
attribute dataset_id: str [Required]ο
attribute group_id: Optional[str] = Noneο
attribute impersonated_user_name: Optional[str] = ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-24 | property table_info: strο
Information about all tables in the database.
class langchain.utilities.PubMedAPIWrapper(*, top_k_results=3, load_max_docs=25, doc_content_chars_max=2000, load_all_available_meta=False, email='your_email@example.com', base_url_esearch='https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-25 | attribute load_all_available_meta: bool = Falseο
attribute load_max_docs: int = 25ο
attribute top_k_results: int = 3ο
load(query)[source]ο
Search PubMed for documents matching the query.
Return a list of dictionaries containing the document metadata.
Parameters
query (str) β
Return type
List[dict]
load_docs(query)[sou... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-26 | Wrapper for SceneXplain API.
In order to set this up, you need API key for the SceneXplain API.
You can obtain a key by following the steps below.
- Sign up for a free account at https://scenex.jina.ai/.
- Navigate to the API Access page (https://scenex.jina.ai/api)
and create a new API key.
Show JSON schema{
"title... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-27 | Fields
scenex_api_key (str)
scenex_api_url (str)
attribute scenex_api_key: str [Required]ο
attribute scenex_api_url: str = 'https://us-central1-causal-diffusion.cloudfunctions.net/describe'ο
run(image)[source]ο
Run SceneXplain image explainer.
Parameters
image (str) β
Return type
str
validator validate_environment » ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-28 | Parameters
searx_host (str) β
unsecure (bool) β
params (dict) β
headers (Optional[dict]) β
engines (Optional[List[str]]) β
categories (Optional[List[str]]) β
query_suffix (Optional[str]) β
k (int) β
aiosession (Optional[Any]) β
Return type
None
attribute aiosession: Optional[Any] = Noneο
attribute categories: ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-29 | Parameters
query (str) β The query to search for.
query_suffix (Optional[str]) β Extra suffix appended to the query.
num_results (int) β Limit the number of results to return.
engines (Optional[List[str]]) β List of engines to use for the query.
categories (Optional[List[str]]) β List of categories to use for the query... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-30 | 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")
class langchain.utilities.SerpAPIWrapper(*, search_engine=None, params={'engine': '... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-31 | Run query through SerpAPI and parse result async.
Parameters
query (str) β
kwargs (Any) β
Return type
str
get_params(query)[source]ο
Get parameters for SerpAPI.
Parameters
query (str) β
Return type
Dict[str, str]
results(query)[source]ο
Run query through SerpAPI and return the raw result.
Parameters
query (str) β
R... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-32 | Return type
str
run(command, fetch='all')[source]ο
Parameters
command (str) β
fetch (str) β
Return type
str
get_table_info_no_throw(table_names=None)[source]ο
Get information about specified tables.
Follows best practices as specified in: Rajkumar et al, 2022
(https://arxiv.org/abs/2204.00498)
If sample_rows_in_table... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-33 | Parameters
url (str) β
kwargs (Any) β
Return type
str
async aget(url, **kwargs)[source]ο
GET the URL and return the text asynchronously.
Parameters
url (str) β
kwargs (Any) β
Return type
str
async apatch(url, data, **kwargs)[source]ο
PATCH the URL and return the text asynchronously.
Parameters
url (str) β
data (Di... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-34 | POST to the URL and return the text.
Parameters
url (str) β
data (Dict[str, Any]) β
kwargs (Any) β
Return type
str
put(url, data, **kwargs)[source]ο
PUT the URL and return the text.
Parameters
url (str) β
data (Dict[str, Any]) β
kwargs (Any) β
Return type
str
property requests: langchain.requests.Requestsο
class ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-35 | format, an
[alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id),
or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses)
that is enabled for the type of message you want to send. Phone numbers or
[short codes](https://www.twilio.com/do... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-36 | Parameters
wiki_client (Any) β
top_k_results (int) β
lang (str) β
load_all_available_meta (bool) β
doc_content_chars_max (int) β
Return type
None
attribute doc_content_chars_max: int = 4000ο
attribute lang: str = 'en'ο
attribute load_all_available_meta: bool = Falseο
attribute top_k_results: int = 3ο
load(query)[s... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-37 | Parameters
query (str) β
Return type
str
class langchain.utilities.ZapierNLAWrapper(*, zapier_nla_api_key, zapier_nla_oauth_access_token, zapier_nla_api_base='https://nla.zapier.com/api/v1/')[source]ο
Bases: pydantic.main.BaseModel
Wrapper for Zapier NLA.
Full docs here: https://nla.zapier.com/start/
This wrapper supp... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-38 | 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 ... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-39 | call.
Parameters
action_id (str) β
instructions (str) β
params (Optional[Dict]) β
Return type
Dict
async arun_as_str(*args, **kwargs)[source]ο
Same as run, but returns a stringified version of the JSON for
insertting back into an LLM.
Return type
str
list()[source]ο
Returns a list of all exposed (enabled) actions as... | https://api.python.langchain.com/en/latest/modules/utilities.html |
897ef9cfbf02-40 | Same as preview, but returns a stringified version of the JSON for
insertting back into an LLM.
Return type
str
run(action_id, instructions, params=None)[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 acti... | https://api.python.langchain.com/en/latest/modules/utilities.html |
dd38a45722f7-0 | Prompt Templatesο
Prompt template classes.
class langchain.prompts.AIMessagePromptTemplate(*, prompt, additional_kwargs=None)[source]ο
Bases: langchain.prompts.chat.BaseStringMessagePromptTemplate
Parameters
prompt (langchain.prompts.base.StringPromptTemplate) β
additional_kwargs (dict) β
Return type
None
format(**kw... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-1 | Parameters
input_variables (List[str]) β
output_parser (Optional[langchain.schema.BaseOutputParser]) β
partial_variables (Mapping[str, Union[str, Callable[[], str]]]) β
Return type
None
attribute input_variables: List[str] [Required]ο
A list of the names of the variables the prompt template expects.
attribute output... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-2 | property lc_serializable: boolο
Return whether or not the class is serializable.
class langchain.prompts.ChatMessagePromptTemplate(*, prompt, additional_kwargs=None, role)[source]ο
Bases: langchain.prompts.chat.BaseStringMessagePromptTemplate
Parameters
prompt (langchain.prompts.base.StringPromptTemplate) β
additional... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-3 | Parameters
kwargs (Any) β
Return type
List[langchain.schema.BaseMessage]
classmethod from_messages(messages)[source]ο
Parameters
messages (Sequence[Union[langchain.prompts.chat.BaseMessagePromptTemplate, langchain.schema.BaseMessage]]) β
Return type
langchain.prompts.chat.ChatPromptTemplate
classmethod from_role_stri... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-4 | Prompt template that contains few shot examples.
Parameters
input_variables (List[str]) β
output_parser (Optional[langchain.schema.BaseOutputParser]) β
partial_variables (Mapping[str, Union[str, Callable[[], str]]]) β
examples (Optional[List[dict]]) β
example_selector (Optional[langchain.prompts.example_selector.ba... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-5 | attribute validate_template: bool = Trueο
Whether or not to try validating the template.
dict(**kwargs)[source]ο
Return a dictionary of the prompt.
Parameters
kwargs (Any) β
Return type
Dict
format(**kwargs)[source]ο
Format the prompt with the inputs.
Parameters
kwargs (Any) β Any arguments to be passed to the prompt ... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-6 | PromptTemplate used to format an individual example.
attribute example_selector: Optional[langchain.prompts.example_selector.base.BaseExampleSelector] = Noneο
ExampleSelector to choose the examples to format into the prompt.
Either this or examples should be provided.
attribute example_separator: str = '\n\n'ο
String s... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-7 | additional_kwargs (dict) β
Return type
None
format(**kwargs)[source]ο
To a BaseMessage.
Parameters
kwargs (Any) β
Return type
langchain.schema.BaseMessage
class langchain.prompts.LengthBasedExampleSelector(*, examples, example_prompt, get_text_length=<function _get_length_based>, max_length=2048, example_text_lengths... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-8 | input_variables (Dict[str, str]) β
Return type
List[dict]
class langchain.prompts.MaxMarginalRelevanceExampleSelector(*, vectorstore, k=4, example_keys=None, input_keys=None, fetch_k=20)[source]ο
Bases: langchain.prompts.example_selector.semantic_similarity.SemanticSimilarityExampleSelector
ExampleSelector that select... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-9 | Parameters
examples (List[dict]) β List of examples to use in the prompt.
embeddings (langchain.embeddings.base.Embeddings) β An iniialized embedding API interface, e.g. OpenAIEmbeddings().
vectorstore_cls (Type[langchain.vectorstores.base.VectorStore]) β A vector store DB interface class, e.g. FAISS.
k (int) β Number ... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-10 | Select and order examples based on ngram overlap score (sentence_bleu score).
https://www.nltk.org/_modules/nltk/translate/bleu_score.html
https://aclanthology.org/P02-1040.pdf
Parameters
examples (List[dict]) β
example_prompt (langchain.prompts.prompt.PromptTemplate) β
threshold (float) β
Return type
None
attribute... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-11 | A prompt template for composing multiple prompts together.
This can be useful when you want to reuse parts of prompts.
A PipelinePrompt consists of two main parts:
final_prompt: This is the final prompt that is returned
pipeline_prompts: This is a list of tuples, consistingof a string (name) and a Prompt Template.
Each... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-12 | Schema to represent a prompt for an LLM.
Example
from langchain import PromptTemplate
prompt = PromptTemplate(input_variables=["foo"], template="Say {foo}")
Parameters
input_variables (List[str]) β
output_parser (Optional[langchain.schema.BaseOutputParser]) β
partial_variables (Mapping[str, Union[str, Callable[[], st... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-13 | will expect.
example_separator (str) β The separator to use in between examples. Defaults
to two new line characters.
prefix (str) β String that should go before any examples. Generally includes
examples. Default to an empty string.
kwargs (Any) β
Returns
The final prompt generated.
Return type
langchain.prompts.promp... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-14 | Return type
None
attribute example_keys: Optional[List[str]] = Noneο
Optional keys to filter examples to.
attribute input_keys: Optional[List[str]] = Noneο
Optional keys to filter input to. If provided, the search is based on
the input variables instead of all variables.
attribute k: int = 4ο
Number of examples to sele... | https://api.python.langchain.com/en/latest/modules/prompts.html |
dd38a45722f7-15 | input_variables (Dict[str, str]) β
Return type
List[dict]
class langchain.prompts.StringPromptTemplate(*, input_variables, output_parser=None, partial_variables=None)[source]ο
Bases: langchain.prompts.base.BasePromptTemplate, abc.ABC
String prompt should expose the format method, returning a prompt.
Parameters
input_v... | https://api.python.langchain.com/en/latest/modules/prompts.html |
8e7952d3fdad-0 | Toolsο
Core toolkit implementations.
class langchain.tools.AIPluginTool(*, name, description, args_schema=<class 'langchain.tools.plugin.AIPluginToolSchema'>, return_direct=False, verbose=False, callbacks=None, callback_manager=None, handle_tool_error=False, plugin, api_spec)[source]ο
Bases: langchain.tools.base.BaseTo... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-1 | base_url (str) β
path (str) β
method (langchain.utilities.openapi.HTTPVerb) β
properties (Sequence[langchain.tools.openapi.utils.api_models.APIProperty]) β
request_body (Optional[langchain.tools.openapi.utils.api_models.APIRequestBody]) β
Return type
None
attribute base_url: str [Required]ο
The base URL of the ope... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-2 | Return type
str
static ts_type_from_python(type_)[source]ο
Parameters
type_ (Union[str, Type, tuple, None, enum.Enum]) β
Return type
str
property body_params: List[str]ο
property path_params: List[str]ο
property query_params: List[str]ο
class langchain.tools.ArxivQueryRun(*, name='arxiv', description='A wrapper around... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-3 | attribute api_wrapper: langchain.utilities.arxiv.ArxivAPIWrapper [Optional]ο
class langchain.tools.AzureCogsFormRecognizerTool(*, name='azure_cognitive_services_form_recognizer', description='A wrapper around Azure Cognitive Services Form Recognizer. Useful for when you need to extract text, tables, and key-value pairs... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-4 | doc_analysis_client (Any) β
Return type
None
class langchain.tools.AzureCogsImageAnalysisTool(*, name='azure_cognitive_services_image_analysis', description='A wrapper around Azure Cognitive Services Image Analysis. Useful for when you need to analyze images. Input should be a url to an image.', args_schema=None, retu... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-5 | analysis_options (Any) β
Return type
None
class langchain.tools.AzureCogsSpeech2TextTool(*, name='azure_cognitive_services_speech2text', description='A wrapper around Azure Cognitive Services Speech2Text. Useful for when you need to transcribe audio to text. Input should be a url to an audio file.', args_schema=None, ... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-6 | speech_config (Any) β
Return type
None
class langchain.tools.AzureCogsText2SpeechTool(*, name='azure_cognitive_services_text2speech', description='A wrapper around Azure Cognitive Services Text2Speech. Useful for when you need to convert text to speech. ', args_schema=None, return_direct=False, verbose=False, callback... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-7 | speech_config (Any) β
Return type
None
class langchain.tools.BaseGraphQLTool(*, name='query_graphql', description="Β Β Β Input to this tool is a detailed and correct GraphQL query, output is a result from the API.\nΒ Β Β If the query is not correct, an error message will be returned.\nΒ Β Β If an error is returned with 'Bad... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-8 | Parameters
requests_wrapper (langchain.requests.TextRequestsWrapper) β
Return type
None
attribute requests_wrapper: langchain.requests.TextRequestsWrapper [Required]ο
class langchain.tools.BaseSQLDatabaseTool(*, db)[source]ο
Bases: pydantic.main.BaseModel
Base tool for interacting with a SQL database.
Parameters
db (l... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-9 | attribute args_schema: Optional[Type[pydantic.main.BaseModel]] = Noneο
Pydantic model class to validate and parse the toolβs input arguments.
attribute callback_manager: Optional[langchain.callbacks.base.BaseCallbackManager] = Noneο
Deprecated. Please use callbacks instead.
attribute callbacks: Optional[Union[List[lang... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-10 | kwargs (Any) β
Return type
Any
run(tool_input, verbose=None, start_color='green', color='green', callbacks=None, **kwargs)[source]ο
Run the tool.
Parameters
tool_input (Union[str, Dict]) β
verbose (Optional[bool]) β
start_color (Optional[str]) β
color (Optional[str]) β
callbacks (Optional[Union[List[langchain.call... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-11 | num_results (int) β
api_wrapper (langchain.utilities.bing_search.BingSearchAPIWrapper) β
Return type
None
attribute api_wrapper: langchain.utilities.bing_search.BingSearchAPIWrapper [Required]ο
attribute num_results: int = 4ο
class langchain.tools.BingSearchRun(*, name='bing_search', description='A wrapper around Bin... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-12 | Bases: langchain.tools.base.BaseTool
Parameters
name (str) β
description (str) β
args_schema (Optional[Type[pydantic.main.BaseModel]]) β
return_direct (bool) β
verbose (bool) β
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) β
callback_... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-13 | callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.base.ToolException], str]]]) β
sync_browser (Optional['SyncBrowser']) β
async_browser (Optional['AsyncBrowser']) β
visible_only (bool) β
playwright_strict (bool) β
pla... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-14 | Parameters
name (str) β
description (str) β
args_schema (Type[pydantic.main.BaseModel]) β
return_direct (bool) β
verbose (bool) β
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) β
callback_manager (Optional[langchain.callbacks.base.Base... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-15 | return_direct (bool) β
verbose (bool) β
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) β
callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.b... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-16 | callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.base.ToolException], str]]]) β
root_dir (Optional[str]) β
Return type
None
attribute args_schema: Type[pydantic.main.BaseModel] = <class 'langchain.tools.file_management.... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-17 | callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) β
handle_tool_error (Optional[Union[bool, str, Callable[[langchain.tools.base.ToolException], str]]]) β
num_results (int) β
api_wrapper (langchain.utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper) β
Return type
None
attribute api_wrappe... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-18 | class langchain.tools.ExtractHyperlinksTool(*, name='extract_hyperlinks', description='Extract all hyperlinks on the current webpage', args_schema=<class 'langchain.tools.playwright.extract_hyperlinks.ExtractHyperlinksToolInput'>, return_direct=False, verbose=False, callbacks=None, callback_manager=None, handle_tool_er... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-19 | Parameters
page (Any) β
html_content (str) β
absolute_urls (bool) β
Return type
str
class langchain.tools.ExtractTextTool(*, name='extract_text', description='Extract all the text on the current webpage', args_schema=<class 'pydantic.main.BaseModel'>, return_direct=False, verbose=False, callbacks=None, callback_mana... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-20 | The unique name of the tool that clearly communicates its purpose.
class langchain.tools.FileSearchTool(*, name='file_search', description='Recursively search for files in a subdirectory that match the regex pattern', args_schema=<class 'langchain.tools.file_management.file_search.FileSearchInput'>, return_direct=False... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-21 | The unique name of the tool that clearly communicates its purpose.
class langchain.tools.GetElementsTool(*, name='get_elements', description='Retrieve elements in the current web page matching the given CSS selector', args_schema=<class 'langchain.tools.playwright.get_elements.GetElementsToolInput'>, return_direct=Fals... | https://api.python.langchain.com/en/latest/modules/tools.html |
8e7952d3fdad-22 | The unique name of the tool that clearly communicates its purpose.
class langchain.tools.GmailCreateDraft(*, name='create_gmail_draft', description='Use this tool to create a draft email with the provided message fields.', args_schema=<class 'langchain.tools.gmail.create_draft.CreateDraftSchema'>, return_direct=False, ... | https://api.python.langchain.com/en/latest/modules/tools.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.