@@ -11,10 +11,12 @@ import { ConfigKey, IConfigurationService } from '../../../../platform/configura
1111import { modelCanUseImageURL } from '../../../../platform/endpoint/common/chatModelCapabilities' ;
1212import { IImageService } from '../../../../platform/image/common/imageService' ;
1313import { ILogService } from '../../../../platform/log/common/logService' ;
14+ import { IPromptPathRepresentationService } from '../../../../platform/prompts/common/promptPathRepresentationService' ;
1415import { IExperimentationService } from '../../../../platform/telemetry/common/nullExperimentationService' ;
1516import { getMimeType } from '../../../../util/common/imageUtils' ;
1617import { Uri } from '../../../../vscodeTypes' ;
1718import { IPromptEndpoint } from '../base/promptRenderer' ;
19+ import { Tag } from '../base/tag' ;
1820
1921export interface ImageProps extends BasePromptElementProps {
2022 variableName : string ;
@@ -67,7 +69,8 @@ export class Image extends PromptElement<ImageProps, unknown> {
6769 @ILogService private readonly logService : ILogService ,
6870 @IImageService private readonly imageService : IImageService ,
6971 @IConfigurationService private readonly configurationService : IConfigurationService ,
70- @IExperimentationService private readonly experimentationService : IExperimentationService
72+ @IExperimentationService private readonly experimentationService : IExperimentationService ,
73+ @IPromptPathRepresentationService private readonly promptPathRepresentationService : IPromptPathRepresentationService
7174 ) {
7275 super ( props ) ;
7376 }
@@ -112,7 +115,14 @@ export class Image extends PromptElement<ImageProps, unknown> {
112115 < UserMessage priority = { 0 } >
113116 < BaseImage src = { imageSource } detail = 'high' mimeType = { imageMimeType } />
114117 { this . props . reference && (
115- < references value = { [ new PromptReference ( this . props . variableName ? { variableName : this . props . variableName , value : fillerUri } : fillerUri , undefined ) ] } />
118+ < >
119+ < Tag name = 'attachment' attrs = {
120+ this . props . variableName
121+ ? { id : this . props . variableName , filePath : this . promptPathRepresentationService . getFilePath ( this . props . reference ) }
122+ : { filePath : this . promptPathRepresentationService . getFilePath ( this . props . reference ) }
123+ } />
124+ < references value = { [ new PromptReference ( this . props . variableName ? { variableName : this . props . variableName , value : fillerUri } : fillerUri , undefined ) ] } />
125+ </ >
116126 ) }
117127 </ UserMessage >
118128 ) ;
0 commit comments