-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(spans): Global config for AI model costs #3579
Conversation
@@ -46,6 +46,9 @@ pub struct GlobalConfig { | |||
/// applying. | |||
#[serde(skip_serializing_if = "is_ok_and_empty")] | |||
pub metric_extraction: ErrorBoundary<MetricExtractionGroups>, | |||
|
|||
/// Configuration for AI span measurements. | |||
pub ai_model_costs: ErrorBoundary<ai::ModelCosts>, |
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.
Will add a skip_serializing_if
here.
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.
👍
#[serde(rename_all = "camelCase")] | ||
pub struct ModelCost { | ||
model_id: LazyGlob, | ||
for_completion: bool, |
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.
Maybe this makes sense as an enum, but not familiar enough with AI terminology:
enum Usage {
Completion,
NotCompletionButTheDefaultUsecase,
// MaybeSomeFutureUsecase,
}
@colin-sentry wdyt?
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.
the SDKs only send the static prompt_tokens
, completion_tokens
, and total_tokens
, so it's probably fine to keep as a boolean
@@ -46,6 +46,9 @@ pub struct GlobalConfig { | |||
/// applying. | |||
#[serde(skip_serializing_if = "is_ok_and_empty")] | |||
pub metric_extraction: ErrorBoundary<MetricExtractionGroups>, | |||
|
|||
/// Configuration for AI span measurements. | |||
pub ai_model_costs: ErrorBoundary<ai::ModelCosts>, |
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.
👍
See #3554.
#skip-changelog