Conversation
β¦h custom tracer
β¦iption(), summarize()
|
Caution Review failedThe pull request is closed. π WalkthroughWalkthroughThis PR adds embedding functionality to the TanStack AI framework. It introduces a base embedding adapter abstraction, implements a Gemini-specific embedding adapter, creates embed and embedMany activities with event emission, integrates telemetry across multiple activities, extends the event system with embedding-related events, and adds OpenTelemetry tracing utilities for observability. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Activity as embed Activity
participant Adapter as EmbeddingAdapter
participant Tracer
participant EventClient
Client->>Activity: embed({ adapter, value, modelOptions, telemetry })
Activity->>Activity: generateRequestId()
Activity->>EventClient: emit 'embed:request:started'
Activity->>Tracer: getTracer(telemetry.tracer)
Activity->>Activity: recordSpan({ tracer, name, attributes, fn })
Activity->>Adapter: embed({ value, modelOptions })
Adapter-->>Activity: EmbedResult { id, model, embedding, usage }
Activity->>EventClient: emit 'embed:request:completed'
Activity->>EventClient: emit 'embed:usage' (if usage exists)
Activity-->>Client: EmbedResult
sequenceDiagram
participant Activity as Activity (chat/image/speech/etc)
participant Tracer
participant Span
participant Adapter
participant EventClient
Activity->>Activity: recordSpan({ tracer, name, attributes, fn })
Tracer->>Span: startSpan(name, attributes)
Activity->>EventClient: emit 'request:started' with telemetry
Span->>Adapter: execute adapter call
Adapter-->>Span: result with usage/response data
Activity->>Span: recordAttribute(span, 'gen_ai.response.id', id)
Activity->>Span: recordAttribute(span, input/output tokens)
Activity->>EventClient: emit 'request:completed' with telemetry
Activity->>EventClient: emit 'usage' with telemetry (if applicable)
Span-->>Activity: end span
Activity-->>Client: result
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
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. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:sherif,test:knip,tes... |
β Failed | 3m 8s | View β |
nx run-many --targets=build --exclude=examples/** |
β Succeeded | 1m 20s | View β |
βοΈ Nx Cloud last updated this comment at 2026-02-13 18:13:32 UTC

π― Changes
Added
embed/embedManyactivity and Gemini embedding adapterβ Checklist
pnpm run test:pr.π Release Impact
Summary by CodeRabbit
New Features
Chores