Skip to content

Commit 42e13b5

Browse files
committed
fix: tests
1 parent e382bcb commit 42e13b5

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

src/backend/drivers/ai-chat/providers/together/TogetherAIProvider.integration.test.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020
/**
2121
* Integration test for the Together AI provider.
2222
*
23-
* Uses `Llama-3.3-70B-Instruct-Turbo-Free` — Together's free
24-
* serverless tier (rate-limited, $0/req). Together churns its
25-
* serverless model list aggressively; if this one disappears, the
26-
* provider's lookup will silently fall back to its default and the
27-
* upstream API will return `model_not_available`. When that happens,
28-
* pick a different live serverless model from
29-
* https://api.together.ai/models?type=serverless. Skipped when
30-
* `PUTER_TEST_AI_TOGETHER_API_KEY` is unset.
23+
* Uses `Qwen/Qwen2.5-7B-Instruct-Turbo` — non-Llama, small, cheap, and
24+
* stays on Together's serverless tier. Llama variants on Together get
25+
* rotated to dedicated endpoints often enough that they're not safe
26+
* defaults. If Qwen also disappears, pick another live serverless
27+
* model from https://api.together.ai/models?type=serverless. Skipped
28+
* when `PUTER_TEST_AI_TOGETHER_API_KEY` is unset.
3129
*/
3230

3331
import { describe, expect, it } from 'vitest';
@@ -45,15 +43,15 @@ const ENV_VAR = 'PUTER_TEST_AI_TOGETHER_API_KEY';
4543
describe.skipIf(skipUnlessEnv(ENV_VAR))(
4644
'TogetherAIProvider (integration)',
4745
() => {
48-
it('returns a non-empty completion from Llama 3.3 70B free', { timeout: INTEGRATION_TEST_TIMEOUT_MS }, async () => {
46+
it('returns a non-empty completion from Qwen2.5 7B', { timeout: INTEGRATION_TEST_TIMEOUT_MS }, async () => {
4947
const provider = new TogetherAIProvider(
5048
{ apiKey: optionalEnv(ENV_VAR)! },
5149
makeMeteringStub(),
5250
);
5351

5452
const result = await withTestActor(() =>
5553
provider.complete({
56-
model: 'togetherai:meta-llama/Llama-3.3-70B-Instruct-Turbo-Free',
54+
model: 'togetherai:Qwen/Qwen2.5-7B-Instruct-Turbo',
5755
messages: [
5856
{ role: 'user', content: 'Say hi in one word.' },
5957
],

src/backend/drivers/ai-chat/providers/zai/ZAIProvider.integration.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
/**
2121
* Integration test for the Z.AI (GLM) provider.
2222
*
23-
* Uses `glm-4.7-flashx` — the cheapest text variant on the price
24-
* sheet. Skipped when `PUTER_TEST_AI_ZAI_API_KEY` is unset.
23+
* Uses `glm-4.6` with `thinking: disabled` passed through `custom`.
24+
* GLM models default to reasoning mode and route their tokens to a
25+
* `reasoning_content` field, leaving `content` empty under tight
26+
* budgets. Disabling thinking forces a plain text response so the
27+
* usual `message.content` assertion works. Skipped when
28+
* `PUTER_TEST_AI_ZAI_API_KEY` is unset.
2529
*/
2630

2731
import { describe, expect, it } from 'vitest';
@@ -37,17 +41,18 @@ import { ZAIProvider } from './ZAIProvider.js';
3741
const ENV_VAR = 'PUTER_TEST_AI_ZAI_API_KEY';
3842

3943
describe.skipIf(skipUnlessEnv(ENV_VAR))('ZAIProvider (integration)', () => {
40-
it('returns a non-empty completion from glm-4.7-flashx', { timeout: INTEGRATION_TEST_TIMEOUT_MS }, async () => {
44+
it('returns a non-empty completion from glm-4.6', { timeout: INTEGRATION_TEST_TIMEOUT_MS }, async () => {
4145
const provider = new ZAIProvider(
4246
{ apiKey: optionalEnv(ENV_VAR)! },
4347
makeMeteringStub(),
4448
);
4549

4650
const result = await withTestActor(() =>
4751
provider.complete({
48-
model: 'glm-4.7-flashx',
52+
model: 'glm-4.6',
4953
messages: [{ role: 'user', content: 'Say hi in one word.' }],
5054
max_tokens: 16,
55+
custom: { thinking: { type: 'disabled' } },
5156
}),
5257
);
5358

0 commit comments

Comments
 (0)