utilities#

Utilities are the integrations with third-part systems and packages.

Other LangChain classes use Utilities to interact with third-part systems and packages.

Classes

utilities.alpha_vantage.AlphaVantageAPIWrapper

Wrapper for AlphaVantage API for Currency Exchange Rate.

utilities.apify.ApifyWrapper

Wrapper around Apify.

utilities.arcee.ArceeDocument

Arcee document.

utilities.arcee.ArceeDocumentAdapter()

Adapter for Arcee documents

utilities.arcee.ArceeDocumentSource

Source of an Arcee document.

utilities.arcee.ArceeRoute(value[, names, ...])

Routes available for the Arcee API as enumerator.

utilities.arcee.ArceeWrapper(arcee_api_key, ...)

Wrapper for Arcee API.

utilities.arcee.DALMFilter

Filters available for a DALM retrieval and generation.

utilities.arcee.DALMFilterType(value[, ...])

Filter types available for a DALM retrieval as enumerator.

utilities.arxiv.ArxivAPIWrapper

Wrapper around ArxivAPI.

utilities.asknews.AskNewsAPIWrapper

Wrapper for AskNews API.

utilities.astradb.SetupMode(value[, names, ...])

Setup mode for AstraDBEnvironment as enumerator.

utilities.awslambda.LambdaWrapper

Wrapper for AWS Lambda SDK.

utilities.bibtex.BibtexparserWrapper

Wrapper around bibtexparser.

utilities.bing_search.BingSearchAPIWrapper

Wrapper for Bing Web Search API.

utilities.brave_search.BraveSearchWrapper

Wrapper around the Brave search engine.

utilities.cassandra.SetupMode(value[, ...])

utilities.cassandra_database.CassandraDatabase([...])

Apache Cassandra® database wrapper.

utilities.cassandra_database.DatabaseError(message)

Exception raised for errors in the database schema.

utilities.cassandra_database.Table

Create a new model by parsing and validating input data from keyword arguments.

utilities.clickup.CUList(folder_id, name[, ...])

Component class for a list.

utilities.clickup.ClickupAPIWrapper

Wrapper for Clickup API.

utilities.clickup.Component()

Base class for all components.

utilities.clickup.Member(id, username, ...)

Component class for a member.

utilities.clickup.Space(id, name, private, ...)

Component class for a space.

utilities.clickup.Task(id, name, ...)

Class for a task.

utilities.clickup.Team(id, name, members)

Component class for a team.

utilities.dalle_image_generator.DallEAPIWrapper

Wrapper for OpenAI's DALL-E Image Generator.

utilities.dataforseo_api_search.DataForSeoAPIWrapper

Wrapper around the DataForSeo API.

utilities.dataherald.DataheraldAPIWrapper

Wrapper for Dataherald.

utilities.dria_index.DriaAPIWrapper(api_key)

Wrapper around Dria API.

utilities.duckduckgo_search.DuckDuckGoSearchAPIWrapper

Wrapper for DuckDuckGo Search API.

utilities.financial_datasets.FinancialDatasetsAPIWrapper

Wrapper for financial datasets API.

utilities.github.GitHubAPIWrapper

Wrapper for GitHub API.

utilities.gitlab.GitLabAPIWrapper

Wrapper for GitLab API.

utilities.golden_query.GoldenQueryAPIWrapper

Wrapper for Golden.

utilities.google_finance.GoogleFinanceAPIWrapper

Wrapper for SerpApi's Google Finance API

utilities.google_jobs.GoogleJobsAPIWrapper

Wrapper for SerpApi's Google Scholar API

utilities.google_lens.GoogleLensAPIWrapper

Wrapper for SerpApi's Google Lens API

utilities.google_scholar.GoogleScholarAPIWrapper

Wrapper for Google Scholar API

utilities.google_serper.GoogleSerperAPIWrapper

Wrapper around the Serper.dev Google Search API.

utilities.google_trends.GoogleTrendsAPIWrapper

Wrapper for SerpApi's Google Scholar API

utilities.graphql.GraphQLAPIWrapper

Wrapper around GraphQL API.

utilities.infobip.InfobipAPIWrapper

Wrapper for Infobip API for messaging.

utilities.jina_search.JinaSearchAPIWrapper

Wrapper around the Jina search engine.

utilities.jira.JiraAPIWrapper

Wrapper for Jira API.

utilities.max_compute.MaxComputeAPIWrapper(client)

Interface for querying Alibaba Cloud MaxCompute tables.

utilities.merriam_webster.MerriamWebsterAPIWrapper

Wrapper for Merriam-Webster.

utilities.metaphor_search.MetaphorSearchAPIWrapper

Wrapper for Metaphor Search API.

utilities.mojeek_search.MojeekSearchAPIWrapper

