Skip to content

feat: add multimodal embed() activity and provider adapters - #926

Open
jherr wants to merge 17 commits into
mainfrom
feat/embed
Open

feat: add multimodal embed() activity and provider adapters#926
jherr wants to merge 17 commits into
mainfrom
feat/embed

Conversation

@jherr

@jherr jherr commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a typed multimodal embed() activity with per-model input modalities, Matryoshka dimensions, middleware/OTel/devtools integration, and embeddings: [{ vector, index }] results
  • Ships embedding adapters for OpenAI, Gemini, Mistral, Ollama, and Bedrock (including Titan multimodal), plus a new @tanstack/ai-cohere package for embed-v4.0
  • Includes docs, migration notes, unit tests, and aimock-backed E2E coverage for openai/gemini/ollama/mistral

Test plan

  • pnpm test:pr (sherif, knip, docs, eslint, lib, types, build)
  • Embedding unit tests across @tanstack/ai and provider packages
  • pnpm --filter @tanstack/ai-e2e test:e2e -- tests/embedding.spec.ts (4/4 passed)
  • Spot-check docs pages: Embeddings, Cohere, Bedrock multimodal examples

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Introduced the embed() activity for single/batch text and multimodal embeddings, including fused inputs and per-item indexed results.
    • Added embedding adapters for OpenAI, Gemini, Mistral, Ollama, Bedrock, and Cohere (including multimodal/fused and dimension-reduction support where available).
    • Added embeddings observability via lifecycle events, devtools event payloads, and OpenTelemetry operation naming.
  • Documentation

    • Added a dedicated embeddings guide, adapter embedding sections, and updated migration notes.
  • Tests

    • Added unit/type-safety tests per adapter plus new end-to-end embedding coverage (UI, fixtures, and API route).

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds the shared embed() activity with typed text and multimodal inputs, provider adapters for OpenAI, Gemini, Mistral, Ollama, Bedrock, and Cohere, embedding observability events, documentation, and end-to-end tests.

Changes

Embedding platform

