View Source GptAgent.Types (gpt_agent v6.0.0)

Defines the generic types used throughout the library and provides common validation for those types.

You can use GptAgent.Types in other modules to import the validation functions and automatically set up both TypedStruct and Domo for your module.

Summary

Functions

Validates metadata according to OpenAI documentation

Validation for the nonblank_string() type

Types

@type assistant_id() :: nonblank_string()
@type error(t) :: {:error, t}
@type file_id() :: nonblank_string()
@type message_id() :: nonblank_string()
@type message_metadata() :: %{required(String.t()) => Jason.Encoder.t()}
@type nonblank_string() :: String.t()
@type result(error_type) :: success() | error(error_type)
Link to this type

result(success_type, error_type)

View Source
@type result(success_type, error_type) :: success(success_type) | error(error_type)
@type run_id() :: nonblank_string()
@type success() :: :ok
@type success(t) :: {:ok, t}
@type thread_id() :: nonblank_string()
@type tool_arguments() :: %{required(String.t()) => Jason.Encoder.t()}
@type tool_call_id() :: nonblank_string()
@type tool_name() :: nonblank_string()
@type tool_output() :: nonblank_string()

Functions

Link to this function

validate_message_metadata(metadata)

View Source
@spec validate_message_metadata(message_metadata()) :: result(String.t())

Validates metadata according to OpenAI documentation

Link to this function

validate_nonblank_string(value)

View Source
@spec validate_nonblank_string(String.t()) :: result(String.t())

Validation for the nonblank_string() type