We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57b6505 commit f7e9d02Copy full SHA for f7e9d02
src/helpers/aiSdkUtils.ts
@@ -272,13 +272,20 @@ export async function fetchResponseFromModelAnthropic(
272
],
273
});
274
}
275
- const completion = await anthropic.messages.create({
276
- model,
277
- system: params.systemMessage,
278
- messages,
279
- max_tokens: 1000,
280
- temperature: 0,
281
- });
+ const completion = await anthropic.messages.create(
+ {
+ model,
+ system: params.systemMessage,
+ messages,
+ max_tokens: 1000,
+ temperature: 0,
282
+ },
283
284
+ headers: {
285
+ "anthropic-dangerous-direct-browser-access": "true",
286
287
288
+ );
289
let rawResponse = completion.content[0].text.trim();
290
if (params.jsonMode && !rawResponse.startsWith("{")) {
291
rawResponse = "{" + rawResponse;
0 commit comments