Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 13 additions & 34 deletions e2e/scenarios/anthropic-instrumentation/scenario.impl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ const WEATHER_TOOL = {

async function runAnthropicInstrumentationScenario(
Anthropic,
{
decorateClient,
useBetaMessages = true,
useMessagesStreamHelper = true,
supportsThinking = false,
} = {},
{ decorateClient, useBetaMessages = true, supportsThinking = false } = {},
) {
const imageBase64 = (
await readFile(new URL("./test-image.png", import.meta.url))
Expand Down Expand Up @@ -124,33 +119,18 @@ async function runAnthropicInstrumentationScenario(
"anthropic-stream-with-response-operation",
"stream-with-response",
async () => {
const stream =
useMessagesStreamHelper === false
? await client.messages.create({
model: ANTHROPIC_MODEL,
max_tokens: 32,
temperature: 0,
stream: true,
messages: [
{
role: "user",
content:
"Count from 1 to 3 and include the words one two three.",
},
],
})
: client.messages.stream({
model: ANTHROPIC_MODEL,
max_tokens: 32,
temperature: 0,
messages: [
{
role: "user",
content:
"Count from 1 to 3 and include the words one two three.",
},
],
});
const stream = client.messages.stream({
model: ANTHROPIC_MODEL,
max_tokens: 32,
temperature: 0,
messages: [
{
role: "user",
content:
"Count from 1 to 3 and include the words one two three.",
},
],
});
await collectAsync(stream);
},
);
Expand Down Expand Up @@ -278,7 +258,6 @@ export async function runWrappedAnthropicInstrumentation(Anthropic, options) {
export async function runAutoAnthropicInstrumentation(Anthropic, options) {
await runAnthropicInstrumentationScenario(Anthropic, {
...options,
useMessagesStreamHelper: false,
});
}

Expand Down
Loading