Skip to content

Usage of tools fails - RAG chatbot example #4226

Closed Answered by pavelsvitek
pavelsvitek asked this question in Help
Discussion options

You must be logged in to vote

Funnily enough, it works much better today after upgrading to "ai": "^4.0.22",

  • gpt-4o ✅
  • gpt-4o-mini ✅
  • gemini-1.5-flash-latest ❌
  • gemini-1.5-pro-latest ✅

Additional important note
When using streamText() one has to set maxSteps: <int> in useChat() call which sends the tool results back to API.

When using generateText({ maxSteps: <int> }) on server, this acts as agent and it loops the tool results directly on server.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pavelsvitek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant