chatImageExtraction.ts ×4
Frontier kind: Code frontier
unlabeled · c_c063f032972b
6 tests · 41936 LOC · 180 files · introduces 0 tests · 19 LOC · 3 files
Introduces — evidence that enters the hierarchy at this concept
Code
6 ranges 19 lines · 3 files
Tests
0 tests
Contains — complete concept membership
Neighbourhood graph
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Focus concept
Ancestors (broader)
Descendants (narrower)
Introduced files
Introduced tests
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
JavaScript is disabled; use the native relationship evidence on this page to explore the same evidence.
Native relationship evidence
Every exact file and test below is linked only from the concept that introduces it.
Introduced tests
Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Introduced code
Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 19 introduced LOC across 6 ranges.
Expand a file to inspect source; the > gutter marks introduced lines.
src/vs/workbench/contrib/chat/common/chatImageExtraction.ts 15 introduced LOC · 4 ranges
Open complete file
45
for ( const item of response . response . value ) {
46
if ( item . kind === 'toolInvocation' || item . kind === 'toolInvocationSerialized' ) {
47
>
const images = extractImagesFromToolInvocationOutputDetails ( item , response . sessionResource );
chatImageExtraction.ts
48
>
allImages . push (... images );
49
>
const messageImages = await extractImagesFromToolInvocationMessages ( item , readFile );
50
>
allImages . push (... messageImages );
51
} else if ( item . kind === 'inlineReference' ) {
52
const image = await extractImageFromInlineReference ( item , readFile );
69
70
export function extractImagesFromToolInvocationOutputDetails ( toolInvocation : IChatToolInvocation | IChatToolInvocationSerialized , sessionResource : URI ) : IChatExtractedImage [] {
72
>
73
>
const resultDetails = IChatToolInvocation . resultDetails ( toolInvocation );
74
>
75
>
const caption = toolInvocation . pastTenseMessage ?? toolInvocation . invocationMessage ;
76
>
const pushImage = ( mimeType : string , data : VSBuffer , outputIndex : number ) => {
77
const ext = getExtensionForMimeType ( mimeType );
78
const permalinkBasename = ext ? `file ${ ext } ` : 'file.bin' ;
88
});
89
};
91
>
if ( isToolResultInputOutputDetails ( resultDetails )) {
92
for ( let i = 0 ; i < resultDetails . output . length ; i ++ ) {
93
const outputItem = resultDetails . output [ i ];
106
}
107
}
109
>
return images ;
110
>
}
111
112
export async function extractImagesFromToolInvocationMessages (
src/vs/workbench/contrib/chat/common/chatService/chatService.ts 2 introduced LOC · 1 range
Open complete file
959
export function resultDetails ( invocation : IChatToolInvocation | IChatToolInvocationSerialized , reader? : IReader ) {
960
if ( invocation . kind === 'toolInvocationSerialized' ) {
962
>
}
963
964
const state = invocation . state . read ( reader );
src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.ts 2 introduced LOC · 1 range
Open complete file
286
// eslint-disable-next-line @typescript-eslint/no-explicit-any
287
export function isToolResultInputOutputDetails ( obj : any ) : obj is IToolResultInputOutputDetails {
288
>
return typeof obj === 'object' && typeof obj ? . input === 'string' && ( typeof obj ? . output === 'string' || Array . isArray ( obj ? . output ));
languageModelToolsService.ts
289
>
}
290
291
// eslint-disable-next-line @typescript-eslint/no-explicit-any