Skip to content

fix(web-llm): type requestOptions & fix providerOptions key lookup#161

Merged
jakobhoeg merged 2 commits intomainfrom
fix/request-options
Mar 3, 2026
Merged

fix(web-llm): type requestOptions & fix providerOptions key lookup#161
jakobhoeg merged 2 commits intomainfrom
fix/request-options

Conversation

@jakobhoeg
Copy link
Owner

@jakobhoeg jakobhoeg commented Mar 3, 2026

  • Type safety: requestOptions in getArgs() is now typed as ChatCompletionRequestNonStreaming (from @mlc-ai/web-llm), restoring full type-checking on the request object.

  • Bug: providerOptions?.extra_body was accessing the top-level key directly, but the AI SDK v6 namespaces provider options by provider ID. Fixed to providerOptions?.[this.provider]?.extra_body.

Also added a test asserting that extra_body values passed via providerOptions["web-llm"] are forwarded to completions.create

@vercel
Copy link

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
built-in-ai Ready Ready Preview, Comment Mar 3, 2026 6:43pm

Request Review

@jakobhoeg jakobhoeg merged commit 72b741c into main Mar 3, 2026
7 checks passed
@jakobhoeg jakobhoeg deleted the fix/request-options branch March 3, 2026 18:45
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