From 29071540b051a7a6db2b7986bc544debde82298a Mon Sep 17 00:00:00 2001 From: Peter Salas Date: Wed, 10 Apr 2024 13:44:17 -0700 Subject: [PATCH] Fix double Anthropic requests (#543) #541 accidentally caused anthropic requests to be sent twice. --- packages/ai-jsx/package.json | 2 +- packages/ai-jsx/src/lib/anthropic.tsx | 2 +- packages/docs/docs/changelog.md | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/ai-jsx/package.json b/packages/ai-jsx/package.json index 3cd66eb9..4d94cd1b 100644 --- a/packages/ai-jsx/package.json +++ b/packages/ai-jsx/package.json @@ -4,7 +4,7 @@ "repository": "fixie-ai/ai-jsx", "bugs": "https://github.com/fixie-ai/ai-jsx/issues", "homepage": "https://ai-jsx.com", - "version": "0.30.1", + "version": "0.30.2", "volta": { "extends": "../../package.json" }, diff --git a/packages/ai-jsx/src/lib/anthropic.tsx b/packages/ai-jsx/src/lib/anthropic.tsx index 80c019ed..38043e0a 100644 --- a/packages/ai-jsx/src/lib/anthropic.tsx +++ b/packages/ai-jsx/src/lib/anthropic.tsx @@ -340,7 +340,7 @@ export async function* AnthropicChatModel( const responsePromise = anthropic.messages.create(anthropicCompletionRequest); let response: Awaited; try { - response = await anthropic.messages.create(anthropicCompletionRequest); + response = await responsePromise; } catch (err) { if (err instanceof AnthropicSDK.APIError) { throw new AIJSXError( diff --git a/packages/docs/docs/changelog.md b/packages/docs/docs/changelog.md index c7da786e..5c5678c1 100644 --- a/packages/docs/docs/changelog.md +++ b/packages/docs/docs/changelog.md @@ -1,6 +1,10 @@ # Changelog -## 0.30.1 +## 0.30.2 + +- Fix double Anthropic requests + +## [0.30.1](https://github.com/fixie-ai/ai-jsx/tree/7d7ca5987b638969478940a779dededdbe1abbfb) - Add new OpenAI models