Skip to content

Replace params: Any in stream/generate with generalized types#150

Draft
elprans wants to merge 1 commit into
mainfrom
elprans/typify-inference-params
Draft

Replace params: Any in stream/generate with generalized types#150
elprans wants to merge 1 commit into
mainfrom
elprans/typify-inference-params

Conversation

@elprans
Copy link
Copy Markdown
Collaborator

@elprans elprans commented May 22, 2026

Using params: Any for the typing of inference parameters is not great,
because discoverability and validation. Even though the variability in
upstream provider configuration shapes is great, the overlap in
common functionality is big enough to warrant ascribing it in common
types and concepts.

In addition to common parameters, add a provider-specific options
section as well as generic extra_headers/extra_query/extra_body
escape hatch to drop to untyped underlying API level.

Using `params: Any` for the typing of inference parameters is not great,
because discoverability and validation.  Even though the variability in
upstream provider configuration shapes is great, the overlap in
common functionality is big enough to warrant ascribing it in common
types and concepts.

In addition to common parameters, add a provider-specific options
section as well as generic `extra_headers`/`extra_query`/`extra_body`
escape hatch to drop to untyped underlying API level.
@elprans elprans requested review from 1st1, anbuzin and msullivan May 22, 2026 16:50
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-python Ready Ready Preview, Comment May 22, 2026 4:51pm

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​anthropic@​0.83.0 ⏵ 0.103.191 -4100100100100
Updatedpypi/​openai@​2.14.0 ⏵ 2.37.096 +1100100100100

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant