OpenaiEx.Embeddings (openai_ex v0.9.4)
View SourceThis 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.
See https://platform.openai.com/docs/api-reference/embeddings/create for more information.
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"}