Git Product home page Git Product logo

Comments (11)

miguelvictor avatar miguelvictor commented on July 24, 2024 1

I also have this issue but the weird thing about mine is the same tool is being called twice.

from ai.

camwest avatar camwest commented on July 24, 2024

It looks like this hardcoded "true" is where the error is happening.

It's a bad assumption. The tool-call event doesn't immediately mean it's the last render call because there may be multiple tool-call events.

from ai.

camwest avatar camwest commented on July 24, 2024

A potential fix would be to add a 'all-tool-calls-done' event which gets pushed to stream after the loop right around here:

Then we handle that in stream-ui and finalize the stream there.

The challenge is we'd have to update anything that implements LanguageModelV1 to trigger this event, or version to V2.

from ai.

camwest avatar camwest commented on July 24, 2024

Another option is to close the stream on finish:

flush(controller) {
controller.enqueue({
type: 'finish',
finishReason,
logprobs,
usage,
});

Currently not implemented in streamUI:

// Nothing to do here.

from ai.

bneigher avatar bneigher commented on July 24, 2024

ah this is the culprit of my issue! been doing this since v3.1.25

from ai.

camwest avatar camwest commented on July 24, 2024

@mfclarke-cnx can you change this to a bug instead of enhancement?

from ai.

mfclarke-cnx avatar mfclarke-cnx commented on July 24, 2024

@camwest unfortunately I don't have permissions to change the labels. @lgrammel would you be able to update labels please?

from ai.

gclark-eightfold avatar gclark-eightfold commented on July 24, 2024

As tagged by @bneigher, I have an approach I'm working on in #1904, but it's still a WIP.

Main issue I have right now is that because we don't know how many tool calls will be made ahead of time, the parent "streamableUI" doesn't call .done until all tool calls complete.

I think my expectation is that the UI will be added to as the final tool calls stream in.

from ai.

camwest avatar camwest commented on July 24, 2024

Main issue I have right now is that because we don't know how many tool calls will be made ahead of time, the parent "streamableUI" doesn't call .done until all tool calls complete.

I think you can get this information at the provider level.

For example the OpenAI provider passes an array of tool_calls so you know when you're finished iterating that it's 'done'

from ai.

HECHONG999 avatar HECHONG999 commented on July 24, 2024

"Parallel support, how to resolve the 'done' error bug now."

from ai.

dutsik-p avatar dutsik-p commented on July 24, 2024

Maybe anybody knows how to tune the prompt so the model doesnot put number of tools to call at the same time?

from ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.