View Source ExOpenAi.EmbeddingRequest (ex_open_ai v0.1.3)

Represents an embedding request to the OpenAI API.

Link to this section Summary

Functions

Builds the create embedding request and validates the required fields.

Builds the map by adding to the existing map and updates the map with the attributes passed in.

Ensures that the map has the required fields.

Prepares the map by removing any fields that are not in the list of fields. and ensures required fields are present.

Link to this section Functions

@spec create(params :: map()) :: {:ok, ExOpenAi.Embedding.t()} | {:error, map()}

Builds the create embedding request and validates the required fields.

Link to this function

delete_invalid_fields(map, fields)

View Source
@spec delete_invalid_fields(map(), fields :: list()) :: map()
Link to this function

do_change(map, attributes)

View Source
@spec do_change(map(), attributes :: list()) :: map()

Builds the map by adding to the existing map and updates the map with the attributes passed in.

Link to this function

has_required_fields(map, fields)

View Source
@spec has_required_fields(map(), fields :: list()) :: boolean()

Ensures that the map has the required fields.

Link to this function

prepare(map, fields, required_fields)

View Source
@spec prepare(map(), fields :: list(), required_fields :: list()) :: map()

Prepares the map by removing any fields that are not in the list of fields. and ensures required fields are present.