View Source OpenaiEx.Beta.Threads.Runs (openai_ex v0.7.0)

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

Summary

Functions

Calls the run create endpoint.

Returns a list of runs objects.

Creates a new run request with the given arguments.

Creates a new list runs request with the given arguments.

Calls the run retrieve endpoint.

Calls the run update endpoint.

Functions

Link to this function

create(openai, run, list)

View Source

Calls the run create endpoint.

Arguments

  • openai: The OpenAI configuration.
  • run: The run request, as a map with keys corresponding to the API fields.

Returns

A map containing the API response.

See https://platform.openai.com/docs/api-reference/runs/createRun for more information.

Link to this function

create_and_run(openai, params)

View Source
Link to this function

create_and_run(openai, params, list)

View Source
Link to this function

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

View Source

Returns a list of runs objects.

https://platform.openai.com/docs/api-reference/runs/listRuns

Creates a new run request with the given arguments.

Arguments

  • args: A list of key-value pairs, or a map, representing the fields of the run request.

Returns

A map containing the fields of the run request.

The :thread_id and :assistant_id fields are required.

Example usage:

iex> _request = OpenaiEx.Beta.Threads.Runs.new(thread_id: "thread_foo", assistant_id: "assistant_bar")
%{assistant_id: "assistant_bar", thread_id: "thread_foo"}

Creates a new list runs request with the given arguments.

Arguments

  • args: A list of key-value pairs, or a map, representing the fields of the list runs request.

Returns

A map containing the fields of the list runs request.

Calls the run retrieve endpoint.

Arguments

  • openai: The OpenAI configuration.
  • params: Specification of the run to retrieve.

Returns

A map containing the fields of the run retrieve response.

https://platform.openai.com/docs/api-reference/runs/getRun

Link to this function

submit_tool_outputs(openai, map)

View Source
Link to this function

submit_tool_outputs(openai, map, list)

View Source

Calls the run update endpoint.

Arguments

  • openai: The OpenAI configuration.
  • params: run to update and new field values.

Returns

A map containing the API response.

See https://platform.openai.com/docs/api-reference/assistants/modifyAssistant for more information.