OpenaiEx.ConversationItems (openai_ex v0.9.22)

Copy Markdown View Source

This module provides an implementation of the OpenAI Conversation Items API. The API reference can be found at https://platform.openai.com/docs/api-reference/conversations/items.

Summary

Functions

Creates conversation items (one or more messages).

Deletes a conversation item.

Lists all items in a conversation.

Creates a new conversation items request with the given arguments.

Retrieves a specific conversation item by ID.

Functions

create(openai, conversation_id, request)

create!(openai, conversation_id, request)

Creates conversation items (one or more messages).

See https://platform.openai.com/docs/api-reference/conversations/createItem

delete(openai, conversation_id, item_id)

delete!(openai, conversation_id, item_id)

Deletes a conversation item.

See https://platform.openai.com/docs/api-reference/conversations/deleteItem

list(openai, conversation_id, params \\ %{})

list!(openai, conversation_id, params \\ %{})

Lists all items in a conversation.

See https://platform.openai.com/docs/api-reference/conversations/listItems

new(args)

Creates a new conversation items request with the given arguments.

Examples

iex> OpenaiEx.ConversationItems.new(items: [%{type: "message", role: "user", content: [%{type: "input_text", text: "Hello"}]}])
%{items: [%{type: "message", role: "user", content: [%{type: "input_text", text: "Hello"}]}]}

retrieve(openai, conversation_id, item_id)

retrieve!(openai, conversation_id, item_id)

Retrieves a specific conversation item by ID.

See https://platform.openai.com/docs/api-reference/conversations/retrieveItem