forked from anton-abyzov/specweave
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.d.ts
More file actions
110 lines (99 loc) · 2.7 KB
/
Copy pathglobal.d.ts
File metadata and controls
110 lines (99 loc) · 2.7 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* Type declarations for optional LLM SDK dependencies.
*
* These SDKs are dynamically imported at runtime and are not required
* unless the user configures that specific provider.
*/
// OpenAI SDK stub
declare module 'openai' {
export default class OpenAI {
constructor(config: { apiKey: string; baseURL?: string });
chat: {
completions: {
create(params: {
model: string;
messages: Array<{ role: string; content: string }>;
max_tokens?: number;
temperature?: number;
}): Promise<{
choices: Array<{
message: { content: string | null };
finish_reason: string;
}>;
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
}>;
};
};
}
export class AzureOpenAI extends OpenAI {
constructor(config: {
apiKey: string;
endpoint: string;
apiVersion: string;
deployment?: string;
});
}
}
// AWS Bedrock SDK stub
declare module '@aws-sdk/client-bedrock-runtime' {
export interface BedrockRuntimeClientConfig {
region?: string;
}
export class BedrockRuntimeClient {
constructor(config: BedrockRuntimeClientConfig);
send<T>(command: T): Promise<InvokeModelCommandOutput>;
}
export interface InvokeModelCommandInput {
modelId: string;
contentType: string;
accept: string;
body: string | Uint8Array; // Accept both string and Uint8Array
}
export class InvokeModelCommand {
constructor(input: InvokeModelCommandInput);
}
export interface InvokeModelCommandOutput {
body: Uint8Array;
}
// Placeholder for ListFoundationModelsCommand (actually in @aws-sdk/client-bedrock)
export class ListFoundationModelsCommand {
constructor(input?: Record<string, unknown>);
}
}
// Google Vertex AI SDK stub
declare module '@google-cloud/vertexai' {
export interface VertexAIConfig {
project: string;
location: string;
}
export class VertexAI {
constructor(config: VertexAIConfig);
getGenerativeModel(config: { model: string }): GenerativeModel;
}
export interface GenerativeModel {
generateContent(content: string | {
contents: Array<{ role: string; parts: Array<{ text: string }> }>;
generationConfig?: {
maxOutputTokens?: number;
temperature?: number;
};
}): Promise<{
response: {
candidates?: Array<{
content?: {
parts?: Array<{ text?: string }>;
};
}>;
usageMetadata?: {
promptTokenCount?: number;
candidatesTokenCount?: number;
totalTokenCount?: number;
};
};
}>;
}
}