Skip to content

Commit ca2d43e

Browse files
committed
update name to reference integration name constant
1 parent 8535978 commit ca2d43e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/core/src/utils/openai-constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const INTEGRATION_NAME = 'openAI';
1+
export const INTEGRATION_NAME = 'OpenAI';
22

33
// https://platform.openai.com/docs/quickstart?api-mode=responses
44
// https://platform.openai.com/docs/quickstart?api-mode=chat

packages/core/src/utils/openai.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,
2525
OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE,
2626
} from './openai-attributes';
27+
import { INTEGRATION_NAME } from './openai-constants';
2728
import type {
2829
InstrumentedMethod,
2930
OpenAiChatCompletionObject,
@@ -199,7 +200,7 @@ function addRequestAttributes(span: Span, params: Record<string, unknown>): void
199200
function getOptionsFromIntegration(): OpenAiOptions {
200201
const scope = getCurrentScope();
201202
const client = scope.getClient();
202-
const integration = client?.getIntegrationByName('OpenAI') as OpenAiIntegration | undefined;
203+
const integration = client?.getIntegrationByName(INTEGRATION_NAME) as OpenAiIntegration | undefined;
203204
const shouldRecordInputsAndOutputs = integration ? Boolean(client?.getOptions().sendDefaultPii) : false;
204205

205206
return {

0 commit comments

Comments
 (0)