-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy pathimodel.ts
More file actions
50 lines (43 loc) · 1.8 KB
/
imodel.ts
File metadata and controls
50 lines (43 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { ChatClient } from './openai/chatClient.js';
import { AudioClient } from './openai/audioClient.js';
import { EmbeddingClient } from './openai/embeddingClient.js';
import { ResponsesClient } from './openai/responsesClient.js';
import { ModelInfo } from './types.js';
export interface IModel {
get id(): string;
get alias(): string;
get info(): ModelInfo;
get isCached(): boolean;
isLoaded(): Promise<boolean>;
get contextLength(): number | null;
get inputModalities(): string | null;
get outputModalities(): string | null;
get capabilities(): string | null;
get supportsToolCalling(): boolean | null;
download(progressCallback?: (progress: number) => void): Promise<void>;
get path(): string;
load(): Promise<void>;
removeFromCache(): void;
unload(): Promise<void>;
createChatClient(): ChatClient;
createAudioClient(): AudioClient;
createEmbeddingClient(): EmbeddingClient;
/**
* Creates a ResponsesClient for interacting with the model via the Responses API.
* Unlike createChatClient/createAudioClient (which use FFI), the Responses API
* is HTTP-based, so the web service base URL must be provided.
* @param baseUrl - The base URL of the Foundry Local web service.
*/
createResponsesClient(baseUrl: string): ResponsesClient;
/**
* Variants of the model that are available. Variants of the model are optimized for different devices.
*/
get variants(): IModel[];
/**
* Select a model variant from variants to use for IModel operations.
* An IModel from `variants` can also be used directly.
* @param variant - Model variant to select. Must be one of the variants in `variants`.
* @throws Error if variant is not valid for this model.
*/
selectVariant(variant: IModel): void;
}