@vscode/chat-lib 0.43.2026040705 → 0.43.2026040706-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/_internal/extension/common/constants.d.ts +2 -1
- package/dist/src/_internal/extension/common/constants.d.ts.map +1 -1
- package/dist/src/_internal/extension/common/constants.js +3 -0
- package/dist/src/_internal/extension/common/constants.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.d.ts +1 -5
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.js +3 -11
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.d.ts +0 -30
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.js +4 -82
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/fetch.d.ts +2 -10
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/fetch.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/fetch.js +26 -173
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/fetch.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.d.ts +11 -0
- package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.js +21 -3
- package/dist/src/_internal/extension/inlineEdits/node/nextEditCache.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts +2 -2
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +34 -12
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +37 -24
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.js +4 -2
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/xtab/common/fetchStreamError.d.ts +10 -0
- package/dist/src/_internal/extension/xtab/common/fetchStreamError.d.ts.map +1 -0
- package/dist/src/_internal/extension/xtab/common/fetchStreamError.js +19 -0
- package/dist/src/_internal/extension/xtab/common/fetchStreamError.js.map +1 -0
- package/dist/src/_internal/extension/xtab/node/cursorLineDivergence.d.ts +44 -0
- package/dist/src/_internal/extension/xtab/node/cursorLineDivergence.d.ts.map +1 -0
- package/dist/src/_internal/extension/xtab/node/cursorLineDivergence.js +181 -0
- package/dist/src/_internal/extension/xtab/node/cursorLineDivergence.js.map +1 -0
- package/dist/src/_internal/extension/xtab/node/editIntent.d.ts +31 -0
- package/dist/src/_internal/extension/xtab/node/editIntent.d.ts.map +1 -0
- package/dist/src/_internal/extension/xtab/node/editIntent.js +193 -0
- package/dist/src/_internal/extension/xtab/node/editIntent.js.map +1 -0
- package/dist/src/_internal/extension/xtab/node/responseFormatHandlers.d.ts +52 -0
- package/dist/src/_internal/extension/xtab/node/responseFormatHandlers.d.ts.map +1 -0
- package/dist/src/_internal/extension/xtab/node/responseFormatHandlers.js +134 -0
- package/dist/src/_internal/extension/xtab/node/responseFormatHandlers.js.map +1 -0
- package/dist/src/_internal/extension/xtab/node/xtabCustomDiffPatchResponseHandler.d.ts +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabCustomDiffPatchResponseHandler.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabCustomDiffPatchResponseHandler.js +5 -5
- package/dist/src/_internal/extension/xtab/node/xtabCustomDiffPatchResponseHandler.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts +10 -37
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js +315 -361
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabUtils.d.ts +10 -0
- package/dist/src/_internal/extension/xtab/node/xtabUtils.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabUtils.js +24 -0
- package/dist/src/_internal/extension/xtab/node/xtabUtils.js.map +1 -1
- package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts +1 -0
- package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/common/copilotToken.js +3 -0
- package/dist/src/_internal/platform/authentication/common/copilotToken.js.map +1 -1
- package/dist/src/_internal/platform/chat/common/chatMLFetcher.d.ts +1 -0
- package/dist/src/_internal/platform/chat/common/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/platform/chat/common/chatMLFetcher.js +4 -0
- package/dist/src/_internal/platform/chat/common/chatMLFetcher.js.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.d.ts.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.js +34 -4
- package/dist/src/_internal/platform/chat/common/commonTypes.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +30 -13
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +37 -20
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.d.ts +1 -1
- package/dist/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.js +1 -1
- package/dist/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +20 -0
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +49 -2
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts +2 -0
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/statefulMarkerContainer.d.ts +5 -0
- package/dist/src/_internal/platform/endpoint/common/statefulMarkerContainer.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/statefulMarkerContainer.js +13 -0
- package/dist/src/_internal/platform/endpoint/common/statefulMarkerContainer.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts +14 -2
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js +41 -71
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/imageLimits.d.ts +14 -0
- package/dist/src/_internal/platform/endpoint/node/imageLimits.d.ts.map +1 -0
- package/dist/src/_internal/platform/endpoint/node/imageLimits.js +156 -0
- package/dist/src/_internal/platform/endpoint/node/imageLimits.js.map +1 -0
- package/dist/src/_internal/platform/endpoint/node/messagesApi.d.ts +4 -12
- package/dist/src/_internal/platform/endpoint/node/messagesApi.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/messagesApi.js +39 -162
- package/dist/src/_internal/platform/endpoint/node/messagesApi.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts +15 -2
- package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js +259 -42
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js.map +1 -1
- package/dist/src/_internal/platform/git/common/gitService.d.ts +8 -11
- package/dist/src/_internal/platform/git/common/gitService.d.ts.map +1 -1
- package/dist/src/_internal/platform/git/common/gitService.js.map +1 -1
- package/dist/src/_internal/platform/github/common/githubAPI.d.ts +1 -0
- package/dist/src/_internal/platform/github/common/githubAPI.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubAPI.js +2 -0
- package/dist/src/_internal/platform/github/common/githubAPI.js.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.d.ts +3 -2
- package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts +15 -0
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js +17 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.d.ts +12 -3
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.js +72 -46
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditLogContext.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/utils/utils.d.ts +3 -0
- package/dist/src/_internal/platform/inlineEdits/common/utils/utils.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/utils/utils.js +12 -0
- package/dist/src/_internal/platform/inlineEdits/common/utils/utils.js.map +1 -1
- package/dist/src/_internal/platform/log/common/logService.d.ts +5 -0
- package/dist/src/_internal/platform/log/common/logService.d.ts.map +1 -1
- package/dist/src/_internal/platform/log/common/logService.js +22 -0
- package/dist/src/_internal/platform/log/common/logService.js.map +1 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts +1 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts.map +1 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js +1 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/anthropic.d.ts +0 -58
- package/dist/src/_internal/platform/networking/common/anthropic.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/anthropic.js +6 -67
- package/dist/src/_internal/platform/networking/common/anthropic.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetch.d.ts +0 -12
- package/dist/src/_internal/platform/networking/common/fetch.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetch.js +5 -1
- package/dist/src/_internal/platform/networking/common/fetch.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts +1 -0
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts +22 -4
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatStream.d.ts +10 -0
- package/dist/src/_internal/platform/networking/node/chatStream.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatStream.js +28 -0
- package/dist/src/_internal/platform/networking/node/chatStream.js.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.d.ts +24 -5
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.js +67 -20
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.js.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.d.ts +15 -1
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.js +51 -7
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.js.map +1 -1
- package/dist/src/_internal/platform/otel/common/genAiEvents.d.ts.map +1 -1
- package/dist/src/_internal/platform/otel/common/genAiEvents.js +10 -2
- package/dist/src/_internal/platform/otel/common/genAiEvents.js.map +1 -1
- package/dist/src/_internal/platform/otel/common/index.d.ts +1 -1
- package/dist/src/_internal/platform/otel/common/index.d.ts.map +1 -1
- package/dist/src/_internal/platform/otel/common/index.js +2 -1
- package/dist/src/_internal/platform/otel/common/index.js.map +1 -1
- package/dist/src/_internal/platform/otel/common/messageFormatters.d.ts +13 -1
- package/dist/src/_internal/platform/otel/common/messageFormatters.d.ts.map +1 -1
- package/dist/src/_internal/platform/otel/common/messageFormatters.js +98 -0
- package/dist/src/_internal/platform/otel/common/messageFormatters.js.map +1 -1
- package/dist/src/_internal/platform/requestLogger/common/requestLogger.d.ts +170 -0
- package/dist/src/_internal/platform/requestLogger/common/requestLogger.d.ts.map +1 -0
- package/dist/src/_internal/platform/requestLogger/common/requestLogger.js +145 -0
- package/dist/src/_internal/platform/requestLogger/common/requestLogger.js.map +1 -0
- package/dist/src/_internal/platform/requestLogger/node/nullRequestLogger.d.ts +4 -4
- package/dist/src/_internal/platform/requestLogger/node/nullRequestLogger.d.ts.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/nullRequestLogger.js +1 -3
- package/dist/src/_internal/platform/requestLogger/node/nullRequestLogger.js.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts +4 -167
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.js +3 -139
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.js.map +1 -1
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +48 -6
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +192 -151
- package/package.json +70 -71
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/stream.d.ts +0 -182
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/stream.d.ts.map +0 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/stream.js +0 -558
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/stream.js.map +0 -1
|
@@ -12,14 +12,14 @@ class ChatWebSocketTelemetrySender {
|
|
|
12
12
|
"owner": "chrmarti",
|
|
13
13
|
"comment": "Report a successful WebSocket connection.",
|
|
14
14
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
15
|
-
"
|
|
15
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
16
16
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
17
17
|
"connectDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Time to establish the WebSocket connection in milliseconds", "isMeasurement": true }
|
|
18
18
|
}
|
|
19
19
|
*/
|
|
20
20
|
telemetryService.sendTelemetryEvent('websocket.connected', { github: true, microsoft: true }, {
|
|
21
21
|
conversationId: properties.conversationId,
|
|
22
|
-
|
|
22
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
23
23
|
gitHubRequestId: properties.gitHubRequestId,
|
|
24
24
|
}, {
|
|
25
25
|
connectDurationMs: properties.connectDurationMs,
|
|
@@ -31,20 +31,22 @@ class ChatWebSocketTelemetrySender {
|
|
|
31
31
|
"owner": "chrmarti",
|
|
32
32
|
"comment": "Report a failed WebSocket connection attempt.",
|
|
33
33
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
34
|
-
"
|
|
34
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
35
35
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
36
36
|
"error": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Error message for the failed connection" },
|
|
37
37
|
"connectDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Time until the connection error in milliseconds", "isMeasurement": true },
|
|
38
38
|
"responseStatusCode": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "HTTP response status code from the failed connection attempt", "isMeasurement": true },
|
|
39
|
-
"responseStatusText": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "HTTP response status text from the failed connection attempt" }
|
|
39
|
+
"responseStatusText": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "HTTP response status text from the failed connection attempt" },
|
|
40
|
+
"networkError": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "The underlying network error code and message from the dispatch layer" }
|
|
40
41
|
}
|
|
41
42
|
*/
|
|
42
43
|
telemetryService.sendTelemetryErrorEvent('websocket.connectError', { github: true, microsoft: true }, {
|
|
43
44
|
conversationId: properties.conversationId,
|
|
44
|
-
|
|
45
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
45
46
|
gitHubRequestId: properties.gitHubRequestId,
|
|
46
47
|
error: properties.error,
|
|
47
48
|
responseStatusText: properties.responseStatusText,
|
|
49
|
+
networkError: properties.networkError,
|
|
48
50
|
}, {
|
|
49
51
|
connectDurationMs: properties.connectDurationMs,
|
|
50
52
|
responseStatusCode: properties.responseStatusCode,
|
|
@@ -56,11 +58,13 @@ class ChatWebSocketTelemetrySender {
|
|
|
56
58
|
"owner": "chrmarti",
|
|
57
59
|
"comment": "Report a WebSocket connection close event.",
|
|
58
60
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
61
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
59
62
|
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
60
63
|
"previousTurnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Turn id of the previous request on this connection" },
|
|
61
64
|
"hadActiveRequest": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the previous request was still active when the new one began", "isMeasurement": true },
|
|
62
65
|
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
63
66
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
67
|
+
"modelId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Model identifier from the request body" },
|
|
64
68
|
"closeReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Human-readable description of the close code" },
|
|
65
69
|
"closeEventReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Close event reason string from server" },
|
|
66
70
|
"closeEventWasClean": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection closed cleanly" },
|
|
@@ -74,10 +78,12 @@ class ChatWebSocketTelemetrySender {
|
|
|
74
78
|
*/
|
|
75
79
|
telemetryService.sendTelemetryEvent('websocket.close', { github: true, microsoft: true }, {
|
|
76
80
|
conversationId: properties.conversationId,
|
|
81
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
77
82
|
turnId: properties.turnId,
|
|
78
83
|
previousTurnId: properties.previousTurnId,
|
|
79
84
|
requestId: properties.requestId,
|
|
80
85
|
gitHubRequestId: properties.gitHubRequestId,
|
|
86
|
+
modelId: properties.modelId,
|
|
81
87
|
closeReason: properties.closeReason,
|
|
82
88
|
closeEventReason: properties.closeEventReason,
|
|
83
89
|
closeEventWasClean: properties.closeEventWasClean,
|
|
@@ -97,11 +103,13 @@ class ChatWebSocketTelemetrySender {
|
|
|
97
103
|
"owner": "chrmarti",
|
|
98
104
|
"comment": "Report a runtime error on an established WebSocket connection.",
|
|
99
105
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
106
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
100
107
|
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
101
108
|
"previousTurnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Turn id of the previous request on this connection" },
|
|
102
109
|
"hadActiveRequest": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the previous request was still active when the new one began", "isMeasurement": true },
|
|
103
110
|
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
104
111
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
112
|
+
"modelId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Model identifier from the request body" },
|
|
105
113
|
"error": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Error message" },
|
|
106
114
|
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
107
115
|
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
@@ -112,10 +120,12 @@ class ChatWebSocketTelemetrySender {
|
|
|
112
120
|
*/
|
|
113
121
|
telemetryService.sendTelemetryErrorEvent('websocket.error', { github: true, microsoft: true }, {
|
|
114
122
|
conversationId: properties.conversationId,
|
|
123
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
115
124
|
turnId: properties.turnId,
|
|
116
125
|
previousTurnId: properties.previousTurnId,
|
|
117
126
|
requestId: properties.requestId,
|
|
118
127
|
gitHubRequestId: properties.gitHubRequestId,
|
|
128
|
+
modelId: properties.modelId,
|
|
119
129
|
error: properties.error,
|
|
120
130
|
}, {
|
|
121
131
|
hadActiveRequest: properties.hadActiveRequest ? 1 : 0,
|
|
@@ -132,7 +142,7 @@ class ChatWebSocketTelemetrySender {
|
|
|
132
142
|
"owner": "chrmarti",
|
|
133
143
|
"comment": "Report when a WebSocket connection is closed during setup before fully opening.",
|
|
134
144
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
135
|
-
"
|
|
145
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
136
146
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
137
147
|
"closeReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Human-readable description of the close code" },
|
|
138
148
|
"closeEventReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Close event reason string from server" },
|
|
@@ -143,7 +153,7 @@ class ChatWebSocketTelemetrySender {
|
|
|
143
153
|
*/
|
|
144
154
|
telemetryService.sendTelemetryErrorEvent('websocket.closeDuringSetup', { github: true, microsoft: true }, {
|
|
145
155
|
conversationId: properties.conversationId,
|
|
146
|
-
|
|
156
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
147
157
|
gitHubRequestId: properties.gitHubRequestId,
|
|
148
158
|
closeReason: properties.closeReason,
|
|
149
159
|
closeEventReason: properties.closeEventReason,
|
|
@@ -159,14 +169,21 @@ class ChatWebSocketTelemetrySender {
|
|
|
159
169
|
"owner": "chrmarti",
|
|
160
170
|
"comment": "Report when a request is sent over the WebSocket connection.",
|
|
161
171
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
172
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
162
173
|
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
163
174
|
"previousTurnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Turn id of the previous request on this connection" },
|
|
164
175
|
"hadActiveRequest": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the previous request was still active when the new one began", "isMeasurement": true },
|
|
165
176
|
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
166
177
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
178
|
+
"modelId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Model identifier from the request body" },
|
|
167
179
|
"statefulMarkerMatched": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection stateful marker matched the previous_response_id sent in the request", "isMeasurement": true },
|
|
168
180
|
"previousResponseIdUnset": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether previous_response_id was undefined in the request", "isMeasurement": true },
|
|
169
181
|
"hasCompactionData": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the request input contains compaction data", "isMeasurement": true },
|
|
182
|
+
"summarizedAtRoundIdSet": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether a summarized round ID was set in the request options", "isMeasurement": true },
|
|
183
|
+
"summarizedAtRoundIdMatched": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the summarized round ID matches the one stored on the connection", "isMeasurement": true },
|
|
184
|
+
"compactionThreshold": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Compaction threshold from context_management in the request body", "isMeasurement": true },
|
|
185
|
+
"tokenCountMax": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Maximum generated tokens", "isMeasurement": true },
|
|
186
|
+
"modelMaxPromptTokens": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Maximum prompt tokens for the model", "isMeasurement": true },
|
|
170
187
|
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
171
188
|
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
172
189
|
"sentMessageCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Character count of this sent message payload", "isMeasurement": true },
|
|
@@ -177,15 +194,22 @@ class ChatWebSocketTelemetrySender {
|
|
|
177
194
|
*/
|
|
178
195
|
telemetryService.sendTelemetryEvent('websocket.requestSent', { github: true, microsoft: true }, {
|
|
179
196
|
conversationId: properties.conversationId,
|
|
197
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
180
198
|
turnId: properties.turnId,
|
|
181
199
|
previousTurnId: properties.previousTurnId,
|
|
182
200
|
requestId: properties.requestId,
|
|
183
201
|
gitHubRequestId: properties.gitHubRequestId,
|
|
202
|
+
modelId: properties.modelId,
|
|
184
203
|
}, {
|
|
185
204
|
hadActiveRequest: properties.hadActiveRequest ? 1 : 0,
|
|
186
205
|
statefulMarkerMatched: properties.statefulMarkerMatched ? 1 : 0,
|
|
187
206
|
previousResponseIdUnset: properties.previousResponseIdUnset ? 1 : 0,
|
|
188
207
|
hasCompactionData: properties.hasCompactionData ? 1 : 0,
|
|
208
|
+
summarizedAtRoundIdSet: properties.summarizedAtRoundIdSet ? 1 : 0,
|
|
209
|
+
summarizedAtRoundIdMatched: properties.summarizedAtRoundIdMatched ? 1 : 0,
|
|
210
|
+
compactionThreshold: properties.compactionThreshold,
|
|
211
|
+
tokenCountMax: properties.tokenCountMax,
|
|
212
|
+
modelMaxPromptTokens: properties.modelMaxPromptTokens,
|
|
189
213
|
totalSentMessageCount: properties.totalSentMessageCount,
|
|
190
214
|
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
191
215
|
sentMessageCharacters: properties.sentMessageCharacters,
|
|
@@ -200,11 +224,13 @@ class ChatWebSocketTelemetrySender {
|
|
|
200
224
|
"owner": "chrmarti",
|
|
201
225
|
"comment": "Report when a received websocket message fails JSON parsing.",
|
|
202
226
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
227
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
203
228
|
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
204
229
|
"previousTurnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Turn id of the previous request on this connection" },
|
|
205
230
|
"hadActiveRequest": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the previous request was still active when the new one began", "isMeasurement": true },
|
|
206
231
|
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
207
232
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
233
|
+
"modelId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Model identifier from the request body" },
|
|
208
234
|
"error": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Parse error message" },
|
|
209
235
|
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
210
236
|
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
@@ -216,10 +242,12 @@ class ChatWebSocketTelemetrySender {
|
|
|
216
242
|
*/
|
|
217
243
|
telemetryService.sendTelemetryErrorEvent('websocket.messageParseError', { github: true, microsoft: true }, {
|
|
218
244
|
conversationId: properties.conversationId,
|
|
245
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
219
246
|
turnId: properties.turnId,
|
|
220
247
|
previousTurnId: properties.previousTurnId,
|
|
221
248
|
requestId: properties.requestId,
|
|
222
249
|
gitHubRequestId: properties.gitHubRequestId,
|
|
250
|
+
modelId: properties.modelId,
|
|
223
251
|
error: properties.error,
|
|
224
252
|
}, {
|
|
225
253
|
hadActiveRequest: properties.hadActiveRequest ? 1 : 0,
|
|
@@ -237,15 +265,23 @@ class ChatWebSocketTelemetrySender {
|
|
|
237
265
|
"owner": "chrmarti",
|
|
238
266
|
"comment": "Report terminal outcome for a websocket request.",
|
|
239
267
|
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
268
|
+
"initiatingRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the request that initiated the connection" },
|
|
240
269
|
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
241
270
|
"previousTurnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Turn id of the previous request on this connection" },
|
|
242
271
|
"hadActiveRequest": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the previous request was still active when the new one began", "isMeasurement": true },
|
|
243
272
|
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
244
273
|
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
274
|
+
"modelId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Model identifier from the request body" },
|
|
245
275
|
"requestOutcome": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Terminal outcome of the websocket request" },
|
|
246
276
|
"statefulMarkerMatched": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection stateful marker matched the previous_response_id sent in the request", "isMeasurement": true },
|
|
247
277
|
"previousResponseIdUnset": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether previous_response_id was undefined in the request", "isMeasurement": true },
|
|
248
278
|
"hasCompactionData": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the request input contains compaction data", "isMeasurement": true },
|
|
279
|
+
"summarizedAtRoundIdSet": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether a summarized round ID was set in the request options", "isMeasurement": true },
|
|
280
|
+
"summarizedAtRoundIdMatched": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the summarized round ID matches the one stored on the connection", "isMeasurement": true },
|
|
281
|
+
"compactionThreshold": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Compaction threshold from context_management in the request body", "isMeasurement": true },
|
|
282
|
+
"promptTokenCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of prompt tokens, locally counted", "isMeasurement": true },
|
|
283
|
+
"tokenCountMax": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Maximum generated tokens", "isMeasurement": true },
|
|
284
|
+
"modelMaxPromptTokens": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Maximum prompt tokens for the model", "isMeasurement": true },
|
|
249
285
|
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
250
286
|
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
251
287
|
"totalSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters sent over this connection", "isMeasurement": true },
|
|
@@ -264,10 +300,12 @@ class ChatWebSocketTelemetrySender {
|
|
|
264
300
|
*/
|
|
265
301
|
telemetryService.sendTelemetryEvent('websocket.requestOutcome', { github: true, microsoft: true }, {
|
|
266
302
|
conversationId: properties.conversationId,
|
|
303
|
+
initiatingRequestId: properties.initiatingRequestId,
|
|
267
304
|
turnId: properties.turnId,
|
|
268
305
|
previousTurnId: properties.previousTurnId,
|
|
269
306
|
requestId: properties.requestId,
|
|
270
307
|
gitHubRequestId: properties.gitHubRequestId,
|
|
308
|
+
modelId: properties.modelId,
|
|
271
309
|
requestOutcome: properties.requestOutcome,
|
|
272
310
|
closeReason: properties.closeReason,
|
|
273
311
|
serverErrorMessage: properties.serverErrorMessage,
|
|
@@ -277,6 +315,12 @@ class ChatWebSocketTelemetrySender {
|
|
|
277
315
|
statefulMarkerMatched: properties.statefulMarkerMatched ? 1 : 0,
|
|
278
316
|
previousResponseIdUnset: properties.previousResponseIdUnset ? 1 : 0,
|
|
279
317
|
hasCompactionData: properties.hasCompactionData ? 1 : 0,
|
|
318
|
+
summarizedAtRoundIdSet: properties.summarizedAtRoundIdSet ? 1 : 0,
|
|
319
|
+
summarizedAtRoundIdMatched: properties.summarizedAtRoundIdMatched ? 1 : 0,
|
|
320
|
+
compactionThreshold: properties.compactionThreshold,
|
|
321
|
+
promptTokenCount: properties.promptTokenCount,
|
|
322
|
+
tokenCountMax: properties.tokenCountMax,
|
|
323
|
+
modelMaxPromptTokens: properties.modelMaxPromptTokens,
|
|
280
324
|
totalSentMessageCount: properties.totalSentMessageCount,
|
|
281
325
|
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
282
326
|
totalSentCharacters: properties.totalSentCharacters,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatWebSocketTelemetry.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/networking/node/chatWebSocketTelemetry.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;
|
|
1
|
+
{"version":3,"file":"chatWebSocketTelemetry.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/networking/node/chatWebSocketTelemetry.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAmHhG,MAAa,4BAA4B;IAEjC,MAAM,CAAC,sBAAsB,CACnC,gBAAmC,EACnC,UAAsD;QAEtD;;;;;;;;;UASE;QACF,gBAAgB,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;YAC7F,cAAc,EAAE,UAAU,CAAC,cAAc;YACzC,mBAAmB,EAAE,UAAU,CAAC,mBAAmB;YACnD,eAAe,EAAE,UAAU,CAAC,eAAe;SAC3C,EAAE;YACF,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;SAC/C,CAAC,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,yBAAyB,CACtC,gBAAmC,EACnC,UAAyD;QAEzD;;;;;;;;;;;;;UAaE;QACF,gBAAgB,CAAC,uBAAuB,CAAC,wBAAwB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;YACrG,cAAc,EAAE,UAAU,CAAC,cAAc;YACzC,mBAAmB,EAAE,UAAU,CAAC,mBAAmB;YACnD,eAAe,EAAE,UAAU,CAAC,eAAe;YAC3C,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;YACjD,YAAY,EAAE,UAAU,CAAC,YAAY;SACrC,EAAE;YACF,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BAAmB,EAAE,UAAU,CAAC,mBAAmB;YACnD,uBAAuB,EAAE,UAAU,CAAC,uBAAuB;YAC3D,uBAAuB,EAAE,UAAU,CAAC,uBAAuB;YAC3D,2BAA2B,EAAE,UAAU,CAAC,2BAA2B;YACnE,qBAAqB,EAAE,UAAU,CAAC,qBAAqB;YACvD,yBAAyB,EAAE,UAAU,CAAC,yBAAyB;YAC/D,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;YACrD,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;YAC/C,SAAS,EAAE,UAAU,CAAC,SAAS;SAC/B,CAAC,CAAC;IACJ,CAAC;CACD;AAzWD,oEAyWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genAiEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiEvents.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAAqC,MAAM,yBAAyB,CAAC;AAExG;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE;IACR,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,EACD,QAAQ,EAAE;IACT,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,EACb,KAAK,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC,IAAI,
|
|
1
|
+
{"version":3,"file":"genAiEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiEvents.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAAqC,MAAM,yBAAyB,CAAC;AAExG;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE;IACR,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,EACD,QAAQ,EAAE;IACT,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,EACb,KAAK,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC,IAAI,CA8CN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GACjB,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,CAAC,EAAE,MAAM,GACZ,IAAI,CAQN;AAED,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,Y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AAM,EACtB,SAAS,EAAE,MAAM,GACf,IAAI,CAQN;AAED,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GACf,IAAI,CAON"}
|
|
@@ -53,12 +53,20 @@ function emitInferenceDetailsEvent(otel, request, response, error) {
|
|
|
53
53
|
attributes[genAiAttributes_1.StdAttr.ERROR_TYPE] = error.type;
|
|
54
54
|
}
|
|
55
55
|
// Full content capture with truncation to prevent OTLP batch failures
|
|
56
|
+
// Normalize to OTel GenAI semantic convention format
|
|
56
57
|
if (otel.config.captureContent) {
|
|
57
58
|
if (request.messages !== undefined) {
|
|
58
|
-
|
|
59
|
+
const msgs = Array.isArray(request.messages) ? request.messages : undefined;
|
|
60
|
+
attributes[genAiAttributes_1.GenAiAttr.INPUT_MESSAGES] = (0, messageFormatters_1.truncateForOTel)(JSON.stringify(msgs ? (0, messageFormatters_1.normalizeProviderMessages)(msgs) : request.messages));
|
|
59
61
|
}
|
|
60
62
|
if (request.systemMessage !== undefined) {
|
|
61
|
-
|
|
63
|
+
const systemText = typeof request.systemMessage === 'string'
|
|
64
|
+
? request.systemMessage
|
|
65
|
+
: JSON.stringify(request.systemMessage);
|
|
66
|
+
const systemInstructions = (0, messageFormatters_1.toSystemInstructions)(systemText);
|
|
67
|
+
if (systemInstructions !== undefined) {
|
|
68
|
+
attributes[genAiAttributes_1.GenAiAttr.SYSTEM_INSTRUCTIONS] = (0, messageFormatters_1.truncateForOTel)(JSON.stringify(systemInstructions));
|
|
69
|
+
}
|
|
62
70
|
}
|
|
63
71
|
if (request.tools !== undefined) {
|
|
64
72
|
attributes[genAiAttributes_1.GenAiAttr.TOOL_DEFINITIONS] = (0, messageFormatters_1.truncateForOTel)(JSON.stringify(request.tools));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genAiEvents.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiEvents.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAUhG,
|
|
1
|
+
{"version":3,"file":"genAiEvents.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiEvents.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAUhG,8DAgEC;AAKD,sDAYC;AAED,8CAcC;AAED,gDAcC;AAID,sDAsBC;AAED,0DAoBC;AAED,kDAoBC;AAED,sDAoBC;AAED,sDAcC;AAED,kEAYC;AAnPD,uDAA2E;AAC3E,2DAAuG;AAEvG,mEAAwG;AAExG;;GAEG;AACH,SAAgB,yBAAyB,CACxC,IAAkB,EAClB,OAOC,EACD,QAMa,EACb,KAAyC;IAEzC,MAAM,UAAU,GAA4B;QAC3C,YAAY,EAAE,2CAA2C;QACzD,CAAC,2BAAS,CAAC,cAAc,CAAC,EAAE,oCAAkB,CAAC,IAAI;QACnD,CAAC,2BAAS,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,KAAK;KACxC,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACd,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YAAC,UAAU,CAAC,2BAAS,CAAC,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;QAAC,CAAC;QAC9E,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;YAAC,UAAU,CAAC,2BAAS,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;QAAC,CAAC;QACrE,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;YAAC,UAAU,CAAC,2BAAS,CAAC,uBAAuB,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC;QAAC,CAAC;QACvG,IAAI,QAAQ,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAAC,UAAU,CAAC,2BAAS,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;QAAC,CAAC;QAC5G,IAAI,QAAQ,CAAC,YAAY,KAAK,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C1C,QAAQ,EAAE,MAAM;QAChB,aAAa,EAAE,WAAW;QAC1B,iBAAiB,EAAE,cAAc;QACjC,YAAY,EAAE,SAAS;KACvB,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,2BAA2B,CAC1C,IAAkB,EAClB,YAAoB,EACpB,KAAa,EACb,SAAiB;IAEjB,IAAI,CAAC,aAAa,CAAC,sCAAsC,YAAY,EAAE,EAAE;QACxE,YAAY,EAAE,mCAAmC;QACjD,eAAe,EAAE,YAAY;QAC7B,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,SAAS;KACvB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CopilotChatAttr, GenAiAttr, GenAiOperationName, GenAiProviderName, GenAiTokenType, GenAiToolType, StdAttr } from './genAiAttributes';
|
|
2
2
|
export { emitAgentTurnEvent, emitInferenceDetailsEvent, emitSessionStartEvent, emitToolCallEvent } from './genAiEvents';
|
|
3
3
|
export { GenAiMetrics } from './genAiMetrics';
|
|
4
|
-
export { toInputMessages, toOutputMessages, toSystemInstructions, toToolDefinitions, truncateForOTel } from './messageFormatters';
|
|
4
|
+
export { normalizeProviderMessages, toInputMessages, toOutputMessages, toSystemInstructions, toToolDefinitions, truncateForOTel } from './messageFormatters';
|
|
5
5
|
export { NoopOTelService } from './noopOtelService';
|
|
6
6
|
export { resolveOTelConfig, DEFAULT_OTLP_ENDPOINT, type OTelConfig, type OTelConfigInput } from './otelConfig';
|
|
7
7
|
export { IOTelService, SpanKind, SpanStatusCode, type ICompletedSpanData, type ISpanEventData, type ISpanEventRecord, type ISpanHandle, type OTelModelOptions, type SpanOptions, type TraceContext } from './otelService';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE,iBAAiB,EAAE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M,yBAAyB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.workspaceMetadataToOTelAttributes = exports.resolveWorkspaceOTelMetadata = exports.IOTelService = exports.DEFAULT_OTLP_ENDPOINT = exports.resolveOTelConfig = exports.NoopOTelService = exports.truncateForOTel = exports.toToolDefinitions = exports.toSystemInstructions = exports.toOutputMessages = exports.toInputMessages = exports.GenAiMetrics = exports.emitToolCallEvent = exports.emitSessionStartEvent = exports.emitInferenceDetailsEvent = exports.emitAgentTurnEvent = exports.StdAttr = exports.GenAiToolType = exports.GenAiTokenType = exports.GenAiProviderName = exports.GenAiOperationName = exports.GenAiAttr = exports.CopilotChatAttr = void 0;
|
|
7
|
+
exports.workspaceMetadataToOTelAttributes = exports.resolveWorkspaceOTelMetadata = exports.IOTelService = exports.DEFAULT_OTLP_ENDPOINT = exports.resolveOTelConfig = exports.NoopOTelService = exports.truncateForOTel = exports.toToolDefinitions = exports.toSystemInstructions = exports.toOutputMessages = exports.toInputMessages = exports.normalizeProviderMessages = exports.GenAiMetrics = exports.emitToolCallEvent = exports.emitSessionStartEvent = exports.emitInferenceDetailsEvent = exports.emitAgentTurnEvent = exports.StdAttr = exports.GenAiToolType = exports.GenAiTokenType = exports.GenAiProviderName = exports.GenAiOperationName = exports.GenAiAttr = exports.CopilotChatAttr = void 0;
|
|
8
8
|
var genAiAttributes_1 = require("./genAiAttributes");
|
|
9
9
|
Object.defineProperty(exports, "CopilotChatAttr", { enumerable: true, get: function () { return genAiAttributes_1.CopilotChatAttr; } });
|
|
10
10
|
Object.defineProperty(exports, "GenAiAttr", { enumerable: true, get: function () { return genAiAttributes_1.GenAiAttr; } });
|
|
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "emitToolCallEvent", { enumerable: true, get: fun
|
|
|
21
21
|
var genAiMetrics_1 = require("./genAiMetrics");
|
|
22
22
|
Object.defineProperty(exports, "GenAiMetrics", { enumerable: true, get: function () { return genAiMetrics_1.GenAiMetrics; } });
|
|
23
23
|
var messageFormatters_1 = require("./messageFormatters");
|
|
24
|
+
Object.defineProperty(exports, "normalizeProviderMessages", { enumerable: true, get: function () { return messageFormatters_1.normalizeProviderMessages; } });
|
|
24
25
|
Object.defineProperty(exports, "toInputMessages", { enumerable: true, get: function () { return messageFormatters_1.toInputMessages; } });
|
|
25
26
|
Object.defineProperty(exports, "toOutputMessages", { enumerable: true, get: function () { return messageFormatters_1.toOutputMessages; } });
|
|
26
27
|
Object.defineProperty(exports, "toSystemInstructions", { enumerable: true, get: function () { return messageFormatters_1.toSystemInstructions; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/index.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,qDAA8I;AAArI,kHAAA,eAAe,OAAA;AAAE,4GAAA,SAAS,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAAE,iHAAA,cAAc,OAAA;AAAE,gHAAA,aAAa,OAAA;AAAE,0GAAA,OAAO,OAAA;AAClH,6CAAwH;AAA/G,iHAAA,kBAAkB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,oHAAA,qBAAqB,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AAChG,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/index.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,qDAA8I;AAArI,kHAAA,eAAe,OAAA;AAAE,4GAAA,SAAS,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAAE,iHAAA,cAAc,OAAA;AAAE,gHAAA,aAAa,OAAA;AAAE,0GAAA,OAAO,OAAA;AAClH,6CAAwH;AAA/G,iHAAA,kBAAkB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,oHAAA,qBAAqB,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AAChG,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,yDAA6J;AAApJ,8HAAA,yBAAyB,OAAA;AAAE,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAAE,sHAAA,iBAAiB,OAAA;AAAE,oHAAA,eAAe,OAAA;AAC/H,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,2CAA+G;AAAtG,+GAAA,iBAAiB,OAAA;AAAE,mHAAA,qBAAqB,OAAA;AACjD,6CAA0N;AAAjN,2GAAA,YAAY,OAAA;AACrB,iEAAsI;AAA7H,qIAAA,4BAA4B,OAAA;AAAE,0IAAA,iCAAiC,OAAA"}
|
|
@@ -21,7 +21,7 @@ export type OTelMessagePart = {
|
|
|
21
21
|
} | {
|
|
22
22
|
type: 'tool_call_response';
|
|
23
23
|
id: string;
|
|
24
|
-
|
|
24
|
+
response: unknown;
|
|
25
25
|
} | {
|
|
26
26
|
type: 'reasoning';
|
|
27
27
|
content: string;
|
|
@@ -38,6 +38,7 @@ export interface OTelToolDefinition {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Convert an array of internal messages to OTel input message format.
|
|
41
|
+
* Handles OpenAI format (tool_calls, tool_call_id) natively.
|
|
41
42
|
*/
|
|
42
43
|
export declare function toInputMessages(messages: ReadonlyArray<{
|
|
43
44
|
role?: string;
|
|
@@ -49,6 +50,7 @@ export declare function toInputMessages(messages: ReadonlyArray<{
|
|
|
49
50
|
arguments: string;
|
|
50
51
|
};
|
|
51
52
|
}>;
|
|
53
|
+
tool_call_id?: string;
|
|
52
54
|
}>): OTelChatMessage[];
|
|
53
55
|
/**
|
|
54
56
|
* Convert model response choices to OTel output message format.
|
|
@@ -71,6 +73,16 @@ export declare function toOutputMessages(choices: ReadonlyArray<{
|
|
|
71
73
|
* Convert system message to OTel system instruction format.
|
|
72
74
|
*/
|
|
73
75
|
export declare function toSystemInstructions(systemMessage: string | undefined): OTelSystemInstruction | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Normalize provider-specific messages (Anthropic content blocks, OpenAI tool messages)
|
|
78
|
+
* to OTel GenAI semantic convention format.
|
|
79
|
+
*
|
|
80
|
+
* Handles:
|
|
81
|
+
* - Anthropic content block arrays: tool_use → tool_call, tool_result → tool_call_response
|
|
82
|
+
* - OpenAI format: tool_calls, role=tool with tool_call_id
|
|
83
|
+
* - Plain string content
|
|
84
|
+
*/
|
|
85
|
+
export declare function normalizeProviderMessages(messages: ReadonlyArray<Record<string, unknown>>): OTelChatMessage[];
|
|
74
86
|
/**
|
|
75
87
|
* Convert tool definitions to OTel tool definition format.
|
|
76
88
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatters.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/messageFormatters.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,MAAkC,GAAG,MAAM,CAMpG;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,
|
|
1
|
+
{"version":3,"file":"messageFormatters.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/messageFormatters.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,MAAkC,GAAG,MAAM,CAMpG;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE7E,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,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CAAA;KAAE,CAAC;CACxE,CAAC,GAAG,SAAS,GAAG,kBAAkB,EAAE,GAAG,SAAS,CAYhD"}
|
|
@@ -8,6 +8,7 @@ exports.truncateForOTel = truncateForOTel;
|
|
|
8
8
|
exports.toInputMessages = toInputMessages;
|
|
9
9
|
exports.toOutputMessages = toOutputMessages;
|
|
10
10
|
exports.toSystemInstructions = toSystemInstructions;
|
|
11
|
+
exports.normalizeProviderMessages = normalizeProviderMessages;
|
|
11
12
|
exports.toToolDefinitions = toToolDefinitions;
|
|
12
13
|
/**
|
|
13
14
|
* Converts internal message types to OTel GenAI JSON schema format.
|
|
@@ -33,10 +34,16 @@ function truncateForOTel(value, maxLength = MAX_OTEL_ATTRIBUTE_LENGTH) {
|
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Convert an array of internal messages to OTel input message format.
|
|
37
|
+
* Handles OpenAI format (tool_calls, tool_call_id) natively.
|
|
36
38
|
*/
|
|
37
39
|
function toInputMessages(messages) {
|
|
38
40
|
return messages.map(msg => {
|
|
39
41
|
const parts = [];
|
|
42
|
+
// OpenAI tool-result message (role=tool): map to tool_call_response
|
|
43
|
+
if (msg.role === 'tool' && msg.tool_call_id) {
|
|
44
|
+
parts.push({ type: 'tool_call_response', id: msg.tool_call_id, response: msg.content ?? '' });
|
|
45
|
+
return { role: msg.role, parts };
|
|
46
|
+
}
|
|
40
47
|
if (msg.content) {
|
|
41
48
|
parts.push({ type: 'text', content: msg.content });
|
|
42
49
|
}
|
|
@@ -103,6 +110,97 @@ function toSystemInstructions(systemMessage) {
|
|
|
103
110
|
}
|
|
104
111
|
return [{ type: 'text', content: systemMessage }];
|
|
105
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Normalize provider-specific messages (Anthropic content blocks, OpenAI tool messages)
|
|
115
|
+
* to OTel GenAI semantic convention format.
|
|
116
|
+
*
|
|
117
|
+
* Handles:
|
|
118
|
+
* - Anthropic content block arrays: tool_use → tool_call, tool_result → tool_call_response
|
|
119
|
+
* - OpenAI format: tool_calls, role=tool with tool_call_id
|
|
120
|
+
* - Plain string content
|
|
121
|
+
*/
|
|
122
|
+
function normalizeProviderMessages(messages) {
|
|
123
|
+
return messages.map(msg => {
|
|
124
|
+
const role = msg.role;
|
|
125
|
+
const parts = [];
|
|
126
|
+
const content = msg.content;
|
|
127
|
+
// OpenAI tool-result message
|
|
128
|
+
if (role === 'tool' && typeof msg.tool_call_id === 'string') {
|
|
129
|
+
parts.push({ type: 'tool_call_response', id: msg.tool_call_id, response: content ?? '' });
|
|
130
|
+
return { role, parts };
|
|
131
|
+
}
|
|
132
|
+
if (typeof content === 'string' && content.length > 0) {
|
|
133
|
+
parts.push({ type: 'text', content });
|
|
134
|
+
}
|
|
135
|
+
else if (Array.isArray(content)) {
|
|
136
|
+
// Anthropic content block array
|
|
137
|
+
for (const block of content) {
|
|
138
|
+
if (!block || typeof block !== 'object') {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const b = block;
|
|
142
|
+
switch (b.type) {
|
|
143
|
+
case 'text':
|
|
144
|
+
if (typeof b.text === 'string') {
|
|
145
|
+
parts.push({ type: 'text', content: b.text });
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
case 'tool_use':
|
|
149
|
+
parts.push({
|
|
150
|
+
type: 'tool_call',
|
|
151
|
+
id: String(b.id ?? ''),
|
|
152
|
+
name: String(b.name ?? ''),
|
|
153
|
+
arguments: b.input,
|
|
154
|
+
});
|
|
155
|
+
break;
|
|
156
|
+
case 'tool_result':
|
|
157
|
+
parts.push({
|
|
158
|
+
type: 'tool_call_response',
|
|
159
|
+
id: String(b.tool_use_id ?? ''),
|
|
160
|
+
response: b.content ?? '',
|
|
161
|
+
});
|
|
162
|
+
break;
|
|
163
|
+
case 'thinking':
|
|
164
|
+
if (typeof b.thinking === 'string') {
|
|
165
|
+
parts.push({ type: 'reasoning', content: b.thinking });
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
default:
|
|
169
|
+
// Unknown block type — include as text fallback
|
|
170
|
+
parts.push({ type: 'text', content: JSON.stringify(b) });
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// OpenAI tool_calls
|
|
176
|
+
const toolCalls = msg.tool_calls;
|
|
177
|
+
if (Array.isArray(toolCalls)) {
|
|
178
|
+
for (const tc of toolCalls) {
|
|
179
|
+
if (!tc || typeof tc !== 'object') {
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const call = tc;
|
|
183
|
+
const fn = call.function;
|
|
184
|
+
if (fn) {
|
|
185
|
+
let args;
|
|
186
|
+
try {
|
|
187
|
+
args = typeof fn.arguments === 'string' ? JSON.parse(fn.arguments) : fn.arguments;
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
args = fn.arguments;
|
|
191
|
+
}
|
|
192
|
+
parts.push({
|
|
193
|
+
type: 'tool_call',
|
|
194
|
+
id: String(call.id ?? ''),
|
|
195
|
+
name: String(fn.name ?? ''),
|
|
196
|
+
arguments: args,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return { role, parts };
|
|
202
|
+
});
|
|
203
|
+
}
|
|
106
204
|
/**
|
|
107
205
|
* Convert tool definitions to OTel tool definition format.
|
|
108
206
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatters.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/messageFormatters.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAmBhG,0CAMC;
|
|
1
|
+
{"version":3,"file":"messageFormatters.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/messageFormatters.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAmBhG,0CAMC;AA8BD,0CA6BC;AAKD,4CA+BC;AAKD,oDAKC;AAWD,8DA2EC;AAKD,8CAeC;AA1OD;;;;GAIG;AAEH;;;;GAIG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