Create a new model by parsing and validating input data from keyword arguments.

utilities.nasa.NasaAPIWrapper

Wrapper for NASA API.

utilities.nvidia_riva.ASRInputType

alias of AudioStream

utilities.nvidia_riva.AudioStream([maxsize])

A message containing streaming audio.

utilities.nvidia_riva.NVIDIARivaASR

alias of RivaASR

utilities.nvidia_riva.NVIDIARivaStream

alias of AudioStream

utilities.nvidia_riva.NVIDIARivaTTS

alias of RivaTTS

utilities.nvidia_riva.RivaASR

A runnable that performs Automatic Speech Recognition (ASR) using NVIDIA Riva.

utilities.nvidia_riva.RivaAudioEncoding(value)

An enum of the possible choices for Riva audio encoding.

utilities.nvidia_riva.RivaAuthMixin

Configuration for the authentication to a Riva service connection.

utilities.nvidia_riva.RivaCommonConfigMixin

A collection of common Riva settings.

utilities.nvidia_riva.RivaTTS

A runnable that performs Text-to-Speech (TTS) with NVIDIA Riva.

utilities.nvidia_riva.SentinelT()

An empty Sentinel type.

utilities.openapi.HTTPVerb(value[, names, ...])

Enumerator of the HTTP verbs.

utilities.openapi.OpenAPISpec()

OpenAPI Model that removes mis-formatted parts of the spec.

utilities.openweathermap.OpenWeatherMapAPIWrapper

Wrapper for OpenWeatherMap API using PyOWM.

utilities.oracleai.OracleSummary(conn, params)

Get Summary :param conn: Oracle Connection, :param params: Summary parameters, :param proxy: Proxy

utilities.outline.OutlineAPIWrapper

Wrapper around OutlineAPI.

utilities.passio_nutrition_ai.ManagedPassioLifeAuth(...)

Manage the token for the NutritionAI API.

utilities.passio_nutrition_ai.NoDiskStorage()

Mixin to prevent storing on disk.

utilities.passio_nutrition_ai.NutritionAIAPI

Wrapper for the Passio Nutrition AI API.

utilities.pebblo.App

Pebblo AI application.

utilities.pebblo.Doc

Pebblo document.

utilities.pebblo.Framework

Pebblo Framework instance.

utilities.pebblo.IndexedDocument

Pebblo Indexed Document.

utilities.pebblo.PebbloLoaderAPIWrapper

Wrapper for Pebblo Loader API.

utilities.pebblo.Routes(value[, names, ...])

Routes available for the Pebblo API as enumerator.

utilities.pebblo.Runtime

Pebblo Runtime.

utilities.polygon.PolygonAPIWrapper

Wrapper for Polygon API.

utilities.portkey.Portkey()

Portkey configuration.

utilities.powerbi.PowerBIDataset

Create PowerBI engine from dataset ID and credential or token.

utilities.pubmed.PubMedAPIWrapper

Wrapper around PubMed API.

utilities.reddit_search.RedditSearchAPIWrapper

Wrapper for Reddit API

utilities.redis.TokenEscaper([escape_chars_re])

Escape punctuation within an input string.

utilities.rememberizer.RememberizerAPIWrapper

Wrapper for Rememberizer APIs.

utilities.requests.GenericRequestsWrapper

Lightweight wrapper around requests library.

utilities.requests.JsonRequestsWrapper

Lightweight wrapper around requests library, with async support.

utilities.requests.Requests

Wrapper around requests to handle auth and async.

utilities.requests.RequestsWrapper

alias of TextRequestsWrapper

utilities.requests.TextRequestsWrapper

Lightweight wrapper around requests library, with async support.

utilities.scenexplain.SceneXplainAPIWrapper

Wrapper for SceneXplain API.

utilities.searchapi.SearchApiAPIWrapper

Wrapper around SearchApi API.

utilities.searx_search.SearxResults(data)

Dict like wrapper around search api results.

utilities.searx_search.SearxSearchWrapper

Wrapper for Searx API.

utilities.semanticscholar.SemanticScholarAPIWrapper

Wrapper around semanticscholar.org API.

utilities.serpapi.HiddenPrints()

Context manager to hide prints.

utilities.serpapi.SerpAPIWrapper

Wrapper around SerpAPI.

utilities.spark_sql.SparkSQL([...])

SparkSQL is a utility class for interacting with Spark SQL.

utilities.sql_database.SQLDatabase(engine[, ...])

SQLAlchemy wrapper around a database.

utilities.stackexchange.StackExchangeAPIWrapper

Wrapper for Stack Exchange API.

utilities.steam.SteamWebAPIWrapper

Wrapper for Steam API.

utilities.tavily_search.TavilySearchAPIWrapper

