API calls for all endpoints tagged LangChainIntegration.
Summary
Functions
Count tokens (LangChain - Anthropic format) Counts tokens using Anthropic-compatible format via LangChain.
Create message (LangChain - Anthropic format) Creates a message using Anthropic-compatible format via LangChain.
Converse with model (LangChain - Bedrock format) Sends messages using AWS Bedrock Converse-compatible format via LangChain.
Stream converse with model (LangChain - Bedrock format) Streams messages using AWS Bedrock Converse-compatible format via LangChain.
Chat with model (LangChain - Cohere format) Sends a chat request using Cohere-compatible format via LangChain.
Create embeddings (LangChain - Cohere format) Creates embeddings using Cohere-compatible format via LangChain.
Tokenize text (LangChain - Cohere format) Tokenizes text using Cohere-compatible format via LangChain.
Generate content (LangChain - Gemini format) Generates content using Google Gemini-compatible format via LangChain.
List models (LangChain - Gemini format) Lists available models in Google Gemini API format via LangChain.
Stream generate content (LangChain - Gemini format) Streams content generation using Google Gemini-compatible format via LangChain.
Chat completions (LangChain - OpenAI format) Creates a chat completion using OpenAI-compatible format via LangChain.
Count input tokens (LangChain - OpenAI format) Counts the number of tokens in a Responses API request via LangChain.
Create embeddings (LangChain - OpenAI format) Creates embeddings using OpenAI-compatible format via LangChain.
List models (LangChain - OpenAI format) Lists available models using OpenAI-compatible format via LangChain.
Create response (LangChain - OpenAI Responses API) Creates a response using OpenAI Responses API format via LangChain. Supports streaming via SSE.
Create speech (LangChain - OpenAI TTS) Generates audio from text using OpenAI TTS via LangChain.
Text completions (LangChain - OpenAI format) Creates a text completion using OpenAI-compatible format via LangChain. This is the legacy completions API.
Create transcription (LangChain - OpenAI Whisper) Transcribes audio into text using OpenAI Whisper via LangChain.
Functions
@spec langchain_anthropic_count_tokens( Tesla.Env.client(), ExBifrost.Model.AnthropicMessageRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.AnthropicCreateMessage400Response.t()} | {:ok, ExBifrost.Model.AnthropicCountTokens200Response.t()} | {:error, Tesla.Env.t()}
Count tokens (LangChain - Anthropic format) Counts tokens using Anthropic-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveranthropic_message_request(AnthropicMessageRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.AnthropicCountTokens200Response.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_anthropic_messages( Tesla.Env.client(), ExBifrost.Model.AnthropicMessageRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.AnthropicCreateMessage400Response.t()} | {:ok, ExBifrost.Model.AnthropicMessageResponse.t()} | {:error, Tesla.Env.t()}
Create message (LangChain - Anthropic format) Creates a message using Anthropic-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveranthropic_message_request(AnthropicMessageRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.AnthropicMessageResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_bedrock_converse( Tesla.Env.client(), String.t(), ExBifrost.Model.BedrockConverseRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.BedrockError.t()} | {:ok, ExBifrost.Model.BedrockConverseResponse.t()} | {:error, Tesla.Env.t()}
Converse with model (LangChain - Bedrock format) Sends messages using AWS Bedrock Converse-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servermodel_id(String.t): Model IDbedrock_converse_request(BedrockConverseRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.BedrockConverseResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_bedrock_converse_stream( Tesla.Env.client(), String.t(), ExBifrost.Model.BedrockConverseRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.BedrockError.t()} | {:ok, ExBifrost.Model.BedrockConverseStream200Response.t()} | {:error, Tesla.Env.t()}
Stream converse with model (LangChain - Bedrock format) Streams messages using AWS Bedrock Converse-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servermodel_id(String.t): Model IDbedrock_converse_request(BedrockConverseRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.BedrockConverseStream200Response.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_cohere_chat( Tesla.Env.client(), ExBifrost.Model.CohereChatRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.CohereChatResponse.t()} | {:ok, ExBifrost.Model.CohereError.t()} | {:error, Tesla.Env.t()}
Chat with model (LangChain - Cohere format) Sends a chat request using Cohere-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servercohere_chat_request(CohereChatRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.CohereChatResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_cohere_embed( Tesla.Env.client(), ExBifrost.Model.CohereEmbeddingRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.CohereEmbeddingResponse.t()} | {:ok, ExBifrost.Model.CohereError.t()} | {:error, Tesla.Env.t()}
Create embeddings (LangChain - Cohere format) Creates embeddings using Cohere-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servercohere_embedding_request(CohereEmbeddingRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.CohereEmbeddingResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_cohere_tokenize( Tesla.Env.client(), ExBifrost.Model.CohereCountTokensRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.CohereCountTokensResponse.t()} | {:ok, ExBifrost.Model.CohereError.t()} | {:error, Tesla.Env.t()}
Tokenize text (LangChain - Cohere format) Tokenizes text using Cohere-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servercohere_count_tokens_request(CohereCountTokensRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.CohereCountTokensResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_gemini_generate_content( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiGenerationRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiGenerationResponse.t()} | {:error, Tesla.Env.t()}
Generate content (LangChain - Gemini format) Generates content using Google Gemini-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with actiongemini_generation_request(GeminiGenerationRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiGenerationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_gemini_list_models( Tesla.Env.client(), keyword() ) :: {:ok, ExBifrost.Model.GeminiListModelsResponse.t()} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
List models (LangChain - Gemini format) Lists available models in Google Gemini API format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveropts(keyword): Optional parameters:pageSize(integer()): Maximum number of models to return:pageToken(String.t): Page token for pagination
Returns
{:ok, ExBifrost.Model.GeminiListModelsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_gemini_stream_generate_content( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiGenerationRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiGenerationResponse.t()} | {:error, Tesla.Env.t()}
Stream generate content (LangChain - Gemini format) Streams content generation using Google Gemini-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with actiongemini_generation_request(GeminiGenerationRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiGenerationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_chat_completions( Tesla.Env.client(), ExBifrost.Model.OpenAiChatRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.ChatCompletionResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Chat completions (LangChain - OpenAI format) Creates a chat completion using OpenAI-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveropen_ai_chat_request(OpenAiChatRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.ChatCompletionResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_count_input_tokens( Tesla.Env.client(), ExBifrost.Model.OpenAiResponsesRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.BifrostError.t()} | {:ok, ExBifrost.Model.CountTokensResponse.t()} | {:error, Tesla.Env.t()}
Count input tokens (LangChain - OpenAI format) Counts the number of tokens in a Responses API request via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveropen_ai_responses_request(OpenAiResponsesRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.CountTokensResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_embeddings( Tesla.Env.client(), ExBifrost.Model.OpenAiEmbeddingRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.EmbeddingResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Create embeddings (LangChain - OpenAI format) Creates embeddings using OpenAI-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveropen_ai_embedding_request(OpenAiEmbeddingRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.EmbeddingResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_list_models( Tesla.Env.client(), keyword() ) :: {:ok, ExBifrost.Model.OpenAiListModelsResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
List models (LangChain - OpenAI format) Lists available models using OpenAI-compatible format via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveropts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.OpenAiListModelsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_responses( Tesla.Env.client(), ExBifrost.Model.OpenAiResponsesRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.ResponsesResponse.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Create response (LangChain - OpenAI Responses API) Creates a response using OpenAI Responses API format via LangChain. Supports streaming via SSE.
Parameters
connection(ExBifrost.Connection): Connection to serveropen_ai_responses_request(OpenAiResponsesRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.ResponsesResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_speech( Tesla.Env.client(), ExBifrost.Model.OpenAiSpeechRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.BifrostError.t()} | {:ok, String.t()} | {:error, Tesla.Env.t()}
Create speech (LangChain - OpenAI TTS) Generates audio from text using OpenAI TTS via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to serveropen_ai_speech_request(OpenAiSpeechRequest):opts(keyword): Optional parameters
Returns
{:ok, String.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_text_completions( Tesla.Env.client(), ExBifrost.Model.OpenAiTextCompletionRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.BifrostError.t()} | {:ok, ExBifrost.Model.TextCompletionResponse.t()} | {:error, Tesla.Env.t()}
Text completions (LangChain - OpenAI format) Creates a text completion using OpenAI-compatible format via LangChain. This is the legacy completions API.
Parameters
connection(ExBifrost.Connection): Connection to serveropen_ai_text_completion_request(OpenAiTextCompletionRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.TextCompletionResponse.t}on success{:error, Tesla.Env.t}on failure
@spec langchain_open_ai_transcriptions( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, ExBifrost.Model.BifrostError.t()} | {:ok, ExBifrost.Model.TranscriptionResponse.t()} | {:error, Tesla.Env.t()}
Create transcription (LangChain - OpenAI Whisper) Transcribes audio into text using OpenAI Whisper via LangChain.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model identifier (e.g., whisper-1)file(String.t): Audio file to transcribeopts(keyword): Optional parameters:language(String.t): Language of the audio (ISO 639-1):prompt(String.t): Prompt to guide transcription:response_format(String.t)::temperature(number())::timestamp_granularities([String.t])::stream(boolean())::fallbacks([String.t]):
Returns
{:ok, ExBifrost.Model.TranscriptionResponse.t}on success{:error, Tesla.Env.t}on failure