Helicone Community Page

Updated 3 months ago

Error using Helicone with the Claude 3 + streaming

When streaming responses from Claude 3 using the Anthropic Typescript SDK, after several tokens, I get an error:

Plain Text
Could not parse message into JSON: 
From chunk: [ 'event: content_block_delta' ]
 ⨯ Error: failed to pipe response


This error doesn't happen if I go directly to Anthropic's API by omitting the baseURL and defaultHeaders in the client constructor:

``function getAnthropic() { return new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY, // baseURL: 'https://anthropic.hconeai.com/', // defaultHeaders: { // 'Helicone-Auth': Bearer ${process.env.ANTHROPIC_API_KEY}`,
// },
});
}
a
J
a
4 comments
Thanks for flagging this!! The team will look into this first thing this morning and update you when we have a fix
hi this should be fixed with the latest version of anthropic. see https://github.com/anthropics/anthropic-sdk-typescript/issues/318
Just updated to 0.17.1 and it works! Thanks
Add a reply
Sign up and join the conversation on Discord