Skip to content

Commit a54de04

Browse files
authored
ref(core): Remove duplicate buildMethodPath utility from openai (#19969)
This is an exact copy from our shared ai utilities Closes #19970 (added automatically)
1 parent 0156846 commit a54de04

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

packages/core/src/tracing/openai/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
getTruncatedJsonString,
2323
resolveAIRecordingOptions,
2424
wrapPromiseWithMethods,
25+
buildMethodPath,
2526
} from '../ai/utils';
2627
import { instrumentStream } from './streaming';
2728
import type {
@@ -37,7 +38,6 @@ import {
3738
addConversationAttributes,
3839
addEmbeddingsAttributes,
3940
addResponsesApiAttributes,
40-
buildMethodPath,
4141
extractRequestParameters,
4242
getOperationName,
4343
getSpanOperation,

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@ export function shouldInstrument(methodPath: string): methodPath is Instrumented
6969
return INSTRUMENTED_METHODS.includes(methodPath as InstrumentedMethod);
7070
}
7171

72-
/**
73-
* Build method path from current traversal
74-
*/
75-
export function buildMethodPath(currentPath: string, prop: string): string {
76-
return currentPath ? `${currentPath}.${prop}` : prop;
77-
}
78-
7972
/**
8073
* Check if response is a Chat Completion object
8174
*/

packages/core/test/lib/utils/openai-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from 'vitest';
2+
import { buildMethodPath } from '../../../src/tracing/ai/utils';
23
import {
3-
buildMethodPath,
44
getOperationName,
55
getSpanOperation,
66
isChatCompletionChunk,

0 commit comments

Comments
 (0)