mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 00:02:11 +00:00
Add more models to stream.test.ts for Vercel, set infinite timeout on OpenAI responses, closes #690
This commit is contained in:
parent
1d8d5d3d88
commit
28072cb31f
2 changed files with 55 additions and 1 deletions
|
|
@ -87,7 +87,7 @@ export const streamOpenAIResponses: StreamFunction<"openai-responses"> = (
|
||||||
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
||||||
const client = createClient(model, context, apiKey);
|
const client = createClient(model, context, apiKey);
|
||||||
const params = buildParams(model, context, options);
|
const params = buildParams(model, context, options);
|
||||||
const openaiStream = await client.responses.create(params, { signal: options?.signal });
|
const openaiStream = await client.responses.create(params, { signal: options?.signal, timeout: undefined });
|
||||||
stream.push({ type: "start", partial: output });
|
stream.push({ type: "start", partial: output });
|
||||||
|
|
||||||
let currentItem: ResponseReasoningItem | ResponseOutputMessage | ResponseFunctionToolCall | null = null;
|
let currentItem: ResponseReasoningItem | ResponseOutputMessage | ResponseFunctionToolCall | null = null;
|
||||||
|
|
|
||||||
|
|
@ -625,6 +625,60 @@ describe("Generate E2E Tests", () => {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
describe.skipIf(!process.env.AI_GATEWAY_API_KEY)(
|
||||||
|
"Vercel AI Gateway Provider (anthropic/claude-opus-4.5 via Anthropic Messages)",
|
||||||
|
() => {
|
||||||
|
const llm = getModel("vercel-ai-gateway", "anthropic/claude-opus-4.5");
|
||||||
|
|
||||||
|
it("should complete basic text generation", { retry: 3 }, async () => {
|
||||||
|
await basicTextGeneration(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle tool calling", { retry: 3 }, async () => {
|
||||||
|
await handleToolCall(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle streaming", { retry: 3 }, async () => {
|
||||||
|
await handleStreaming(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle image input", { retry: 3 }, async () => {
|
||||||
|
await handleImage(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle multi-turn with tools", { retry: 3 }, async () => {
|
||||||
|
await multiTurn(llm);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
describe.skipIf(!process.env.AI_GATEWAY_API_KEY)(
|
||||||
|
"Vercel AI Gateway Provider (openai/gpt-5.1-codex-max via Anthropic Messages)",
|
||||||
|
() => {
|
||||||
|
const llm = getModel("vercel-ai-gateway", "openai/gpt-5.1-codex-max");
|
||||||
|
|
||||||
|
it("should complete basic text generation", { retry: 3 }, async () => {
|
||||||
|
await basicTextGeneration(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle tool calling", { retry: 3 }, async () => {
|
||||||
|
await handleToolCall(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle streaming", { retry: 3 }, async () => {
|
||||||
|
await handleStreaming(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle image input", { retry: 3 }, async () => {
|
||||||
|
await handleImage(llm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle multi-turn with tools", { retry: 3 }, async () => {
|
||||||
|
await multiTurn(llm);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
describe.skipIf(!process.env.ZAI_API_KEY)("zAI Provider (glm-4.5-air via OpenAI Completions)", () => {
|
describe.skipIf(!process.env.ZAI_API_KEY)("zAI Provider (glm-4.5-air via OpenAI Completions)", () => {
|
||||||
const llm = getModel("zai", "glm-4.5-air");
|
const llm = getModel("zai", "glm-4.5-air");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue