API calls for all endpoints tagged CohereIntegration.
Summary
Functions
Chat with model (Cohere v2 format) Sends a chat request using Cohere v2 API format.
Create embeddings (Cohere v2 format) Creates embeddings using Cohere v2 API format.
Rerank documents (Cohere format) Reranks a list of documents against a query using Cohere's v2 Rerank API. The request body matches Cohere's native format.
Tokenize text (Cohere format) Tokenizes text using Cohere v1 API format.
Functions
@spec cohere_chat_v2( 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 (Cohere v2 format) Sends a chat request using Cohere v2 API format.
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 cohere_embed_v2( Tesla.Env.client(), ExBifrost.Model.CohereEmbeddingRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.CohereEmbeddingResponse.t()} | {:ok, ExBifrost.Model.CohereError.t()} | {:error, Tesla.Env.t()}
Create embeddings (Cohere v2 format) Creates embeddings using Cohere v2 API format.
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 cohere_rerank( Tesla.Env.client(), ExBifrost.Model.CohereRerankRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.CohereRerank200Response.t()} | {:ok, ExBifrost.Model.BifrostError.t()} | {:error, Tesla.Env.t()}
Rerank documents (Cohere format) Reranks a list of documents against a query using Cohere's v2 Rerank API. The request body matches Cohere's native format.
Parameters
connection(ExBifrost.Connection): Connection to servercohere_rerank_request(CohereRerankRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.CohereRerank200Response.t}on success{:error, Tesla.Env.t}on failure
@spec 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 (Cohere format) Tokenizes text using Cohere v1 API format.
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