-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Add support for TrackedChats in the AI SDK #939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@launchdarkly/browser size report |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
| // Try specific implementations for the provider | ||
| switch (providerName) { | ||
| case 'openai': | ||
| trackedChat = undefined; | ||
| break; | ||
| case 'bedrock': | ||
| trackedChat = undefined; | ||
| break; | ||
| default: | ||
| trackedChat = undefined; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the plan is to fill this out later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we will add support for additional providers
🤖 I have created a release *beep* *boop* --- <details><summary>server-sdk-ai: 0.12.0</summary> ## [0.12.0](server-sdk-ai-v0.11.4...server-sdk-ai-v0.12.0) (2025-10-13) ### Features * Add support for TrackedChats in the AI SDK ([#939](#939)) ([a7ad0ea](a7ad0ea)) * Add support for Vercel AIProvider to the AI SDK ([#946](#946)) ([8553f24](8553f24)) ### Bug Fixes * Rename to AIProviderFactory for more accurate naming ([#949](#949)) ([92323ec](92323ec)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Release server-sdk-ai 0.12.0 adding TrackedChats and OpenAI/LangChain/Vercel AIProviders; update manifest and example apps to new version. > > - **server-sdk-ai 0.12.0**: > - **Features**: Support `TrackedChats`; add `OpenAI`, `LangChain`, and `Vercel` AIProviders. > - **Version bumps**: > - Update `packages/sdk/server-ai/package.json` and examples (`examples/openai`, `examples/bedrock`) to `0.12.0`. > - Update `.release-please-manifest.json` entry for `packages/sdk/server-ai` to `0.12.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ce739d8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jason Bailey <jbailey@launchdarkly.com>
Note
Introduces a new chat API with provider factory, adds generic metrics tracking, and exposes an initChat entrypoint with logger support.
TrackedChatwith conversation management (invoke,appendMessages,getMessages).TrackedChatFactoryto instantiate chats based onprovider(tries LangChain fallback).ChatResponseand re-export fromapi/chat.AIProviderbase class and export viaapi/providers.LDAIMetricsandLDAIConfigTracker.trackMetricsOffor generic success/usage tracking.trackMetricsOfinLDAIConfigTrackerImplalongside existing trackers.LDAIClientImplwithloggerand newinitChat(...)that tracks usage and returnsTrackedChat | undefinedwhen disabled.LDAIClientinterface to includeinitChatand importTrackedChat.LDClientMinto expose optionallogger.LDAIMetrics.tsconfig.eslint.jsonincludes/excludes.TrackedChatbehaviors and fortrackMetricsOfsuccess/error/token cases.Written by Cursor Bugbot for commit 0b9f894. This will update automatically on new commits. Configure here.