Skip to content

Commit db18c0a

Browse files
committed
rename to gen-ai-attributes, and fix test
1 parent ca2d43e commit db18c0a

File tree

5 files changed

+3
-14
lines changed

5 files changed

+3
-14
lines changed

dev-packages/node-integration-tests/suites/tracing/openai/instrument-with-options.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import * as Sentry from '@sentry/node';
22
import { loggingTransport } from '@sentry-internal/node-integration-tests';
33

4-
// Set environment variable to trigger the fourth test
5-
process.env.TEST_OPTIONS = '1';
6-
74
Sentry.init({
85
dsn: 'https://[email protected]/1337',
96
release: '1.0',

dev-packages/node-integration-tests/suites/tracing/openai/scenario.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,7 @@ async function run() {
7373
apiKey: 'mock-api-key',
7474
});
7575

76-
const sentryClient = Sentry.getCurrentScope().getClient();
77-
const sendDefaultPii = sentryClient?.getOptions().sendDefaultPii || false;
78-
79-
const options =
80-
process.env.TEST_OPTIONS === '1'
81-
? { recordInputs: true, recordOutputs: true }
82-
: { recordInputs: sendDefaultPii, recordOutputs: sendDefaultPii };
83-
84-
const client = instrumentOpenAiClient(mockClient, options);
76+
const client = instrumentOpenAiClient(mockClient);
8577

8678
// First test: basic chat completion
8779
await client.chat.completions.create({

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OPENAI_OPERATIONS } from './openai-attributes';
1+
import { OPENAI_OPERATIONS } from './gen-ai-attributes';
22
import { INSTRUMENTED_METHODS } from './openai-constants';
33
import type { InstrumentedMethod, OpenAiChatCompletionObject, OpenAIResponseObject } from './openai-types';
44

packages/core/src/utils/openai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE,
2424
OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE,
2525
OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE,
26-
} from './openai-attributes';
26+
} from './gen-ai-attributes';
2727
import { INTEGRATION_NAME } from './openai-constants';
2828
import type {
2929
InstrumentedMethod,

0 commit comments

Comments
 (0)