|
|
@@ -50,6 +50,7 @@ describe("OpenAI Responses route", () => {
|
|
|
{ role: "system", content: "You are concise." },
|
|
|
{ role: "user", content: [{ type: "input_text", text: "Say hello." }] },
|
|
|
],
|
|
|
+ store: false,
|
|
|
stream: true,
|
|
|
max_output_tokens: 20,
|
|
|
temperature: 0,
|
|
|
@@ -161,16 +162,16 @@ describe("OpenAI Responses route", () => {
|
|
|
Effect.gen(function* () {
|
|
|
const prepared = yield* LLMClient.prepare(
|
|
|
LLM.updateRequest(request, {
|
|
|
- model: OpenAI.configure({ baseURL: "https://api.openai.test/v1/", apiKey: "test" }).responsesWebSocket(
|
|
|
- "gpt-4.1-mini",
|
|
|
- ),
|
|
|
+ model: OpenAIResponses.webSocketRoute
|
|
|
+ .with({ endpoint: { baseURL: "https://api.openai.test/v1/" }, auth: Auth.bearer("test") })
|
|
|
+ .model({ id: "gpt-4.1-mini" }),
|
|
|
}),
|
|
|
)
|
|
|
|
|
|
expect(prepared.route).toBe("openai-responses-websocket")
|
|
|
expect(prepared.protocol).toBe("openai-responses")
|
|
|
expect(prepared.metadata).toEqual({ transport: "websocket-json" })
|
|
|
- expect(prepared.body).toMatchObject({ model: "gpt-4.1-mini", stream: true })
|
|
|
+ expect(prepared.body).toMatchObject({ model: "gpt-4.1-mini", store: false, stream: true })
|
|
|
}),
|
|
|
)
|
|
|
|
|
|
@@ -356,7 +357,13 @@ describe("OpenAI Responses route", () => {
|
|
|
{ type: "function_call", call_id: "call_1", name: "lookup", arguments: '{"query":"weather"}' },
|
|
|
{ type: "function_call_output", call_id: "call_1", output: '{"forecast":"sunny"}' },
|
|
|
],
|
|
|
+ store: false,
|
|
|
stream: true,
|
|
|
+ max_output_tokens: undefined,
|
|
|
+ temperature: undefined,
|
|
|
+ tool_choice: undefined,
|
|
|
+ tools: undefined,
|
|
|
+ top_p: undefined,
|
|
|
})
|
|
|
}),
|
|
|
)
|
|
|
@@ -519,7 +526,6 @@ describe("OpenAI Responses route", () => {
|
|
|
},
|
|
|
{
|
|
|
type: "reasoning",
|
|
|
- id: "rs_continuation_1",
|
|
|
encrypted_content: "encrypted-continuation-state",
|
|
|
summary: [{ type: "summary_text", text: "I inspected the previous turn." }],
|
|
|
},
|
|
|
@@ -864,7 +870,9 @@ describe("OpenAI Responses route", () => {
|
|
|
|
|
|
it.effect("closes reasoning summary parts when storage is not disabled", () =>
|
|
|
Effect.gen(function* () {
|
|
|
- const response = yield* LLMClient.generate(request).pipe(
|
|
|
+ const response = yield* LLMClient.generate(
|
|
|
+ LLM.updateRequest(request, { providerOptions: { openai: { store: true } } }),
|
|
|
+ ).pipe(
|
|
|
Effect.provide(
|
|
|
fixedResponse(
|
|
|
sseEvents(
|
|
|
@@ -925,12 +933,12 @@ describe("OpenAI Responses route", () => {
|
|
|
dynamicResponse((input) =>
|
|
|
Effect.gen(function* () {
|
|
|
const web = yield* HttpClientRequest.toWeb(input.request).pipe(Effect.orDie)
|
|
|
- expect(yield* Effect.promise(() => web.json())).toMatchObject({
|
|
|
+ const body = yield* Effect.promise(() => web.json())
|
|
|
+ expect(body).toMatchObject({
|
|
|
input: [
|
|
|
{ role: "user", content: [{ type: "input_text", text: "What changed?" }] },
|
|
|
{
|
|
|
type: "reasoning",
|
|
|
- id: "rs_1",
|
|
|
encrypted_content: "encrypted-state",
|
|
|
summary: [{ type: "summary_text", text: "Checked the previous diff." }],
|
|
|
},
|
|
|
@@ -938,6 +946,7 @@ describe("OpenAI Responses route", () => {
|
|
|
{ role: "user", content: [{ type: "input_text", text: "Summarize it." }] },
|
|
|
],
|
|
|
})
|
|
|
+ expect(body.input[1]).not.toHaveProperty("id")
|
|
|
return input.respond(
|
|
|
sseEvents(
|
|
|
{ type: "response.output_text.delta", item_id: "msg_1", delta: "Parser now round-trips reasoning." },
|
|
|
@@ -984,7 +993,6 @@ describe("OpenAI Responses route", () => {
|
|
|
{ role: "assistant", content: [{ type: "output_text", text: "Before." }] },
|
|
|
{
|
|
|
type: "reasoning",
|
|
|
- id: "rs_1",
|
|
|
encrypted_content: "encrypted-state",
|
|
|
summary: [{ type: "summary_text", text: "Checked order." }],
|
|
|
},
|
|
|
@@ -1078,7 +1086,6 @@ describe("OpenAI Responses route", () => {
|
|
|
expect(prepared.body.input).toEqual([
|
|
|
{
|
|
|
type: "reasoning",
|
|
|
- id: "rs_1",
|
|
|
encrypted_content: "encrypted-state",
|
|
|
summary: [
|
|
|
{ type: "summary_text", text: "First" },
|