Skip to content

fix(ai): infer provider options for media activities#858

Open
AdemBenAbdallah wants to merge 1 commit into
TanStack:mainfrom
AdemBenAbdallah:fix/provider-options-extraction-593
Open

fix(ai): infer provider options for media activities#858
AdemBenAbdallah wants to merge 1 commit into
TanStack:mainfrom
AdemBenAbdallah:fix/provider-options-extraction-593

Conversation

@AdemBenAbdallah

@AdemBenAbdallah AdemBenAbdallah commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #593.

Summary

  • Use structural ~types.providerOptions inference for TTS, transcription, and summarize provider options.
  • Keep summarize's public adapter constraint broad enough to support runtime-selected adapter unions, while still deriving modelOptions from the selected adapter's ~types metadata.
  • Add a patch changeset for @tanstack/ai.

Validation

  • pnpm --filter @tanstack/ai test:types
  • pnpm --filter @tanstack/ai test:build
  • pnpm test:sherif
  • pnpm test:knip
  • pnpm test:kiira

Release impact

  • Patch changeset included for @tanstack/ai.

Summary by CodeRabbit

  • Bug Fixes
    • Improved provider-specific providerOptions inference for speech, transcription, and summarization based on adapter-provided type metadata.
    • Updated exported provider option types to more accurately reflect adapter configuration, improving compatibility for consumer code.
  • Chores
    • Marked this release for @tanstack/ai as a patch update.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d61e35b4-821f-43c3-a780-ecc50e41781f

📥 Commits

Reviewing files that changed from the base of the PR and between 4154021 and 563cbf0.

📒 Files selected for processing (4)
  • .changeset/soft-falcons-summarize.md
  • packages/ai/src/activities/generateSpeech/index.ts
  • packages/ai/src/activities/generateTranscription/index.ts
  • packages/ai/src/activities/summarize/index.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/soft-falcons-summarize.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/ai/src/activities/generateTranscription/index.ts
  • packages/ai/src/activities/generateSpeech/index.ts
  • packages/ai/src/activities/summarize/index.ts

📝 Walkthrough

Walkthrough

This PR updates provider-options inference for TTS, transcription, and summarize activities to derive providerOptions from adapter ~types metadata. Summarize also updates its related type assertions. A changeset records the patch release.

Changes

Provider-options inference fix

Layer / File(s) Summary
Speech and transcription helpers
.changeset/soft-falcons-summarize.md, packages/ai/src/activities/generateSpeech/index.ts, packages/ai/src/activities/generateTranscription/index.ts
TTSProviderOptions and TranscriptionProviderOptions now infer providerOptions from adapter ~types metadata with structural conditionals, and the changeset notes the patch release.
Summarize typing
packages/ai/src/activities/summarize/index.ts
SummarizeProviderOptions now infers providerOptions from adapter metadata, and the summarize branches update their type assertions to use SummarizeActivityOptions<TAdapter, true/false>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • TanStack/ai#854: Also changes summarize() adapter typing, so it touches the same SummarizeProviderOptions path.

Suggested reviewers

  • AlemTuzlak

Poem

A rabbit hopped through type-safe grass,
and brand-based options now can pass.
TTS hums, transcription sings,
summarize keeps its tidy wings. 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is clear, but it doesn't follow the required template sections or checklist items from the repository. Rewrite it to match the template: add 🎯 Changes, ✅ Checklist, and 🚀 Release Impact sections with the required checkboxes.
Linked Issues check ⚠️ Warning TTS and transcription match the issue, but summarize's F-bounded SummarizeAdapter<string, ...> constraint appears unaddressed. Update summarize's public constraints to extends SummarizeAdapter<string, SummarizeProviderOptions<TAdapter>> at all affected signatures.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: inferring provider options for media activities.
Out of Scope Changes check ✅ Passed The changes stay within the requested provider-option inference fix and the required changeset update.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tombeckenham

Copy link
Copy Markdown
Contributor

Niice. There's a couple of PRs to merge before this, but thanks

@nx-cloud

nx-cloud Bot commented Jun 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 6f16b37

Command Status Duration Result
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 1m 24s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-26 10:05:16 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/@tanstack/ai@858

@tanstack/ai-angular

npm i https://pkg.pr.new/@tanstack/ai-angular@858

@tanstack/ai-anthropic

npm i https://pkg.pr.new/@tanstack/ai-anthropic@858

@tanstack/ai-client

npm i https://pkg.pr.new/@tanstack/ai-client@858

@tanstack/ai-code-mode

npm i https://pkg.pr.new/@tanstack/ai-code-mode@858

@tanstack/ai-code-mode-skills

npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@858

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/@tanstack/ai-devtools-core@858

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@858

@tanstack/ai-event-client

npm i https://pkg.pr.new/@tanstack/ai-event-client@858

@tanstack/ai-fal

npm i https://pkg.pr.new/@tanstack/ai-fal@858

@tanstack/ai-gemini

npm i https://pkg.pr.new/@tanstack/ai-gemini@858

@tanstack/ai-grok

npm i https://pkg.pr.new/@tanstack/ai-grok@858

@tanstack/ai-groq

npm i https://pkg.pr.new/@tanstack/ai-groq@858

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@858

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/@tanstack/ai-isolate-node@858

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@858

@tanstack/ai-mcp

npm i https://pkg.pr.new/@tanstack/ai-mcp@858

@tanstack/ai-ollama

npm i https://pkg.pr.new/@tanstack/ai-ollama@858

@tanstack/ai-openai

npm i https://pkg.pr.new/@tanstack/ai-openai@858

@tanstack/ai-openrouter

npm i https://pkg.pr.new/@tanstack/ai-openrouter@858

@tanstack/ai-preact

npm i https://pkg.pr.new/@tanstack/ai-preact@858

@tanstack/ai-react

npm i https://pkg.pr.new/@tanstack/ai-react@858

@tanstack/ai-react-ui

npm i https://pkg.pr.new/@tanstack/ai-react-ui@858

@tanstack/ai-solid

npm i https://pkg.pr.new/@tanstack/ai-solid@858

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/@tanstack/ai-solid-ui@858

@tanstack/ai-svelte

npm i https://pkg.pr.new/@tanstack/ai-svelte@858

@tanstack/ai-utils

npm i https://pkg.pr.new/@tanstack/ai-utils@858

@tanstack/ai-vue

npm i https://pkg.pr.new/@tanstack/ai-vue@858

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/@tanstack/ai-vue-ui@858

@tanstack/openai-base

npm i https://pkg.pr.new/@tanstack/openai-base@858

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@858

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/@tanstack/react-ai-devtools@858

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@858

commit: 6f16b37

@AdemBenAbdallah AdemBenAbdallah force-pushed the fix/provider-options-extraction-593 branch from 6f16b37 to 4154021 Compare June 26, 2026 13:35
@AdemBenAbdallah AdemBenAbdallah force-pushed the fix/provider-options-extraction-593 branch from 4154021 to 563cbf0 Compare June 27, 2026 11:03
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.

Apply audio's brand-based provider-options extraction to TTS, Transcription, Summarize

2 participants