morphic icon indicating copy to clipboard operation
morphic copied to clipboard

Add support for Claude 3 Opus/Hike models with streaming API

Open miurla opened this issue 2 years ago • 5 comments

Currently, the AI SDK includes a provider for Claude 3 models with tool use support. However, the streaming API for these models is not yet available. To fully integrate Claude 3 Opus/Hike models into our application, we need to wait for an update from the AI provider that includes streaming API support.

Once the streaming API is available, we will need to update our implementation to utilize the new functionality. This will allow us to provide a seamless user experience with real-time updates and faster response times when using Claude 3 Opus/Hike models.

References: Claude/Tool use Vercel AI SDK/Claude

miurla avatar Apr 08 '24 14:04 miurla

I am using openrouter.ai, so if it can support custom the baseUrl and model, then we can use Claude Haiku, or any other LLM models that supported by openrouter.ai The openrouter.ai build the API compatible with OpenAI.

pjq avatar Apr 10 '24 15:04 pjq

If we can add LLM_MODEL=, then will be great

# Used to set the base URL path for OpenAI API requests.The default value is https://api.openai.com/v1
OPENAI_API_BASE=
# OpenAI API key retrieved here: https://platform.openai.com/api-keys
OPENAI_API_KEY=

# Tavily API Key retrieved here: https://app.tavily.com/home
TAVILY_API_KEY=

pjq avatar Apr 10 '24 15:04 pjq

streaming tool calls: https://github.com/vercel/ai/releases/tag/%40ai-sdk%2Fanthropic%400.0.14

miurla avatar May 17 '24 11:05 miurla

ready: https://sdk.vercel.ai/providers/ai-sdk-providers/anthropic

miurla avatar May 18 '24 06:05 miurla

I tried it, but some agents are causing errors.

query-suggestor

APICallError [AI_APICallError]: messages: text content blocks must be non-empty

researcher

APICallError [AI_APICallError]: messages: text content blocks must be non-empty

miurla avatar May 19 '24 11:05 miurla

PR: #239

miurla avatar Jun 22 '24 00:06 miurla