-
Notifications
You must be signed in to change notification settings - Fork 749
add llm client option for AI SDK experimental telemetry config #759
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
base: main
Are you sure you want to change the base?
Conversation
|
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.
PR Summary
Added support for AI SDK experimental telemetry configuration to enhance observability for AI SDK calls, particularly for integration with Laminar.
- Added
aiSdkExperimentalTelemetry
field intypes/stagehand.ts
ConstructorParams interface - Modified
types/model.ts
to include optionalaiSdkTelemetrySettings
in ClientOptions - Updated
lib/llm/aisdk.ts
to pass telemetry settings togenerateObject
andgenerateText
calls - Added telemetry parameter handling in
lib/llm/LLMProvider.ts
for AISdkClient initialization - Consider adding version requirements and compatibility documentation for the
ai
package dependency
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
5 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
export type ClientOptions = (OpenAIClientOptions | AnthropicClientOptions) & { | ||
aiSdkTelemetrySettings?: TelemetrySettings; | ||
}; |
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.
style: Consider making this a discriminated union with a provider field to ensure type safety when using provider-specific options
@kamath @seanmcguire12 Hey team, can you please have a look at this. |
Note: sorry, doesn't seem like evals branch recommended in your contributing guide exists
why
To enhance Laminar (or any other) observability for AI SDK calls.
Allow users to configure telemetry for AI SDK
what changed
Added a new field to
ClientOptions
and passed it down thegenerateText
andgenerateObject
calls.test plan
Tested manually with a simple Laminar script: