Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support streamText's maxSteps for generateObject and streamObject #3851

Open
ducan-ne opened this issue Nov 23, 2024 · 5 comments
Open

Support streamText's maxSteps for generateObject and streamObject #3851

ducan-ne opened this issue Nov 23, 2024 · 5 comments
Labels
ai/core enhancement New feature or request

Comments

@ducan-ne
Copy link

Feature Description

Is it possible to support maxSteps for generateObject?

Use Cases

Same as streamText, but I want json return as the result

Additional context

No response

@ducan-ne ducan-ne added the enhancement New feature or request label Nov 23, 2024
@lgrammel
Copy link
Collaborator

We have added a experimental_output feature to generateText that allows you to create structured information while calling (openai) tools.

https://sdk.vercel.ai/docs/ai-sdk-core/generating-structured-data#structured-output-with-generatetext

@ducan-ne
Copy link
Author

Hi @lgrammel , I'm curious if this is working with streamText as well?

@lgrammel
Copy link
Collaborator

Not at this point. I'll re-open for streamText

@lgrammel lgrammel reopened this Nov 26, 2024
@ducan-ne
Copy link
Author

ducan-ne commented Nov 26, 2024

Good to know, in my use case generateText is enough, but streamText looks good too

By the way, I think it would be better if we had an 'onObject' or something similar that calls that method when there's an object extracted in the conversation (though I think it's likely a new feature since generating objects in steps doesn't seem technically possible with just the core), eg extracted objects from tool's output

@SamyPesse
Copy link

Does it mean that the plan is not to support tools in streamObject, but instead we'll have to use streamText + experiment_output + tools?

On our side, we have the need to combine streaming + tools + JSON structured output. Right now, it looks like there is no solution for it with the ai SDK, and the only way to do this is to use the OpenAI library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants