Skip to content

Commit 2289076

Browse files
committed
change api shape
1 parent 7d5a42a commit 2289076

File tree

3 files changed

+36
-27
lines changed

3 files changed

+36
-27
lines changed

src/vs/workbench/api/common/extHostTypes.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import { nextCharLength } from '../../../base/common/strings.js';
1717
import { isNumber, isObject, isString, isStringArray } from '../../../base/common/types.js';
1818
import { URI } from '../../../base/common/uri.js';
1919
import { generateUuid } from '../../../base/common/uuid.js';
20+
import { TextEditorSelectionSource } from '../../../platform/editor/common/editor.js';
2021
import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js';
2122
import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from '../../../platform/files/common/files.js';
2223
import { RemoteAuthorityResolverErrorCode } from '../../../platform/remote/common/remoteAuthorityResolver.js';
2324
import { CellEditType, ICellMetadataEdit, IDocumentMetadataEdit, isTextStreamMime } from '../../contrib/notebook/common/notebookCommon.js';
2425
import { IRelativePatternDto } from './extHost.protocol.js';
25-
import { TextEditorSelectionSource } from '../../../platform/editor/common/editor.js';
2626

2727
/**
2828
* @deprecated
@@ -4918,18 +4918,10 @@ export class LanguageModelImagePart implements vscode.LanguageModelImagePart {
49184918
}
49194919

49204920
export interface ChatImagePart {
4921-
image_url: {
4922-
/**
4923-
* Either a URL of the image or the base64 encoded image data.
4924-
*/
4925-
url: string;
4926-
4927-
/**
4928-
* Specifies the detail level of the image. Learn more in the
4929-
* [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).
4930-
*/
4931-
detail?: ImageDetailLevel;
4932-
};
4921+
mimeType: string;
4922+
data: Uint8Array;
4923+
detail?: ImageDetailLevel;
4924+
49334925
}
49344926

49354927
export class LanguageModelPromptTsxPart {

src/vs/workbench/contrib/chat/common/languageModels.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,21 @@ export interface IChatMessageImagePart {
3535
}
3636

3737
export interface IChatImageURLPart {
38-
image_url: { url: string; detail?: ImageDetailLevel };
38+
/**
39+
* The image's MIME type (e.g., "image/png", "image/jpeg").
40+
*/
41+
mimeType: string;
42+
43+
/**
44+
* The raw binary data of the image, encoded as a Uint8Array. Note: do not use base64 encoding. Maximum image size is 5MB.
45+
*/
46+
data: Uint8Array;
47+
48+
/**
49+
* Specifies the detail level of the image. Learn more in the
50+
* [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).
51+
*/
52+
detail?: ImageDetailLevel;
3953
}
4054

4155
/**

src/vscode-dts/vscode.proposed.languageModelImagePart.d.ts

+16-13
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,22 @@ declare module 'vscode' {
7474
}
7575

7676
export interface ChatImagePart {
77-
image_url: {
78-
/**
79-
* Either a URL of the image or the base64 encoded image data.
80-
*/
81-
url: string;
82-
83-
/**
84-
* Specifies the detail level of the image. Learn more in the
85-
* [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).
86-
*/
87-
detail?: ImageDetailLevel;
88-
89-
};
77+
/**
78+
* The image's MIME type (e.g., "image/png", "image/jpeg").
79+
*/
80+
mimeType: string;
81+
82+
/**
83+
* The raw binary data of the image, encoded as a Uint8Array. Note: do not use base64 encoding. Maximum image size is 5MB.
84+
*/
85+
data: Uint8Array;
86+
87+
/**
88+
* Specifies the detail level of the image. Learn more in the
89+
* [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding).
90+
*/
91+
detail?: ImageDetailLevel;
92+
9093
}
9194

9295
/**

0 commit comments

Comments
 (0)