diff --git a/dev-packages/cloudflare-integration-tests/suites/tracing/workers-ai/test.ts b/dev-packages/cloudflare-integration-tests/suites/tracing/workers-ai/test.ts index 53ac07e0c875..18d5f5a72543 100644 --- a/dev-packages/cloudflare-integration-tests/suites/tracing/workers-ai/test.ts +++ b/dev-packages/cloudflare-integration-tests/suites/tracing/workers-ai/test.ts @@ -21,13 +21,10 @@ import { SENTRY_OP, SENTRY_ORIGIN, } from '@sentry/conventions/attributes'; -import { GEN_AI_DECIDE } from '@sentry/conventions/op'; +import { GEN_AI_DECIDE, GEN_AI_EXTRACT } from '@sentry/conventions/op'; import { SDK_VERSION } from '@sentry/core'; import { expect, it } from 'vitest'; -import { - GEN_AI_EXTRACT_OP, - GEN_AI_REQUEST_STREAM_ATTRIBUTE, -} from '../../../../../packages/server-utils/src/ai/core/gen-ai-attributes'; +import { GEN_AI_REQUEST_STREAM_ATTRIBUTE } from '../../../../../packages/server-utils/src/ai/core/gen-ai-attributes'; import { createRunner } from '../../../runner'; import { getSpanOp, getSpansFromEnvelope } from '../../../spanUtils'; @@ -250,7 +247,7 @@ it('traces a Clairic extraction', async ({ signal }) => { is_segment: false, attributes: { [SENTRY_ORIGIN]: { value: 'auto.ai.cloudflare.workers_ai', type: 'string' }, - [SENTRY_OP]: { value: GEN_AI_EXTRACT_OP, type: 'string' }, + [SENTRY_OP]: { value: GEN_AI_EXTRACT, type: 'string' }, [GEN_AI_PROVIDER_NAME]: { value: 'cloudflare.workers_ai', type: 'string' }, [GEN_AI_OPERATION_NAME]: { value: 'extract', type: 'string' }, [GEN_AI_REQUEST_MODEL]: { value: '@cf/cloudflare/clairic', type: 'string' }, diff --git a/packages/server-utils/src/ai/core/gen-ai-attributes.ts b/packages/server-utils/src/ai/core/gen-ai-attributes.ts index a5b99078a6a2..6b577af8eb4d 100644 --- a/packages/server-utils/src/ai/core/gen-ai-attributes.ts +++ b/packages/server-utils/src/ai/core/gen-ai-attributes.ts @@ -34,9 +34,3 @@ export const GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE = 'gen_ai.response.stop_reaso * The tool call ID */ export const GEN_AI_TOOL_CALL_ID_ATTRIBUTE = 'gen_ai.tool.call.id'; - -/** - * The span op for extraction of typed fields from a state (e.g. Cloudflare Clairic) - * TODO: Import from `@sentry/conventions/op` once getsentry/sentry-conventions#728 is released - */ -export const GEN_AI_EXTRACT_OP = 'gen_ai.extract'; diff --git a/packages/server-utils/src/ai/workers-ai/utils.ts b/packages/server-utils/src/ai/workers-ai/utils.ts index d01a40ef3f53..422da29faaaf 100644 --- a/packages/server-utils/src/ai/workers-ai/utils.ts +++ b/packages/server-utils/src/ai/workers-ai/utils.ts @@ -18,10 +18,10 @@ import { GEN_AI_SYSTEM_INSTRUCTIONS, SENTRY_ORIGIN, } from '@sentry/conventions/attributes'; -import { GEN_AI_CHAT, GEN_AI_EMBEDDINGS, GEN_AI_DECIDE } from '@sentry/conventions/op'; +import { GEN_AI_CHAT, GEN_AI_EMBEDDINGS, GEN_AI_DECIDE, GEN_AI_EXTRACT } from '@sentry/conventions/op'; import { isObjectLike, stringify } from '@sentry/core'; import type { Span, SpanAttributeValue } from '@sentry/core'; -import { GEN_AI_EXTRACT_OP, GEN_AI_REQUEST_STREAM_ATTRIBUTE } from '../core/gen-ai-attributes'; +import { GEN_AI_REQUEST_STREAM_ATTRIBUTE } from '../core/gen-ai-attributes'; import { extractSystemInstructions, getEvaluationInputMessages, @@ -40,7 +40,7 @@ export const WORKERS_AI_OPERATION_SPAN_OPS: Record