File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ export class ZgsmAiHandler extends BaseProvider implements SingleCompletionHandl
164164
165165 let stream
166166 try {
167+ this . logger . info ( `[RequestID]:` , requestId )
167168 const { data : _stream , response } = await this . client . chat . completions
168169 . create (
169170 requestOptions ,
@@ -172,6 +173,7 @@ export class ZgsmAiHandler extends BaseProvider implements SingleCompletionHandl
172173 } ) ,
173174 )
174175 . withResponse ( )
176+ this . logger . info ( `[ResponseID]:` , response . headers . get ( "x-request-id" ) )
175177 stream = _stream
176178 this . curStream = _stream
177179 if ( this . options . zgsmModelId === autoModeModelId ) {
@@ -200,12 +202,14 @@ export class ZgsmAiHandler extends BaseProvider implements SingleCompletionHandl
200202
201203 let response
202204 try {
205+ this . logger . info ( `[RequestID]:` , requestId )
203206 response = await this . client . chat . completions . create (
204207 requestOptions ,
205208 Object . assign ( isAzureAiInference ? { path : OPENAI_AZURE_AI_INFERENCE_PATH } : { } , {
206209 headers : _headers ,
207210 } ) ,
208211 )
212+ this . logger . info ( `[ResponseId]:` , response . _request_id )
209213 } catch ( error ) {
210214 throw handleOpenAIError ( error , this . providerName )
211215 }
@@ -217,7 +221,6 @@ export class ZgsmAiHandler extends BaseProvider implements SingleCompletionHandl
217221
218222 yield this . processUsageMetrics ( response . usage , modelInfo )
219223 }
220- this . logger . info ( `[RequestID]:` , requestId )
221224 }
222225
223226 protected processUsageMetrics ( usage : any , _modelInfo ?: ModelInfo ) : ApiStreamUsageChunk {
You can’t perform that action at this time.
0 commit comments