Layer / File(s) Summary
Core embed activity and contracts
packages/ai/src/activities/embed/*, packages/ai/src/types.ts, packages/ai/src/utilities/embedding-input.ts, packages/ai/tests/*
Adds typed embedding inputs/results, adapter abstractions, modality normalization, middleware lifecycle handling, and tests.
Provider adapters
packages/ai-openai/*, packages/ai-gemini/*, packages/ai-mistral/*, packages/ai-ollama/*
Adds text embedding adapters, provider options, model metadata, factories, exports, and adapter tests.
Bedrock and Cohere adapters
packages/ai-bedrock/*, packages/ai-cohere/*
Adds batched and multimodal adapters, dimension and provider-option mapping, image handling, factories, packaging, and tests.
Events and E2E flow
packages/ai-event-client/*, testing/e2e/*
Adds embedding devtools events, mock provider endpoints, feature routing, UI rendering, fixtures, and Playwright coverage.
Documentation and release metadata
.changeset/*, docs/*
Documents the API, provider support, migration guidance, navigation, and package release metadata.

Estimated code review effort: 5 (Critical) | ~90 minutes

Possibly related PRs

  • TanStack/ai#242: Related to shared TokenUsage reporting used by embedding results and events.

Suggested reviewers: alemtuzlak, tombeckenham

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has a summary and test plan, but it misses the required Changes, Checklist, and Release Impact sections from the template. Rewrite it to match the template: add a '🎯 Changes' section, complete the checklist items, and include '🚀 Release Impact' with the correct checkbox.
Docstring Coverage ⚠️ Warning Docstring coverage is 61.90% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: multimodal embed() support plus provider adapters.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/embed

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agentsroom/agents.json:
- Around line 7-9: Remove the tracked generated files under .agentsroom,
including agents.json and prompts.json, from version control while leaving the
existing ignore rule intact so future state files remain untracked.

In `@docs/config.json`:
- Around line 309-313: Add an updatedAt field with value "2026-07-10" to both
new documentation entries identified by the "Embeddings" and "Cohere" labels in
docs/config.json, alongside their existing addedAt fields.

In `@docs/embeddings.md`:
- Around line 113-116: Add the missing trailing comma after the text object in
the multimodal example’s content array, before the following image object, so
the array is valid TypeScript.

In `@packages/ai-cohere/src/adapters/embedding.ts`:
- Around line 140-151: Add configurable AbortController-based timeouts with a
sensible default to both the Cohere API fetch in the embedding request method
and the image URL fetch. Create and wire an abort signal for each request,
ensure the timer is cleared after completion, and preserve any existing
caller-provided cancellation behavior if supported by the adapter configuration.
- Around line 228-245: Validate image URLs before fetching when allowUrlFetch is
enabled: parse the value in the URL-fetch branch and reject loopback, private,
link-local, and other non-public IP addresses (including equivalent IPv6 ranges)
before calling fetch in the image URL handling logic. Preserve the existing
error behavior for disallowed fetching and fetch failures, and ensure malformed
or unsupported URLs are rejected clearly.

In `@packages/ai-gemini/src/adapters/embedding.ts`:
- Around line 48-51: Update the Gemini embedding adapter constructor to call
super(model, {}) instead of passing config, so BaseEmbeddingAdapter does not
retain the Gemini apiKey in this.config while createGeminiClient(config) still
receives the credentials.

In `@packages/ai/src/activities/embed/adapter.ts`:
- Around line 108-110: Resolve the generateId signature mismatch by either
updating generateId to accept and use a prefix parameter consistent with
Cohere’s generateId(this.name) call and embed/index.ts createId(prefix), or
changing the downstream call to match the no-argument API. Also replace
substring(7) with the consistent slice(2, 9) random suffix logic.

In `@packages/ai/src/activities/embed/index.ts`:
- Around line 216-226: Add the optional modelOptions field to the event payload
interfaces in the ai-event-client index, specifically
EmbeddingRequestStartedEvent, EmbeddingRequestCompletedEvent, and
EmbeddingRequestErrorEvent, using the appropriate existing model-options type.
Keep the modelOptions fields in all corresponding emissions in the embedding
activity aligned with these interface definitions.

In `@testing/e2e/src/routes/api.embedding.ts`:
- Around line 47-68: Change the factories declaration to a type that allows
missing provider keys, such as an object index signature returning (() => any) |
undefined, while retaining the optional call on factories[provider] in the
embedding factory lookup. This preserves runtime safety for unsupported
providers and resolves the unnecessary optional-chain lint error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e692e98a-9142-4e54-b846-abe1a11d5aa4

📥 Commits

Reviewing files that changed from the base of the PR and between 5fcaf90 and af708d4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (71)
  • .agentsroom/.gitignore
  • .agentsroom/agents.json
  • .agentsroom/prompts.json
  • .changeset/embed-activity-multimodal.md
  • docs/adapters/bedrock.md
  • docs/adapters/cohere.md
  • docs/adapters/gemini.md
  • docs/adapters/mistral.md
  • docs/adapters/ollama.md
  • docs/adapters/openai.md
  • docs/config.json
  • docs/embeddings.md
  • docs/migration/migration-from-vercel-ai.md
  • docs/migration/migration.md
  • packages/ai-bedrock/src/adapters/embedding.ts
  • packages/ai-bedrock/src/embedding/embedding-provider-options.ts
  • packages/ai-bedrock/src/index.ts
  • packages/ai-bedrock/src/model-meta.ts
  • packages/ai-bedrock/tests/embedding-adapter.test.ts
  • packages/ai-cohere/README.md
  • packages/ai-cohere/package.json
  • packages/ai-cohere/src/adapters/embedding.ts
  • packages/ai-cohere/src/embedding/embedding-provider-options.ts
  • packages/ai-cohere/src/index.ts
  • packages/ai-cohere/src/model-meta.ts
  • packages/ai-cohere/src/utils/client.ts
  • packages/ai-cohere/tests/embedding-adapter.test.ts
  • packages/ai-cohere/tsconfig.json
  • packages/ai-cohere/vite.config.ts
  • packages/ai-event-client/src/index.ts
  • packages/ai-gemini/src/adapters/embedding.ts
  • packages/ai-gemini/src/embedding/embedding-provider-options.ts
  • packages/ai-gemini/src/index.ts
  • packages/ai-gemini/src/model-meta.ts
  • packages/ai-gemini/tests/embedding-adapter.test.ts
  • packages/ai-mistral/package.json
  • packages/ai-mistral/src/adapters/embedding.ts
  • packages/ai-mistral/src/embedding/embedding-provider-options.ts
  • packages/ai-mistral/src/index.ts
  • packages/ai-mistral/src/model-meta.ts
  • packages/ai-mistral/tests/embedding-adapter.test.ts
  • packages/ai-ollama/src/adapters/embedding.ts
  • packages/ai-ollama/src/embedding/embedding-provider-options.ts
  • packages/ai-ollama/src/index.ts
  • packages/ai-ollama/src/model-meta.ts
  • packages/ai-ollama/tests/embedding-adapter.test.ts
  • packages/ai-openai/src/adapters/embedding.ts
  • packages/ai-openai/src/embedding/embedding-provider-options.ts
  • packages/ai-openai/src/index.ts
  • packages/ai-openai/src/model-meta.ts
  • packages/ai-openai/tests/embedding-adapter.test.ts
  • packages/ai/src/activities/embed/adapter.ts
  • packages/ai/src/activities/embed/index.ts
  • packages/ai/src/activities/index.ts
  • packages/ai/src/activities/middleware/types.ts
  • packages/ai/src/index.ts
  • packages/ai/src/middlewares/otel.ts
  • packages/ai/src/types.ts
  • packages/ai/src/utilities/embedding-input.ts
  • packages/ai/tests/embed-per-model-type-safety.test.ts
  • packages/ai/tests/embed.test.ts
  • testing/e2e/fixtures/embedding/basic.json
  • testing/e2e/global-setup.ts
  • testing/e2e/src/components/EmbeddingUI.tsx
  • testing/e2e/src/lib/feature-support.ts
  • testing/e2e/src/lib/features.ts
  • testing/e2e/src/lib/types.ts
  • testing/e2e/src/routeTree.gen.ts
  • testing/e2e/src/routes/$provider/$feature.tsx
  • testing/e2e/src/routes/api.embedding.ts
  • testing/e2e/tests/embedding.spec.ts

Comment thread .agentsroom/agents.json Outdated
Comment on lines +7 to +9
"id": "agent-1776361243376-3sekdc",
"claudeSessionId": "96773a93-be2a-45a9-a732-ceb224d3d0e5"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether .agentsroom files are tracked despite the root .gitignore rule
git ls-files .agentsroom/

Repository: TanStack/ai

Length of output: 221


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== root .gitignore ==\n'
if [ -f .gitignore ]; then
  cat -n .gitignore
else
  echo 'No root .gitignore'
fi

printf '\n== .agentsroom/.gitignore ==\n'
if [ -f .agentsroom/.gitignore ]; then
  cat -n .agentsroom/.gitignore
else
  echo 'No .agentsroom/.gitignore'
fi

printf '\n== .agentsroom/agents.json ==\n'
cat -n .agentsroom/agents.json

Repository: TanStack/ai

Length of output: 2498


Remove the tracked .agentsroom state.agentsroom/agents.json:7-9 is still committed even though .agentsroom/ is ignored, and it includes a claudeSessionId. Untrack the generated .agentsroom files (including agents.json and prompts.json) so personal/session data stays out of git.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agentsroom/agents.json around lines 7 - 9, Remove the tracked generated
files under .agentsroom, including agents.json and prompts.json, from version
control while leaving the existing ignore rule intact so future state files
remain untracked.

Comment thread docs/config.json
Comment thread docs/embeddings.md Outdated
Comment thread packages/ai-cohere/src/adapters/embedding.ts Outdated
Comment thread packages/ai-cohere/src/adapters/embedding.ts
Comment thread packages/ai-gemini/src/adapters/embedding.ts
Comment thread packages/ai/src/activities/embed/adapter.ts Outdated
Comment thread packages/ai/src/activities/embed/index.ts
Comment thread testing/e2e/src/routes/api.embedding.ts Outdated
Comment thread docs/adapters/bedrock.md Outdated
Comment on lines +234 to +247
input: {
type: "content",
content: [
{ type: "text", content: "a red guitar" },
{
type: "image",
source: {
type: "data",
value: productPhoto,
mimeType: "image/png",
},
},
],
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this an array above and then an object with type: "content" here with content being an array of parts? why do we not use the same convention we use across all our other generations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point.

Comment thread docs/migration/migration-from-vercel-ai.md Outdated
Comment thread docs/embeddings.md Outdated
Comment on lines +223 to +240
## Provider Support Matrix

| Provider | Models | Modalities | `dimensions` | Usage reported |
| --- | --- | --- | --- | --- |
| OpenAI | text-embedding-3-small, text-embedding-3-large | text | ✅ | ✅ |
| Cohere | embed-v4.0 | text + image | ✅ | ✅ |
| Gemini | gemini-embedding-001 | text | ✅ | ❌ |
| Mistral | mistral-embed | text | ❌ | ✅ |
| Mistral | codestral-embed | text | ✅ | ✅ |
| Bedrock | amazon.titan-embed-text-v2:0 | text | ✅ (256/512/1024) | ✅ |
| Bedrock | amazon.titan-embed-image-v1 | text + image | ✅ (256/384/1024) | ✅ |
| Bedrock | cohere.embed-english-v3, cohere.embed-multilingual-v3 | text | ❌ | ❌ |
| Ollama | nomic-embed-text, mxbai-embed-large, … | text | ❌ | ✅ |

Notes:

- Bedrock Titan models have no batch API — a batch of N items runs as N requests under a small concurrency cap.
- Gemini's Vertex-only multimodal embedding model (`multimodalembedding@001`) is not supported; `@tanstack/ai-gemini` targets the Gemini API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would remove this complete section, will be outdated in a day probably

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

19 package(s) bumped directly, 31 bumped as dependents.

🟥 Major bumps

Package Version Reason
@tanstack/ai-angular 0.3.1 → 1.0.0 Changeset
@tanstack/ai-bedrock 0.1.4 → 1.0.0 Changeset
@tanstack/ai-cohere 0.1.0 → 1.0.0 Changeset
@tanstack/ai-durable-stream 0.0.0 → 1.0.0 Changeset
@tanstack/ai-gemini 0.20.1 → 1.0.0 Changeset
@tanstack/ai-memory 0.0.0 → 1.0.0 Changeset
@tanstack/ai-mistral 0.2.3 → 1.0.0 Changeset
@tanstack/ai-ollama 0.8.16 → 1.0.0 Changeset
@tanstack/ai-openai 0.17.1 → 1.0.0 Changeset
@tanstack/ai-openrouter 0.15.10 → 1.0.0 Changeset
@tanstack/ai-preact 0.11.1 → 1.0.0 Changeset
@tanstack/ai-react 0.18.1 → 1.0.0 Changeset
@tanstack/ai-solid 0.15.1 → 1.0.0 Changeset
@tanstack/ai-svelte 0.15.1 → 1.0.0 Changeset
@tanstack/ai-vue 0.15.1 → 1.0.0 Changeset
@tanstack/ai-acp 0.2.3 → 1.0.0 Dependent
@tanstack/ai-anthropic 0.16.3 → 1.0.0 Dependent
@tanstack/ai-claude-code 0.2.3 → 1.0.0 Dependent
@tanstack/ai-code-mode 0.3.8 → 1.0.0 Dependent
@tanstack/ai-code-mode-skills 0.3.11 → 1.0.0 Dependent
@tanstack/ai-codex 0.2.3 → 1.0.0 Dependent
@tanstack/ai-elevenlabs 0.2.34 → 1.0.0 Dependent
@tanstack/ai-fal 0.9.12 → 1.0.0 Dependent
@tanstack/ai-grok 0.14.9 → 1.0.0 Dependent
@tanstack/ai-grok-build 0.2.3 → 1.0.0 Dependent
@tanstack/ai-groq 0.5.3 → 1.0.0 Dependent
@tanstack/ai-isolate-node 0.1.47 → 1.0.0 Dependent
@tanstack/ai-isolate-quickjs 0.1.47 → 1.0.0 Dependent
@tanstack/ai-opencode 0.2.3 → 1.0.0 Dependent
@tanstack/ai-react-ui 0.8.15 → 1.0.0 Dependent
@tanstack/ai-sandbox 0.2.4 → 1.0.0 Dependent
@tanstack/ai-sandbox-cloudflare 0.2.4 → 1.0.0 Dependent
@tanstack/ai-sandbox-daytona 0.2.0 → 1.0.0 Dependent
@tanstack/ai-sandbox-docker 0.2.0 → 1.0.0 Dependent
@tanstack/ai-sandbox-local-process 0.2.0 → 1.0.0 Dependent
@tanstack/ai-sandbox-sprites 0.2.1 → 1.0.0 Dependent
@tanstack/ai-sandbox-vercel 0.2.0 → 1.0.0 Dependent
@tanstack/ai-solid-ui 0.7.14 → 1.0.0 Dependent
@tanstack/openai-base 0.9.9 → 1.0.0 Dependent

🟨 Minor bumps

Package Version Reason
@tanstack/ai 0.42.0 → 0.43.0 Changeset
@tanstack/ai-client 0.22.1 → 0.23.0 Changeset
@tanstack/ai-devtools-core 0.4.24 → 0.5.0 Changeset
@tanstack/ai-event-client 0.6.8 → 0.7.0 Changeset

🟩 Patch bumps

Package Version Reason
@tanstack/ai-isolate-cloudflare 0.2.38 → 0.2.39 Dependent
@tanstack/ai-mcp 0.2.5 → 0.2.6 Dependent
@tanstack/ai-vue-ui 0.2.34 → 0.2.35 Dependent
@tanstack/preact-ai-devtools 0.1.67 → 0.1.68 Dependent
@tanstack/react-ai-devtools 0.2.67 → 0.2.68 Dependent
@tanstack/solid-ai-devtools 0.2.67 → 0.2.68 Dependent
ag-ui 0.0.2 → 0.0.3 Dependent

@nx-cloud

nx-cloud Bot commented Jul 15, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ab41cd7

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

☁️ Nx Cloud last updated this comment at 2026-07-26 23:41:54 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

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

@tanstack/ai-acp

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-acp@926

@tanstack/ai-angular

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

@tanstack/ai-anthropic

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

@tanstack/ai-bedrock

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-bedrock@926

@tanstack/ai-claude-code

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-claude-code@926

@tanstack/ai-client

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

@tanstack/ai-code-mode

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

@tanstack/ai-code-mode-skills

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

@tanstack/ai-codex

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-codex@926

@tanstack/ai-cohere

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-cohere@926

@tanstack/ai-devtools-core

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

@tanstack/ai-durable-stream

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-durable-stream@926

@tanstack/ai-elevenlabs

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

@tanstack/ai-event-client

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

@tanstack/ai-fal

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

@tanstack/ai-gemini

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

@tanstack/ai-grok

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

@tanstack/ai-grok-build

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-grok-build@926

@tanstack/ai-groq

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

@tanstack/ai-isolate-cloudflare

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

@tanstack/ai-isolate-node

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

@tanstack/ai-isolate-quickjs

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

@tanstack/ai-mcp

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

@tanstack/ai-memory

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-memory@926

@tanstack/ai-mistral

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-mistral@926

@tanstack/ai-ollama

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

@tanstack/ai-openai

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

@tanstack/ai-opencode

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-opencode@926

@tanstack/ai-openrouter

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

@tanstack/ai-preact

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

@tanstack/ai-react

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

@tanstack/ai-react-ui

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

@tanstack/ai-sandbox

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox@926

@tanstack/ai-sandbox-cloudflare

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-cloudflare@926

@tanstack/ai-sandbox-daytona

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-daytona@926

@tanstack/ai-sandbox-docker

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-docker@926

@tanstack/ai-sandbox-local-process

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-local-process@926

@tanstack/ai-sandbox-sprites

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-sprites@926

@tanstack/ai-sandbox-vercel

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-vercel@926

@tanstack/ai-solid

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

@tanstack/ai-solid-ui

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

@tanstack/ai-svelte

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

@tanstack/ai-utils

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

@tanstack/ai-vue

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

@tanstack/ai-vue-ui

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

@tanstack/openai-base

npm i https://pkg.pr.new/TanStack/ai/@tanstack/openai-base@926

@tanstack/preact-ai-devtools

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

@tanstack/react-ai-devtools

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

@tanstack/solid-ai-devtools

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

commit: f696e9a

jherr and others added 5 commits July 16, 2026 14:44
Introduce a typed embed() primitive with per-model input modalities, Matryoshka dimensions, and adapters for OpenAI, Gemini, Mistral, Ollama, Bedrock, and a new @tanstack/ai-cohere package.

Co-authored-by: Cursor <cursoragent@cursor.com>
These personal agent config files should not ship in the embed PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align embedding event types with emitted modelOptions, harden generateId,
fix e2e factory typing, and add Cohere fetch timeouts plus SSRF guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
#	testing/e2e/src/routeTree.gen.ts
Address review feedback on PR #926: the multimodal `embed()` input used a
`{ type: 'content', content: [...] }` wrapper that existed only in embeddings
and broke the `Array<ContentPart>` convention used everywhere else (e.g. chat
message content).

Replace `EmbeddingContentItem` with `EmbeddingContentParts = Array<TextPart |
ImagePart>`. A fused multimodal item is now a nested array of parts; the
top-level `input` array is uniformly the item list (one vector per element),
so you fuse by nesting: `[[textPart, imagePart]]`. The resolver disambiguates
on `Array.isArray`, and per-model narrowing still rejects images/fused arrays
on text-only models at compile time.

Also remove the Provider Support Matrix from docs/embeddings.md (goes stale
quickly), and propagate the input-shape change across docs, adapter READMEs,
tests, and the changeset.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/config.json (2)

603-605: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the missing addedAt to the Mistral entry.

The Mistral documentation entry has updatedAt but no addedAt, violating the requirement to maintain both timestamps. Preserve the page’s original publication date.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/config.json` around lines 603 - 605, Add the missing addedAt field to
the Mistral entry identified by label "Mistral", preserving the page’s original
publication date, while keeping the existing updatedAt value unchanged.

Source: Coding guidelines


489-495: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Refresh stale updatedAt values to July 22, 2026.

These entries correspond to documentation changes in this PR but still use 2026-07-10. Per the docs metadata guideline, substantive content changes should refresh updatedAt to today’s date.

Also applies to: 567-570, 579-588, 603-605

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/config.json` around lines 489 - 495, Update every affected documentation
entry in docs/config.json, including the “From Vercel AI SDK” entry and the
additional referenced ranges, changing stale updatedAt values from 2026-07-10 to
2026-07-22 while leaving labels, links, and addedAt values unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/config.json`:
- Around line 603-605: Add the missing addedAt field to the Mistral entry
identified by label "Mistral", preserving the page’s original publication date,
while keeping the existing updatedAt value unchanged.
- Around line 489-495: Update every affected documentation entry in
docs/config.json, including the “From Vercel AI SDK” entry and the additional
referenced ranges, changing stale updatedAt values from 2026-07-10 to 2026-07-22
while leaving labels, links, and addedAt values unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 49682a70-eeef-47b9-8c97-93d9b17a8a60

📥 Commits

Reviewing files that changed from the base of the PR and between 85f6bab and ffccb14.

📒 Files selected for processing (13)
  • .changeset/embed-activity-multimodal.md
  • docs/adapters/bedrock.md
  • docs/adapters/cohere.md
  • docs/config.json
  • docs/embeddings.md
  • packages/ai-bedrock/tests/embedding-adapter.test.ts
  • packages/ai-cohere/README.md
  • packages/ai-cohere/tests/embedding-adapter.test.ts
  • packages/ai/src/activities/embed/index.ts
  • packages/ai/src/types.ts
  • packages/ai/src/utilities/embedding-input.ts
  • packages/ai/tests/embed-per-model-type-safety.test.ts
  • packages/ai/tests/embed.test.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • docs/adapters/bedrock.md
  • packages/ai-cohere/README.md
  • packages/ai/tests/embed-per-model-type-safety.test.ts
  • packages/ai/src/utilities/embedding-input.ts
  • packages/ai/src/activities/embed/index.ts
  • docs/adapters/cohere.md
  • packages/ai/src/types.ts
  • packages/ai-bedrock/tests/embedding-adapter.test.ts
  • packages/ai-cohere/tests/embedding-adapter.test.ts
  • packages/ai/tests/embed.test.ts
  • .changeset/embed-activity-multimodal.md

jherr and others added 4 commits July 22, 2026 15:16
…on guide

Drop the unnecessary `ignore` tag on the embeddings "Before (Vercel AI SDK)"
block. The Vercel packages aren't installed, so their imports resolve to `any`
(same as every other non-ignored "Before" block), meaning the snippet already
passes `kiira check` — no reason to skip it. Addresses PR #926 review feedback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	testing/e2e/src/routeTree.gen.ts
…s metadata

- Pass `{}` to `super()` in GeminiEmbeddingAdapter so BaseEmbeddingAdapter no
  longer stores the Gemini apiKey on `this.config` (createGeminiClient still
  receives the credentials). Matches every other embedding adapter.
- docs/config.json: add missing `addedAt` to the Mistral entry and refresh
  stale `updatedAt` to 2026-07-22 on the docs this PR substantively changed
  (migration guides, openai/gemini/ollama/mistral adapters).

Addresses PR #926 review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants