Allow passing custom provider options to opencode run#3497
Closed
AurelienRibon wants to merge 2 commits into
Closed
Allow passing custom provider options to opencode run#3497AurelienRibon wants to merge 2 commits into
opencode run#3497AurelienRibon wants to merge 2 commits into
Conversation
Collaborator
|
I feel like this is a bit messy, you can also solve this currently using Neither of these are great tbh but passing json through args feels messy and if peeople want to do that advanced behavior they could use the existing flag |
Contributor
Author
|
Thanks, I was not aware of this flag. And I see it's doing a |
Collaborator
|
I think the same thing applies for the timeout one too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to provide users of
opencode runthe flexibility to set and use every possible provider option proposed by the AI SDK.This is a compromise with #3475, in which I proposed a dedicated argument for an openai-specific property.
This new approach is more technical (users need to check with Vercel docs for what is available), but has the large advantage to deport the maintenance from opencode devs to vercel devs:
Of course, dedicated arguments for important parameters will always be welcome, but at least now there will always be a workaround for missing arguments.
Does it work?
The best way to check that is to pass an invalid value and see if Vercel's AI SDK shows the correct error.
Here I tested it with
reasoningEffortfor openai models.Note
Aiden, of course this is a proposal, feel free to discard it if that's not the way Opencode wants to go.