Wrapper for Tavily Search API.

utilities.tensorflow_datasets.TensorflowDatasets

Access to the TensorFlow Datasets.

utilities.twilio.TwilioAPIWrapper

Messaging Client using Twilio.

utilities.wikidata.WikidataAPIWrapper

Wrapper around the Wikidata API.

utilities.wikipedia.WikipediaAPIWrapper

Wrapper around WikipediaAPI.

utilities.wolfram_alpha.WolframAlphaAPIWrapper

Wrapper for Wolfram Alpha.

utilities.you.YouAPIOutput

Output from you.com API.

utilities.you.YouDocument

Output of parsing one snippet.

utilities.you.YouHit

A single hit from you.com, which may contain multiple snippets

utilities.you.YouHitMetadata

Metadata on a single hit from you.com

utilities.you.YouSearchAPIWrapper

Wrapper for you.com Search and News API.

utilities.zapier.ZapierNLAWrapper

Wrapper for Zapier NLA.

Functions

utilities.anthropic.get_num_tokens_anthropic(text)

Get the number of tokens in a string of text.

utilities.anthropic.get_token_ids_anthropic(text)

Get the token ids for a string of text.

utilities.cassandra.aexecute_cql(session, ...)

Execute a CQL query asynchronously.

utilities.cassandra.wrapped_response_future(...)

Wrap a Cassandra response future in an asyncio future.

utilities.clickup.extract_dict_elements_from_component_fields(...)

Extract elements from a dictionary.

utilities.clickup.fetch_data(url, access_token)

Fetch data from a URL.

utilities.clickup.fetch_first_id(data, key)

Fetch the first id from a dictionary.

utilities.clickup.fetch_folder_id(space_id, ...)

Fetch the folder id.

utilities.clickup.fetch_list_id(space_id, ...)

Fetch the list id.

utilities.clickup.fetch_space_id(team_id, ...)

Fetch the space id.

utilities.clickup.fetch_team_id(access_token)

Fetch the team id.

utilities.clickup.load_query(query[, ...])

Parse a JSON string and return the parsed object.

utilities.clickup.parse_dict_through_component(...)

Parse a dictionary by creating a component and then turning it back into a dictionary.

utilities.opaqueprompts.desanitize(...)

Restore the original sensitive data from the sanitized text.

utilities.opaqueprompts.sanitize(input)

Sanitize input string or dict of strings by replacing sensitive data with placeholders.

utilities.passio_nutrition_ai.is_http_retryable(rsp)

Check if a HTTP response is retryable.

utilities.pebblo.calculate_content_size(data)

Calculate the content size in bytes: - Encode the string to bytes using a specific encoding (e.g., UTF-8) - Get the length of the encoded bytes.

utilities.pebblo.generate_size_based_batches(docs)

Generate batches of documents based on page_content size.

utilities.pebblo.get_file_owner_from_path(...)

Fetch owner of local file path.

utilities.pebblo.get_full_path(path)

Return an absolute local path for a local file/directory, for a network related path, return as is.

utilities.pebblo.get_ip()

Fetch local runtime ip address.

utilities.pebblo.get_loader_full_path(loader)

Return an absolute source path of source of loader based on the keys present in Document.

utilities.pebblo.get_loader_type(loader)

Return loader type among, file, dir or in-memory.

utilities.pebblo.get_runtime()

Fetch the current Framework and Runtime details.

utilities.pebblo.get_source_size(source_path)

Fetch size of source path.

utilities.powerbi.fix_table_name(table)

Add single quotes around table names that contain spaces.

utilities.powerbi.json_to_md(json_contents)

Convert a JSON object to a markdown table.

utilities.redis.check_redis_module_exist(...)

Check if the correct Redis modules are installed.

utilities.redis.get_client(redis_url, **kwargs)

Get a redis client from the connection url given.

utilities.sql_database.truncate_word(...[, ...])

Truncate a string to a certain number of words, based on the max string length.

utilities.vertexai.create_retry_decorator(llm, *)

Create a retry decorator for Vertex / Palm LLMs.

utilities.vertexai.get_client_info([module])

Return a custom user agent header.

utilities.vertexai.init_vertexai([project, ...])

Init Vertex AI.

utilities.vertexai.load_image_from_gcs(path)

Load an image from Google Cloud Storage.

utilities.vertexai.raise_vertex_import_error([...])

Raise ImportError related to Vertex SDK being not available.

Deprecated classes

utilities.google_places_api.GooglePlacesAPIWrapper

Deprecated since version 0.0.33: Use langchain_google_community.GooglePlacesAPIWrapper instead.

utilities.google_search.GoogleSearchAPIWrapper

Deprecated since version 0.0.33: Use langchain_google_community.GoogleSearchAPIWrapper instead.