ExLLM.Types (ex_llm v0.8.1)
View SourceShared type definitions used across ExLLM modules.
This module contains struct definitions and types that are used by multiple modules, helping to avoid circular dependencies.
Summary
Types
@type content_part() :: text_content() | image_content()
@type cost_result() :: %{ provider: String.t(), model: String.t(), input_tokens: non_neg_integer(), output_tokens: non_neg_integer(), total_tokens: non_neg_integer(), input_cost: float(), output_cost: float(), total_cost: float(), currency: String.t(), pricing: %{input: float(), output: float()} }
@type image_content() :: %{ type: :image_url | :image, image_url: image_url() | nil, image: image_data() | nil }
@type image_url() :: %{url: String.t(), detail: :auto | :low | :high | nil}
@type message() :: %{ :role => String.t(), :content => String.t() | [content_part()], optional(:timestamp) => DateTime.t(), optional(atom()) => any() }
@type provider_options() :: keyword()
@type stream() :: Enumerable.t()
@type text_content() :: %{type: :text, text: String.t()}
@type token_usage() :: %{ input_tokens: non_neg_integer(), output_tokens: non_neg_integer() }