Skip to content

How can I invoke a tool and continue chatting without calling addToolResult using useChat? #4432

Answered by brennanmceachran
MarkLyck asked this question in Help
Discussion options

You must be logged in to vote

What is the reasoning behind not allowing further chatting if a tool has been called but doesn't have a result yet? Or forcing a tool to send a result?

It's a strict limitation in the LLMs. OpenAI, for example, will error directly if a result is not returned before generating the next message. Tool calls are sort of pre-requisites functions for the ai to respond.

You could get around this by filtering/editing the message history prior to sending to LLMs. But that's not a great way around the problem, imo.

I could try adding more instructions in the initial prompt to not claim a task for a tool with "display" in the name was completed. But it still feels iffy... It's not very determinis…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@MarkLyck
Comment options

@brennanmceachran
Comment options

@MarkLyck
Comment options

@brennanmceachran
Comment options

Answer selected by MarkLyck
@MarkLyck
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants