Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(topics): enable sonnet 5.5. cluster naming (#18895)

Nimar0690d7d268c4
diff --git a/packages/shared/package.json b/packages/shared/package.json
index ec91a617e6..037ce4e650 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -217,7 +217,7 @@
"dependencies": {
"@ag-ui/client": "^0.0.52",
"@ag-ui/core": "^0.0.52",
- "@ai-sdk/amazon-bedrock": "^5.0.97",
+ "@ai-sdk/amazon-bedrock": "^5.0.99",
"@ai-sdk/anthropic": "^4.0.5",
"@ai-sdk/azure": "^4.0.5",
"@ai-sdk/google": "^4.0.6",
diff --git a/packages/shared/src/server/topics/text.test.ts b/packages/shared/src/server/topics/text.test.ts
index 981abe48df..90c9d8f56c 100644
--- a/packages/shared/src/server/topics/text.test.ts
+++ b/packages/shared/src/server/topics/text.test.ts
@@ -97,6 +97,63 @@ function bedrockModel(slot: TopicsModel["slot"], model: string): TopicsModel {
}
describe("generateTopicText", () => {
+ it("clusters with Bedrock Sonnet 5.5 without forcing tool use", async () => {
+ const output = { name: "Account access" };
+ const fetch = vi.fn<typeof globalThis.fetch>(async (...args) => {
+ const body = (await new Request(...args).json()) as {
+ toolConfig?: { toolChoice?: Record<string, unknown> };
+ };
+ if (
+ body.toolConfig?.toolChoice?.any ||
+ body.toolConfig?.toolChoice?.tool
+ ) {
+ return Response.json(
+ {
+ message:
+ 'tool_choice: type "tool" and "any" are not supported for this model.',
+ },
+ { status: 400 },
+ );
+ }
+ return Response.json({
+ output: {
+ message: {
+ role: "assistant",
+ content: [{ text: JSON.stringify(output) }],
+ },
+ },
+ stopReason: "end_turn",
+ usage: { inputTokens: 12, outputTokens: 4, totalTokens: 16 },
+ metrics: { latencyMs: 1 },
+ });
+ });
+ vi.stubGlobal("fetch", fetch);
+
+ const result = await generateTopicText({
+ model: bedrockModel("clustering", "us.anthropic.claude-sonnet-5-5"),
+ system: [{ text: "Name the topic." }],
+ input: "Users cannot sign in.",
+ schema: z.object({ name: z.string() }),
+ maxOutputTokens: 256,
+ });
+
+ expect(fetch).toHaveBeenCalledTimes(1);
+ const body = await new Request(...fetch.mock.calls[0]).json();
+ expect(body).not.toHaveProperty("toolConfig");
+ expect(body).not.toHaveProperty(
+ "additionalModelRequestFields.thinking.type",
+ "disabled",
+ );
+ expect(body).toHaveProperty(
+ "system",
+ expect.arrayContaining([
+ expect.objectContaining({ text: expect.stringContaining('"name"') }),
+ ]),
+ );
+ expect(result.output).toEqual(output);
+ expect(result.usage).toMatchObject({ inputTokens: 12, outputTokens: 4 });
+ });
+
it.each(["us.openai.gpt-6-luna", "openai.gpt-oss-120b"])(
"sends structured output through the project's Bedrock connection: %s",
async (modelId) => {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c4480718f7..effbe39627 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -283,11 +283,11 @@ importers:
specifier: ^0.0.52
version: 0.0.52
'@ai-sdk/amazon-bedrock':
- specifier: ^5.0.97
- version: 5.0.97([email protected])
+ specifier: ^5.0.99
+ version: 5.0.99([email protected])
'@ai-sdk/anthropic':
specifier: ^4.0.5
- version: 4.0.65([email protected])
+ version: 4.0.67([email protected])
'@ai-sdk/azure':
specifier: ^4.0.5
version: 4.0.5([email protected])
@@ -1338,8 +1338,8 @@ packages:
peerDependencies:
zod: 4.3.6
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-me8WEbCimP2f1yKuGvS0MSDiaqptdBeOs66dedJheNSWRCgIyqaaXL9k3lFKb0D6fMIn98NzpHB4tbHJFAzSXA==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-CdsTGgRAAv1VUyM2MdbBexGgLv+Uhper5Y6KsYh3zjK0R0b0tY9knCD2V8JQc0kuqsyxrokAimOH9tFvTcC97A==}
engines: {node: '>=22'}
peerDependencies:
zod: 4.3.6
@@ -1362,8 +1362,8 @@ packages:
peerDependencies:
zod: 4.3.6
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-3fmxxn5xWGOPU1wGrUCI30YFW5r6h2WrY+sz3rokkVlBHrDr889hPYP1yNoSmOVvtAwCFWlm79P2lRngIPOObg==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-fEXJwsIGmpZ2KBBYY8OsQD9lvKsIct4xwPo8SSJQ9ymo9QNW1Q4boCUtmvr9kB0NZUtryKpn1VwuETgZjwE54A==}
engines: {node: '>=22'}
peerDependencies:
zod: 4.3.6
@@ -1440,8 +1440,8 @@ packages:
peerDependencies:
zod: 4.3.6
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-S9WLSZUqebRjZbwYM8uorb4fsjo4Lhz/PGA3rWl01x88WeF/1PdHtNckcxqNZy5xMRzCHPVv9iA3F+ckV74zfA==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-uqRlbxy04WhRuLd5dJUYFbpeKfN5Hn/d/K/fmYswbJq6RhuWdWCRoEmuLpFTpdqku9OSQGMerXMVZQi5Ou8/7Q==}
engines: {node: '>=22'}
peerDependencies:
zod: 4.3.6
@@ -1488,8 +1488,8 @@ packages:
peerDependencies:
zod: 4.3.6
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-T+/H8DCvqJoCqLhltVatS7ffA779Iyk/ZZrgNXkrgv51E0n2Cd6eIdCmtwhCGIKqtbTtwCvTmQdAMv5Z8rOGHQ==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-qg2LutM5RlUT/tuuFf+VkhFGNZ2sEJHL0oDIrFN/sMoVbDBANglqtGCJUOnBqGMoFBH8IfAXMrFZvbFWx4dMOg==}
engines: {node: '>=22'}
peerDependencies:
zod: 4.3.6
@@ -1536,8 +1536,8 @@ packages:
resolution: {integrity: sha512-VYMBxIQdcHqbIf1j+YZlI9Ati6LZ4wJe0GGd4z4a5H/KxTggjeOiyaVYTnfF7LHZK5jMQ+rofmzz4QPqf++NUw==}
engines: {node: '>=22'}
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-+GZJIgz1jk86pwEbb3f1BD2bdoSKyWE4Jg4YUc7NMnMozbWemSKYZcw2F4nMaO5qwsL5A8RmioAKW81YktRpIQ==}
+ '@ai-sdk/[email protected]':
+ resolution: {integrity: sha512-ryVZSSfmpEsr4bM8rbt9cSBWal+KGYRrm57C+k/hiPQHMiMahaqg2bPF0MpxSUWY8mGpt7s/ajM6PAqNTMKqPQ==}
engines: {node: '>=22'}
'@ai-sdk/[email protected]':
@@ -12748,12 +12748,12 @@ snapshots:
aws4fetch: 1.0.20
zod: 4.3.6
dependencies:
- '@ai-sdk/anthropic': 4.0.65([email protected])
- '@ai-sdk/openai': 4.0.78([email protected])
- '@ai-sdk/provider': 4.0.18
- '@ai-sdk/provider-utils': 5.0.49([email protected])
+ '@ai-sdk/anthropic': 4.0.67([email protected])
+ '@ai-sdk/openai': 4.0.79([email protected])
+ '@ai-sdk/provider': 4.0.19
+ '@ai-sdk/provider-utils': 5.0.50([email protected])
'@smithy/eventstream-codec': 4.4.14
'@smithy/util-utf8': 4.4.14
aws4fetch: 1.0.20
@@ -12777,10 +12777,10 @@ snapshots:
'@ai-sdk/provider-utils': 5.0.3([email protected])
zod: 4.3.6
dependencies:
- '@ai-sdk/provider': 4.0.18
- '@ai-sdk/provider-utils': 5.0.49([email protected])
+ '@ai-sdk/provider': 4.0.19
+ '@ai-sdk/provider-utils': 5.0.50([email protected])
zod: 4.3.6
@@ -12871,10 +12871,10 @@ snapshots:
'@ai-sdk/provider-utils': 5.0.3([email protected])
zod: 4.3.6
dependencies:
- '@ai-sdk/provider': 4.0.18
- '@ai-sdk/provider-utils': 5.0.49([email protected])
+ '@ai-sdk/provider': 4.0.19
+ '@ai-sdk/provider-utils': 5.0.50([email protected])
zod: 4.3.6
@@ -12929,9 +12929,9 @@ snapshots:
undici: 7.29.1
zod: 4.3.6
dependencies:
- '@ai-sdk/provider': 4.0.18
+ '@ai-sdk/provider': 4.0.19
'@standard-schema/spec': 1.1.0
'@workflow/serde': 4.1.0
eventsource-parser: 3.1.0
@@ -12983,7 +12983,7 @@ snapshots:
dependencies:
json-schema: 0.4.0
- '@ai-sdk/[email protected]':
+ '@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0