chore(ai): format bedrock thinking payload test
This commit is contained in:
@@ -130,16 +130,20 @@ describe("Application inference profile support", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let capturedPayload: any;
|
let capturedPayload: any;
|
||||||
const s = streamBedrock(model, {
|
const s = streamBedrock(
|
||||||
systemPrompt: "You are helpful.",
|
model,
|
||||||
messages: [{ role: "user", content: "Hello", timestamp: Date.now() }],
|
{
|
||||||
}, {
|
systemPrompt: "You are helpful.",
|
||||||
signal: AbortSignal.abort(),
|
messages: [{ role: "user", content: "Hello", timestamp: Date.now() }],
|
||||||
onPayload: (payload) => {
|
|
||||||
capturedPayload = payload;
|
|
||||||
return payload;
|
|
||||||
},
|
},
|
||||||
});
|
{
|
||||||
|
signal: AbortSignal.abort(),
|
||||||
|
onPayload: (payload) => {
|
||||||
|
capturedPayload = payload;
|
||||||
|
return payload;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
for await (const event of s) {
|
for await (const event of s) {
|
||||||
if (event.type === "error") break;
|
if (event.type === "error") break;
|
||||||
@@ -165,7 +169,10 @@ messages: [{ role: "user", content: "Hello", timestamp: Date.now() }],
|
|||||||
|
|
||||||
const payload = await capturePayload(model);
|
const payload = await capturePayload(model);
|
||||||
|
|
||||||
expect(payload.additionalModelRequestFields?.thinking).toMatchObject({ type: "enabled", budget_tokens: expect.any(Number) });
|
expect(payload.additionalModelRequestFields?.thinking).toMatchObject({
|
||||||
|
type: "enabled",
|
||||||
|
budget_tokens: expect.any(Number),
|
||||||
|
});
|
||||||
expect(payload.additionalModelRequestFields?.anthropic_beta).toEqual(["interleaved-thinking-2025-05-14"]);
|
expect(payload.additionalModelRequestFields?.anthropic_beta).toEqual(["interleaved-thinking-2025-05-14"]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user