@@ -12,7 +12,7 @@ import { IModelAPIResponse } from '../../../platform/endpoint/common/endpointPro
1212import { getAllStatefulMarkersAndIndicies } from '../../../platform/endpoint/common/statefulMarkerContainer' ;
1313import { ILogService } from '../../../platform/log/common/logService' ;
1414import { messageToMarkdown } from '../../../platform/log/common/messageStringify' ;
15- import { IResponseDelta } from '../../../platform/networking/common/fetch' ;
15+ import { IResponseDelta , isOpenAiFunctionTool } from '../../../platform/networking/common/fetch' ;
1616import { IEndpointBody } from '../../../platform/networking/common/networking' ;
1717import { CapturingToken } from '../../../platform/requestLogger/common/capturingToken' ;
1818import { AbstractRequestLogger , ChatRequestScheme , ILoggedElementInfo , ILoggedRequestInfo , ILoggedToolCall , LoggedInfo , LoggedInfoKind , LoggedRequest , LoggedRequestKind } from '../../../platform/requestLogger/node/requestLogger' ;
@@ -589,7 +589,7 @@ export class RequestLogger extends AbstractRequestLogger {
589589 }
590590
591591 result . push ( `## Metadata` ) ;
592- result . push ( `~~~ ` ) ;
592+ result . push ( `<pre><code> ` ) ;
593593
594594 if ( typeof entry . chatEndpoint . urlOrRequestMetadata === 'string' ) {
595595 result . push ( `url : ${ entry . chatEndpoint . urlOrRequestMetadata } ` ) ;
@@ -629,9 +629,15 @@ export class RequestLogger extends AbstractRequestLogger {
629629 result . push ( `serverRequestId : ${ entry . result . serverRequestId } ` ) ;
630630 }
631631 if ( entry . chatParams . body ?. tools ) {
632- result . push ( `tools : ${ JSON . stringify ( entry . chatParams . body . tools , undefined , 4 ) } ` ) ;
632+ const toolNames = entry . chatParams . body . tools . map ( t => isOpenAiFunctionTool ( t ) ? t . function . name : t . name ) ;
633+ const numToolsString = `(${ toolNames . length } )` ;
634+ result . push (
635+ `<details>` ,
636+ `<summary>tools ${ numToolsString } ${ ' ' . repeat ( 9 - numToolsString . length ) } : ${ toolNames . join ( ', ' ) } </summary>${ JSON . stringify ( entry . chatParams . body . tools , undefined , 4 ) } ` ,
637+ `</details>`
638+ ) ;
633639 }
634- result . push ( `~~~ ` ) ;
640+ result . push ( `</code></pre> ` ) ;
635641
636642 result . push ( `## Request Messages` ) ;
637643 for ( const message of entry . chatParams . messages ) {
0 commit comments