Skip to content

Commit c47c2dc

Browse files
committed
quick refactor
1 parent 78d3d35 commit c47c2dc

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

packages/core/src/utils/anthropic-ai/streaming.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import type { AnthropicAiStreamingEvent } from './types';
1616
*/
1717

1818
interface StreamingState {
19-
/** Types of events encountered in the stream. */
20-
eventTypes: string[];
2119
/** Collected response text fragments (for output recording). */
2220
responseTexts: string[];
2321
/** Reasons for finishing the response, as reported by the API. */
@@ -52,8 +50,6 @@ function isErrorEvent(
5250
span: Span,
5351
): boolean {
5452
if ('type' in event && typeof event.type === 'string') {
55-
state.eventTypes.push(event.type);
56-
5753
// If the event is an error, set the span status and capture the error
5854
// These error events are not rejected by the API by default, but are sent as metadata of the response
5955
if (event.type === 'error') {
@@ -129,7 +125,6 @@ function processEvent(
129125
span: Span,
130126
): void {
131127
if (!(event && typeof event === 'object')) {
132-
state.eventTypes.push('unknown:non-object');
133128
return;
134129
}
135130

@@ -150,7 +145,6 @@ export async function* instrumentStream(
150145
recordOutputs: boolean,
151146
): AsyncGenerator<AnthropicAiStreamingEvent, void, unknown> {
152147
const state: StreamingState = {
153-
eventTypes: [],
154148
responseTexts: [],
155149
finishReasons: [],
156150
responseId: '',

0 commit comments

Comments
 (0)