Packages

A spec-compliant Open Responses server for Elixir and Phoenix, with pluggable provider adapters and first-class streaming.

Current section

Files

Jump to
open_responses lib open_responses responses content_part.ex
Raw

lib/open_responses/responses/content_part.ex

defmodule OpenResponses.Responses.ContentPart do
@moduledoc """
A polymorphic content part within a message item.
Discriminated on `type`:
- input_text, input_image, input_file, input_video (user content)
- output_text (model content)
"""
use Ash.Resource, data_layer: :embedded
attributes do
attribute :type, :atom do
constraints one_of: [
:input_text,
:input_image,
:input_file,
:input_video,
:output_text
]
allow_nil? false
end
attribute :text, :string
attribute :image_url, :string
attribute :file_id, :string
attribute :annotations, {:array, :map}, default: []
attribute :logprobs, :map
end
end