Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Assistant fixed #414

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ public interface OpenAiApi {

@Headers("OpenAI-Beta: assistants=v1")
@GET("/v1/threads/{thread_id}/runs")
Single<OpenAiResponse<Run>> listRuns(@Path("thread_id") String threadId, @Body ListSearchParameters listSearchParameters);
Single<OpenAiResponse<Run>> listRuns(@Path("thread_id") String threadId, @QueryMap Map<String, String> listSearchParameters);


@Headers("OpenAI-Beta: assistants=v1")
@POST("/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs")
Expand All @@ -319,5 +320,5 @@ public interface OpenAiApi {

@Headers("OpenAI-Beta: assistants=v1")
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps")
Single<OpenAiResponse<RunStep>> listRunSteps(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body ListSearchParameters listSearchParameters);
Single<OpenAiResponse<RunStep>> listRunSteps(@Path("thread_id") String threadId, @Path("run_id") String runId, @QueryMap Map<String, String> listSearchParameters);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import java.io.IOException;
import java.time.Duration;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -471,7 +472,12 @@ public Run modifyRun(String threadId, String runId, Map<String, String> metadata
}

public OpenAiResponse<Run> listRuns(String threadId, ListSearchParameters listSearchParameters) {
return execute(api.listRuns(threadId, listSearchParameters));
Map<String, String> search = new HashMap<>();
if (listSearchParameters != null) {
ObjectMapper mapper = defaultObjectMapper();
search = mapper.convertValue(listSearchParameters, Map.class);
}
return execute(api.listRuns(threadId, search));
}

public Run submitToolOutputs(String threadId, String runId, SubmitToolOutputsRequest submitToolOutputsRequest) {
Expand All @@ -491,7 +497,12 @@ public RunStep retrieveRunStep(String threadId, String runId, String stepId) {
}

public OpenAiResponse<RunStep> listRunSteps(String threadId, String runId, ListSearchParameters listSearchParameters) {
return execute(api.listRunSteps(threadId, runId, listSearchParameters));
Map<String, String> search = new HashMap<>();
if (listSearchParameters != null) {
ObjectMapper mapper = defaultObjectMapper();
search = mapper.convertValue(listSearchParameters, Map.class);
}
return execute(api.listRunSteps(threadId, runId, search));
}

/**
Expand Down