OpenaiEx.Embeddings (openai_ex v0.9.4)

View Source

This module provides an implementation of the OpenAI embeddings API. The API reference can be found at https://platform.openai.com/docs/api-reference/embeddings.

Summary

Functions

Calls the embedding endpoint.

Creates a new embedding request

Functions

create(openai, embedding)

create!(openai, embedding)

Calls the embedding endpoint.

See https://platform.openai.com/docs/api-reference/embeddings/create for more information.

new(args)

Creates a new embedding request

Example usage:

iex> _request = OpenaiEx.Embeddings.new(model: "text-embedding-ada-002", input: "This is a test")
%{input: "This is a test", model: "text-embedding-ada-002"}

iex> _request = OpenaiEx.Embeddings.new(%{model: "text-embedding-ada-002", input: "This is a test"})
%{input: "This is a test", model: "text-embedding-ada-002"}