File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -353,12 +353,22 @@ export async function generateText({
353
353
baseURL : endpoint ,
354
354
fetch : async ( url : string , options : any ) => {
355
355
const fetching = await runtime . fetch ( url , options ) ;
356
- if ( process . env . ETERNAL_AI_LOG_REQUEST ) {
357
- elizaLogger . info ( "Request data: " , JSON . stringify ( options , null , 2 ) ) ;
356
+ if (
357
+ parseBooleanFromText (
358
+ runtime . getSetting ( "ETERNAL_AI_LOG_REQUEST" )
359
+ )
360
+ ) {
361
+ elizaLogger . info (
362
+ "Request data: " ,
363
+ JSON . stringify ( options , null , 2 )
364
+ ) ;
358
365
const clonedResponse = fetching . clone ( ) ;
359
- clonedResponse . json ( ) . then ( data => {
360
- elizaLogger . info ( "Response data: " , JSON . stringify ( data , null , 2 ) ) ;
361
- } )
366
+ clonedResponse . json ( ) . then ( ( data ) => {
367
+ elizaLogger . info (
368
+ "Response data: " ,
369
+ JSON . stringify ( data , null , 2 )
370
+ ) ;
371
+ } ) ;
362
372
}
363
373
return fetching ;
364
374
} ,
You can’t perform that action at this time.
0 commit comments