|
1 | | -import { GalileoLogger } from '../galileo-logger'; |
2 | | -import { StreamingMetrics } from './metrics'; |
3 | | -import { |
| 1 | +import type { GalileoLogger } from '../galileo-logger'; |
| 2 | +import type { StreamingMetrics } from './metrics'; |
| 3 | +import type { |
4 | 4 | LlmSpanAllowedInputType, |
5 | 5 | LlmSpanAllowedOutputType |
6 | 6 | } from '../../types/logging/step.types'; |
7 | | -import { Span } from '../../types/logging/span.types'; |
| 7 | +import type { Span } from '../../types/logging/span.types'; |
8 | 8 | import { Trace } from '../../types/logging/trace.types'; |
9 | 9 | import type { ToolDefinition } from './base-streaming-adapter'; |
10 | 10 |
|
11 | | -/** |
12 | | - * Extended logger interface with streaming update methods |
13 | | - * These methods are mocked and will be replaced when streaming mode PR is merged |
14 | | - */ |
15 | | -export interface GalileoLoggerWithStreaming extends GalileoLogger { |
16 | | - _updateSpanStreaming?(span: Span, output: LlmSpanAllowedOutputType): void; |
17 | | - _updateTraceStreaming?( |
18 | | - trace: Trace, |
19 | | - output: LlmSpanAllowedOutputType, |
20 | | - isComplete?: boolean |
21 | | - ): void; |
22 | | -} |
23 | | - |
24 | 11 | /** |
25 | 12 | * Configuration for streaming finalization |
26 | 13 | */ |
@@ -114,21 +101,13 @@ export class StreamingFinalizer { |
114 | 101 | return; |
115 | 102 | } |
116 | 103 |
|
117 | | - // Type guard to check if logger has streaming methods |
118 | | - const loggerWithStreaming = this.logger as GalileoLoggerWithStreaming; |
119 | | - |
120 | | - // TO-DO: After logger PR merged, substitute for actual implementation. |
| 104 | + // Call streaming update methods (mock implementations in GalileoLogger) |
121 | 105 | if (currentParent instanceof Trace) { |
122 | | - // Mock implementation - assumes _updateTraceStreaming exists in another branch/PR |
123 | | - loggerWithStreaming._updateTraceStreaming?.( |
124 | | - currentParent, |
125 | | - output, |
126 | | - false |
127 | | - ); |
| 106 | + // Update trace with partial output during streaming |
| 107 | + this.logger._updateTraceStreaming(currentParent, output, false); |
128 | 108 | } else { |
129 | | - // Mock implementation - assumes _updateSpanStreaming exists in another branch/PR |
130 | | - // currentParent is a Span (WorkflowSpan, AgentSpan, etc.) |
131 | | - loggerWithStreaming._updateSpanStreaming?.(currentParent as Span, output); |
| 109 | + // currentParent is a Span (WorkflowSpan, AgentSpan, LlmSpan, etc.) |
| 110 | + this.logger._updateSpanStreaming(currentParent as Span, output); |
132 | 111 | } |
133 | 112 | } |
134 | 113 | } |
0 commit comments