Class RunsClient
java.lang.Object
io.github.stefanbratanov.jvm.openai.RunsClient
Represents an execution run on a thread.
Based on Runs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HttpClient
protected final com.fasterxml.jackson.databind.ObjectMapper
-
Method Summary
Modifier and TypeMethodDescriptionCancels a run that is in_progress.createRun
(String threadId, CreateRunRequest request) Create a run.Create a thread and run it in one request.listRuns
(String threadId, PaginationQueryParameters queryParameters) Returns a list of runs belonging to a thread.listRunSteps
(String threadId, String runId, PaginationQueryParameters queryParameters) Returns a list of run steps belonging to a run.modifyRun
(String threadId, String runId, ModifyRunRequest request) Modifies a run.retrieveRun
(String threadId, String runId) Retrieves a run.retrieveRunStep
(String threadId, String runId, String stepId) Retrieves a run step.submitToolOutputs
(String threadId, String runId, SubmitToolOutputsRequest request) When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed.
-
Field Details
-
httpClient
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Details
-
createRun
Create a run.- Throws:
OpenAIException
- in case of API errors
-
createThreadAndRun
Create a thread and run it in one request.- Throws:
OpenAIException
- in case of API errors
-
listRuns
public RunsClient.PaginatedThreadRuns listRuns(String threadId, PaginationQueryParameters queryParameters) Returns a list of runs belonging to a thread.- Throws:
OpenAIException
- in case of API errors
-
listRunSteps
public RunsClient.PaginatedThreadRunSteps listRunSteps(String threadId, String runId, PaginationQueryParameters queryParameters) Returns a list of run steps belonging to a run.- Throws:
OpenAIException
- in case of API errors
-
retrieveRun
Retrieves a run.- Throws:
OpenAIException
- in case of API errors
-
retrieveRunStep
Retrieves a run step.- Throws:
OpenAIException
- in case of API errors
-
modifyRun
Modifies a run.- Throws:
OpenAIException
- in case of API errors
-
submitToolOutputs
When a run has the status: "requires_action" and required_action.type is submit_tool_outputs, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.- Throws:
OpenAIException
- in case of API errors
-
cancelRun
Cancels a run that is in_progress.- Throws:
OpenAIException
- in case of API errors
-