@aeye/google 0.0.0-stage → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +119 -3
- package/aeye-google.md +123 -0
- package/dist/convert.d.ts +191 -0
- package/dist/convert.d.ts.map +1 -0
- package/dist/convert.js +539 -0
- package/dist/convert.js.map +1 -0
- package/dist/decisions.d.ts +97 -0
- package/dist/decisions.d.ts.map +1 -0
- package/dist/decisions.js +62 -0
- package/dist/decisions.js.map +1 -0
- package/dist/google.d.ts +494 -0
- package/dist/google.d.ts.map +1 -0
- package/dist/google.js +1366 -0
- package/dist/google.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/media.d.ts +56 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +143 -0
- package/dist/media.js.map +1 -0
- package/dist/models.d.ts +133 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +126 -0
- package/dist/models.js.map +1 -0
- package/dist/retry.d.ts +112 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +231 -0
- package/dist/retry.js.map +1 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +74 -0
- package/dist/types.js.map +1 -0
- package/package.json +75 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,QAAQ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B,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC/C,eAAe,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,KAAK,CAAC,EAAE;QACN,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,wBAAwB,CAAC,EAAE,KAAK,CAAC;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACvE,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,sBAAsB,CASrF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,EAAE,MAAM,SAAI,GAAG,cAAc,CAkBrG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,SAAS,CAW/E"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping between @aeye decisions and the Gemini Decisions API
|
|
3
|
+
* (/docs/decisions-api): yes/no (`noul`), choice and score questions over a
|
|
4
|
+
* shared input, answered with calibrated probabilities and no output tokens.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* An @aeye question as a Decisions API question: a predicate is yes/no, a
|
|
8
|
+
* choice maps each value to when it applies, a score lists its levels.
|
|
9
|
+
*/
|
|
10
|
+
export function toDecisionQuestion(question) {
|
|
11
|
+
switch (question.type) {
|
|
12
|
+
case 'predicate':
|
|
13
|
+
return { type: 'noul', instructions: question.instructions };
|
|
14
|
+
case 'choice':
|
|
15
|
+
return { type: 'choice', instructions: question.instructions, criteria: question.choices };
|
|
16
|
+
case 'score':
|
|
17
|
+
return { type: 'score', instructions: question.instructions, criteria: question.levels };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A Decisions API answer as an @aeye answer. Score probabilities come keyed
|
|
22
|
+
* by level index and go back as an array in level order.
|
|
23
|
+
*
|
|
24
|
+
* @param answer - The answer
|
|
25
|
+
* @param levels - How many levels the score question had
|
|
26
|
+
*/
|
|
27
|
+
export function toDecisionAnswer(answer, levels = 0) {
|
|
28
|
+
switch (answer?.type) {
|
|
29
|
+
case 'noul':
|
|
30
|
+
return { type: 'predicate', probability: answer.noul };
|
|
31
|
+
case 'choice':
|
|
32
|
+
return { type: 'choice', choice: answer.choice, probabilities: answer.probabilities, confidence: answer.confidence };
|
|
33
|
+
case 'score': {
|
|
34
|
+
const count = Math.max(levels, ...Object.keys(answer.probabilities).map(k => Number(k) + 1));
|
|
35
|
+
return {
|
|
36
|
+
type: 'score',
|
|
37
|
+
score: answer.score,
|
|
38
|
+
probabilities: Array.from({ length: count }, (_, i) => answer.probabilities[String(i)] ?? 0),
|
|
39
|
+
confidence: answer.confidence,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
default:
|
|
43
|
+
return { type: 'refusal' };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Decision usage: input tokens by modality, and no output.
|
|
48
|
+
*/
|
|
49
|
+
export function decisionUsage(usage) {
|
|
50
|
+
if (!usage)
|
|
51
|
+
return undefined;
|
|
52
|
+
const by = (name) => (usage.input_tokens_by_modality ?? []).filter(m => m.modality === name).reduce((sum, m) => sum + m.tokens, 0);
|
|
53
|
+
const image = by('image');
|
|
54
|
+
const audio = by('audio');
|
|
55
|
+
const text = (usage.total_input_tokens ?? 0) - image - audio;
|
|
56
|
+
return {
|
|
57
|
+
...(text > 0 ? { text: { input: text } } : {}),
|
|
58
|
+
...(image ? { image: { input: image } } : {}),
|
|
59
|
+
...(audio ? { audio: { input: audio } } : {}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=decisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.js","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkDH;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA0B;IAC3D,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,KAAK,WAAW;YACd,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC/D,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC7F,KAAK,OAAO;YACV,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC7F,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAwC,EAAE,MAAM,GAAG,CAAC;IACnF,QAAQ,MAAM,EAAE,IAAI,EAAE,CAAC;QACrB,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACzD,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;QACvH,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,G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AI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9C,CAAC;AACJ,CAAC"}
|
package/dist/google.d.ts
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Provider
|
|
3
|
+
*
|
|
4
|
+
* Provider for the Gemini API (generativelanguage.googleapis.com), and Vertex
|
|
5
|
+
* AI through the same SDK: chat with tools, structured output, thinking,
|
|
6
|
+
* multimodal input and Google's hosted tools; image generation and editing
|
|
7
|
+
* (Gemini image models, and Imagen on Vertex AI); speech; transcription;
|
|
8
|
+
* embeddings; decisions; batches; token counting and context caching.
|
|
9
|
+
*/
|
|
10
|
+
import type { AIContextAny, AIMetadataAny, DecisionRequest, DecisionResponse, EmbeddingRequest, EmbeddingResponse, ImageEditRequest, ImageGenerationRequest, ImageGenerationResponse, ModelInfo, Provider, SpeechRequest, SpeechResponse, TranscriptionRequest, TranscriptionResponse } from '@aeye/ai';
|
|
11
|
+
import { type BaseRequest, type Executor, type MessageContent, type Model, type ModelInput, type ModelLike, type Request, type Response, SchemaRejectedError, type Streamer } from '@aeye/core';
|
|
12
|
+
import { type CachedContent, type Content, type GenerateContentConfig, type GenerateContentParameters, GoogleGenAI, type GoogleGenAIOptions, type Model as GeminiModel, type Part, type SafetySetting, type Tool, type ToolConfig } from '@google/genai';
|
|
13
|
+
import { type GeminiDecisionParams } from './decisions';
|
|
14
|
+
import { type RetryConfig, type RetryEvents } from './retry';
|
|
15
|
+
/**
|
|
16
|
+
* Hook called before a request is sent.
|
|
17
|
+
*/
|
|
18
|
+
export type PreRequestHook<TRequest, TParams> = (request: TRequest, params: TParams, ctx: AIContextAny, metadata?: AIMetadataAny) => void | Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Hook called after a response is received.
|
|
21
|
+
*/
|
|
22
|
+
export type PostRequestHook<TRequest, TParams, TResponse> = (request: TRequest, params: TParams, response: TResponse, ctx: AIContextAny, metadata?: AIMetadataAny) => void | Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Hook called when a request fails.
|
|
25
|
+
*/
|
|
26
|
+
export type ErrorHook<TRequest, TParams> = (request: TRequest, params: TParams, error: Error, ctx: AIContextAny, metadata?: AIMetadataAny) => void | Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Each operation's @aeye request, the parameters sent for it, and its @aeye response.
|
|
29
|
+
*/
|
|
30
|
+
export interface GoogleOperations {
|
|
31
|
+
chat: {
|
|
32
|
+
request: Request;
|
|
33
|
+
params: GenerateContentParameters;
|
|
34
|
+
response: Response;
|
|
35
|
+
};
|
|
36
|
+
imageGenerate: {
|
|
37
|
+
request: ImageGenerationRequest;
|
|
38
|
+
params: GenerateContentParameters | Record<string, any>;
|
|
39
|
+
response: ImageGenerationResponse;
|
|
40
|
+
};
|
|
41
|
+
imageEdit: {
|
|
42
|
+
request: ImageEditRequest;
|
|
43
|
+
params: GenerateContentParameters | Record<string, any>;
|
|
44
|
+
response: ImageGenerationResponse;
|
|
45
|
+
};
|
|
46
|
+
transcribe: {
|
|
47
|
+
request: TranscriptionRequest;
|
|
48
|
+
params: GenerateContentParameters;
|
|
49
|
+
response: TranscriptionResponse;
|
|
50
|
+
};
|
|
51
|
+
speech: {
|
|
52
|
+
request: SpeechRequest;
|
|
53
|
+
params: GenerateContentParameters;
|
|
54
|
+
response: SpeechResponse;
|
|
55
|
+
};
|
|
56
|
+
embed: {
|
|
57
|
+
request: EmbeddingRequest;
|
|
58
|
+
params: Record<string, any>;
|
|
59
|
+
response: EmbeddingResponse;
|
|
60
|
+
};
|
|
61
|
+
decide: {
|
|
62
|
+
request: DecisionRequest;
|
|
63
|
+
params: GeminiDecisionParams;
|
|
64
|
+
response: DecisionResponse;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Hooks around one operation.
|
|
69
|
+
*/
|
|
70
|
+
export interface OperationHooks<TOperation extends GoogleOperations[keyof GoogleOperations]> {
|
|
71
|
+
beforeRequest?: PreRequestHook<TOperation['request'], TOperation['params']>;
|
|
72
|
+
afterRequest?: PostRequestHook<TOperation['request'], TOperation['params'], TOperation['response']>;
|
|
73
|
+
onError?: ErrorHook<TOperation['request'], TOperation['params']>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Hooks for each operation. Image analysis runs as chat.
|
|
77
|
+
*/
|
|
78
|
+
export type GoogleHooks = {
|
|
79
|
+
[K in keyof GoogleOperations]?: OperationHooks<GoogleOperations[K]>;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Explicit context caching (`cachedContents`) of the prompt prefix a
|
|
83
|
+
* `cacheBreakpoint` ends. Off by default: Gemini caches prompt prefixes
|
|
84
|
+
* implicitly (2.5 and later), and explicit caches bill storage by the hour.
|
|
85
|
+
*/
|
|
86
|
+
export interface GoogleCacheConfig {
|
|
87
|
+
/** How long a cache lives, e.g. `'300s'` (default `'3600s'`) */
|
|
88
|
+
ttl?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Configuration options for the Google provider.
|
|
92
|
+
*
|
|
93
|
+
* @example Gemini API
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const google = new GoogleProvider({ apiKey: process.env.GEMINI_API_KEY! });
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example Vertex AI (Application Default Credentials)
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const google = new GoogleProvider({ vertexai: true, project: 'my-project', location: 'global' });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export interface GoogleConfig {
|
|
104
|
+
apiKey?: string;
|
|
105
|
+
vertexai?: boolean;
|
|
106
|
+
project?: string;
|
|
107
|
+
location?: string;
|
|
108
|
+
googleAuthOptions?: GoogleGenAIOptions['googleAuthOptions'];
|
|
109
|
+
apiVersion?: string;
|
|
110
|
+
baseURL?: string;
|
|
111
|
+
headers?: Record<string, string>;
|
|
112
|
+
timeout?: number;
|
|
113
|
+
fetch?: typeof fetch;
|
|
114
|
+
retry?: RetryConfig;
|
|
115
|
+
retryEvents?: RetryEvents;
|
|
116
|
+
hooks?: GoogleHooks;
|
|
117
|
+
safetySettings?: SafetySetting[];
|
|
118
|
+
uploadThreshold?: number;
|
|
119
|
+
explicitCaching?: boolean | GoogleCacheConfig;
|
|
120
|
+
modelInfo?: ModelInfo[];
|
|
121
|
+
defaultModels?: {
|
|
122
|
+
chat?: ModelInput;
|
|
123
|
+
imageGenerate?: ModelInput;
|
|
124
|
+
imageEdit?: ModelInput;
|
|
125
|
+
imageAnalyze?: ModelInput;
|
|
126
|
+
transcription?: ModelInput;
|
|
127
|
+
speech?: ModelInput;
|
|
128
|
+
embedding?: ModelInput;
|
|
129
|
+
decision?: ModelInput;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Default model for each operation.
|
|
134
|
+
*/
|
|
135
|
+
export type GoogleDefaultModels = NonNullable<GoogleConfig['defaultModels']>;
|
|
136
|
+
/**
|
|
137
|
+
* Everything one API call needs.
|
|
138
|
+
*/
|
|
139
|
+
export interface OperationRun<TConfig> {
|
|
140
|
+
config: TConfig;
|
|
141
|
+
client: GoogleGenAI;
|
|
142
|
+
ctx: AIContextAny;
|
|
143
|
+
metadata?: AIMetadataAny;
|
|
144
|
+
model: Model;
|
|
145
|
+
modelInfo?: ModelInfo;
|
|
146
|
+
signal?: AbortSignal;
|
|
147
|
+
retry<R>(call: (signal?: AbortSignal) => Promise<R>): Promise<R>;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Google Gemini provider for @aeye.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* import { AI } from '@aeye/ai';
|
|
155
|
+
* import { GoogleProvider } from '@aeye/google';
|
|
156
|
+
* import { googleModels } from '@aeye/models';
|
|
157
|
+
*
|
|
158
|
+
* const google = new GoogleProvider({ apiKey: process.env.GEMINI_API_KEY! });
|
|
159
|
+
* const ai = AI.with().providers({ google }).create({ models: googleModels });
|
|
160
|
+
* const response = await ai.chat.get([{ role: 'user', content: 'Hello!' }], { metadata: { model: 'gemini-3.8-flash' } });
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
export declare class GoogleProvider<TConfig extends GoogleConfig = GoogleConfig> implements Provider<TConfig> {
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly config: TConfig;
|
|
166
|
+
defaultMetadata?: Provider['defaultMetadata'];
|
|
167
|
+
protected readonly defaults: GoogleDefaultModels;
|
|
168
|
+
private readonly caches;
|
|
169
|
+
private readonly uncacheable;
|
|
170
|
+
constructor(config?: TConfig);
|
|
171
|
+
/**
|
|
172
|
+
* The SDK client for a config. The SDK never retries (no
|
|
173
|
+
* `retryOptions`); `withRetry` does.
|
|
174
|
+
*/
|
|
175
|
+
protected createClient(config: TConfig): GoogleGenAI;
|
|
176
|
+
/**
|
|
177
|
+
* Families of schemas this provider sends (`@aeye/schema` profiles).
|
|
178
|
+
*/
|
|
179
|
+
protected supportedStrictFamilies: ReadonlySet<string>;
|
|
180
|
+
/**
|
|
181
|
+
* The schema rules of a model whose data has none: Gemini's JSON Schema
|
|
182
|
+
* dialect (`@aeye/schema` base `google`).
|
|
183
|
+
*/
|
|
184
|
+
protected schemaDefaults: {
|
|
185
|
+
readonly base: "google";
|
|
186
|
+
};
|
|
187
|
+
/** The options schemas are planned with: the families sent, and the default rules. */
|
|
188
|
+
protected planOptions(): {
|
|
189
|
+
speaks: ReadonlySet<string>;
|
|
190
|
+
defaults: {
|
|
191
|
+
readonly base: "google";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
/** The model a call's schemas are planned for: its data. */
|
|
195
|
+
protected schemaModel(run: OperationRun<TConfig>): ModelLike;
|
|
196
|
+
/**
|
|
197
|
+
* Model info for an id: the configured model info (`config.modelInfo`,
|
|
198
|
+
* e.g. `@aeye/models` `googleModels`), else the documented default
|
|
199
|
+
* (`defaultGoogleModel`). No rules are applied to the id.
|
|
200
|
+
*/
|
|
201
|
+
protected modelInfoFor(id: string, config?: GoogleConfig): ModelInfo;
|
|
202
|
+
/** The data of a call's model. */
|
|
203
|
+
protected infoOf(run: OperationRun<TConfig>): ModelInfo;
|
|
204
|
+
/**
|
|
205
|
+
* Models the API serves that @aeye can call, with what the rules and the
|
|
206
|
+
* API say about each, merged with `config.modelInfo` (prices and the docs'
|
|
207
|
+
* capabilities) where it has the model.
|
|
208
|
+
*/
|
|
209
|
+
listModels(config?: TConfig): Promise<ModelInfo[]>;
|
|
210
|
+
/**
|
|
211
|
+
* A models.list entry as ModelInfo, merged with configured model info.
|
|
212
|
+
*/
|
|
213
|
+
protected convertModel(model: GeminiModel, config: TConfig): ModelInfo;
|
|
214
|
+
/**
|
|
215
|
+
* Whether the API answers with these credentials.
|
|
216
|
+
*/
|
|
217
|
+
checkHealth(config?: TConfig): Promise<boolean>;
|
|
218
|
+
/**
|
|
219
|
+
* Resolve what one call needs: config and client, model, retries.
|
|
220
|
+
*/
|
|
221
|
+
protected prepare(operation: string, request: BaseRequest, ctx: AIContextAny, metadata: AIMetadataAny | undefined, config: TConfig | undefined, signal: AbortSignal | undefined, defaultModel: keyof GoogleDefaultModels): OperationRun<TConfig>;
|
|
222
|
+
/**
|
|
223
|
+
* Send one call with retries, around the before and error hooks. Failures
|
|
224
|
+
* become the provider's errors.
|
|
225
|
+
*/
|
|
226
|
+
protected send<K extends keyof GoogleOperations, R>(op: K, run: OperationRun<TConfig>, request: GoogleOperations[K]['request'], params: GoogleOperations[K]['params'], call: (signal?: AbortSignal) => Promise<R>): Promise<R>;
|
|
227
|
+
/**
|
|
228
|
+
* Report a response to the after hook and return it.
|
|
229
|
+
*/
|
|
230
|
+
protected finish<K extends keyof GoogleOperations>(op: K, run: OperationRun<TConfig>, request: GoogleOperations[K]['request'], params: GoogleOperations[K]['params'], response: GoogleOperations[K]['response']): Promise<GoogleOperations[K]['response']>;
|
|
231
|
+
/**
|
|
232
|
+
* The schema a 400 rejected: Gemini names a function declaration by index
|
|
233
|
+
* (`tools[0].function_declarations[3]`) or the response schema.
|
|
234
|
+
*/
|
|
235
|
+
protected rejectedSchema(request: Request, error: Error): SchemaRejectedError | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Send a chat call. A context window overflow ends as `length` so the
|
|
238
|
+
* prompt can trim and retry; a rejected schema becomes a
|
|
239
|
+
* SchemaRejectedError.
|
|
240
|
+
*/
|
|
241
|
+
private sendChat;
|
|
242
|
+
/**
|
|
243
|
+
* Upload bytes through the Files API and wait until the file is usable
|
|
244
|
+
* (videos are processed first).
|
|
245
|
+
*
|
|
246
|
+
* @param data - The bytes
|
|
247
|
+
* @param mimeType - Their type
|
|
248
|
+
* @param run - The call, for its client and signal
|
|
249
|
+
* @param displayName - A name to show
|
|
250
|
+
* @returns The file's URI and type
|
|
251
|
+
*/
|
|
252
|
+
uploadFile(data: Uint8Array | Blob, mimeType: string, run?: Pick<OperationRun<TConfig>, 'client' | 'signal' | 'retry'>, displayName?: string): Promise<{
|
|
253
|
+
uri: string;
|
|
254
|
+
mimeType: string;
|
|
255
|
+
name: string;
|
|
256
|
+
}>;
|
|
257
|
+
/**
|
|
258
|
+
* Delete a file uploaded through the Files API.
|
|
259
|
+
*/
|
|
260
|
+
deleteFile(name: string, config?: TConfig): Promise<void>;
|
|
261
|
+
/**
|
|
262
|
+
* One media resource as a Gemini part: files, Cloud Storage objects,
|
|
263
|
+
* YouTube and other URLs of known type go by reference (`fileData`); bytes
|
|
264
|
+
* go inline, or through the Files API above the upload threshold.
|
|
265
|
+
*/
|
|
266
|
+
protected convertMedia(part: MessageContent, run: OperationRun<TConfig>): Promise<Part>;
|
|
267
|
+
/**
|
|
268
|
+
* A part with its media resolution, from the content's `detail` (Gemini 3
|
|
269
|
+
* and later; earlier models take only a request-wide resolution).
|
|
270
|
+
*/
|
|
271
|
+
private withResolution;
|
|
272
|
+
/**
|
|
273
|
+
* Message content as parts. Media that can't be read becomes a note.
|
|
274
|
+
*/
|
|
275
|
+
protected convertContent(content: string | MessageContent[], name: string, run: OperationRun<TConfig>): Promise<Part[]>;
|
|
276
|
+
/**
|
|
277
|
+
* Messages as Gemini contents and a system instruction.
|
|
278
|
+
*
|
|
279
|
+
* - System messages become the system instruction.
|
|
280
|
+
* - Assistant turns become `model` contents with their text and function
|
|
281
|
+
* calls, and the thought signatures and server-side tool parts Gemini
|
|
282
|
+
* gave them (only Gemini's own reasoning is replayed). A function call
|
|
283
|
+
* Gemini 3+ needs signed but that has no signature (history from another
|
|
284
|
+
* model) gets the validator-skip signature.
|
|
285
|
+
* - Tool results become `functionResponse` parts, named after their call;
|
|
286
|
+
* images and files in them ride inside the response on Gemini 3 and
|
|
287
|
+
* later, and as user parts after it before that.
|
|
288
|
+
* - Consecutive contents of one role are merged, so parallel calls are
|
|
289
|
+
* answered in one turn.
|
|
290
|
+
*/
|
|
291
|
+
protected convertMessages(request: Request, run: OperationRun<TConfig>): Promise<{
|
|
292
|
+
contents: Content[];
|
|
293
|
+
systemInstruction?: Content;
|
|
294
|
+
}>;
|
|
295
|
+
/**
|
|
296
|
+
* An assistant message as model parts.
|
|
297
|
+
*/
|
|
298
|
+
private convertAssistant;
|
|
299
|
+
/**
|
|
300
|
+
* Tools as function declarations, in the plan's rendering
|
|
301
|
+
* (`parametersJsonSchema`, Gemini's JSON Schema dialect), and hosted tools.
|
|
302
|
+
*/
|
|
303
|
+
protected convertTools(request: Request, vertex?: boolean): {
|
|
304
|
+
tools?: Tool[];
|
|
305
|
+
strict: boolean;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* The tool choice as a function calling config:
|
|
309
|
+
*
|
|
310
|
+
* - `auto`: AUTO, or VALIDATED (constrained calls) when any tool was
|
|
311
|
+
* rendered strict
|
|
312
|
+
* - `required`: ANY; `{ tool }`: ANY limited to it
|
|
313
|
+
* - `{ allowed }`: VALIDATED (or ANY when required) limited to them, with
|
|
314
|
+
* every tool still sent
|
|
315
|
+
* - `none`: NONE
|
|
316
|
+
*/
|
|
317
|
+
protected convertToolChoice(request: Request, strict: boolean, hasFunctions: boolean): ToolConfig['functionCallingConfig'] | undefined;
|
|
318
|
+
/**
|
|
319
|
+
* generateContent parameters for a chat request.
|
|
320
|
+
*
|
|
321
|
+
* @param request - The request, prepared (`prepareRequest`)
|
|
322
|
+
* @param run - The resolved call
|
|
323
|
+
*/
|
|
324
|
+
protected buildChatParams(request: Request, run: OperationRun<TConfig>): Promise<GenerateContentParameters>;
|
|
325
|
+
/**
|
|
326
|
+
* The parameters with the prefix the last cache breakpoint ends cached
|
|
327
|
+
* explicitly, when explicit caching is on and the model has it: the
|
|
328
|
+
* system instruction, tools and contents through the breakpoint go in a
|
|
329
|
+
* cache (made once and reused while it lives), and the call sends the
|
|
330
|
+
* rest. A prefix the API won't cache (too small) is sent whole from then on.
|
|
331
|
+
*/
|
|
332
|
+
private withExplicitCache;
|
|
333
|
+
/**
|
|
334
|
+
* Create an explicit cache of contents to reference with
|
|
335
|
+
* `extra.cachedContent` (Gemini 2.5 and 3; Gemini 4 caches implicitly only).
|
|
336
|
+
*
|
|
337
|
+
* @param request - The messages (and tools) to cache
|
|
338
|
+
* @param options - Model and time to live
|
|
339
|
+
* @returns The cache's name and expiry
|
|
340
|
+
*/
|
|
341
|
+
createCache(request: Request, options?: {
|
|
342
|
+
model?: ModelInput;
|
|
343
|
+
ttl?: string;
|
|
344
|
+
displayName?: string;
|
|
345
|
+
}, config?: TConfig): Promise<CachedContent>;
|
|
346
|
+
/**
|
|
347
|
+
* Delete an explicit cache.
|
|
348
|
+
*/
|
|
349
|
+
deleteCache(name: string, config?: TConfig): Promise<void>;
|
|
350
|
+
/**
|
|
351
|
+
* Count the tokens a chat request's prompt takes, without generating.
|
|
352
|
+
* The Gemini API counts the whole request (system instruction and tools
|
|
353
|
+
* too) through `generateContentRequest`.
|
|
354
|
+
*
|
|
355
|
+
* @returns Total prompt tokens and any cached ones
|
|
356
|
+
*/
|
|
357
|
+
countTokens(request: Request, config?: TConfig): Promise<{
|
|
358
|
+
totalTokens: number;
|
|
359
|
+
cachedContentTokenCount?: number;
|
|
360
|
+
}>;
|
|
361
|
+
/**
|
|
362
|
+
* The speech config for a voice: a model whose data says it takes any
|
|
363
|
+
* voice id (`speech.voices: 'any'`, Gemini 3.8 TTS) gets it as `voice`
|
|
364
|
+
* (prebuilt, designed `voice_...`, replicated `voicekey_...`); others
|
|
365
|
+
* take prebuilt voice names, unless the voice is a designed or replicated one.
|
|
366
|
+
*/
|
|
367
|
+
protected voiceConfig(info: ModelInfo, voice: string): GenerateContentConfig['speechConfig'];
|
|
368
|
+
/**
|
|
369
|
+
* Run a chat request.
|
|
370
|
+
*/
|
|
371
|
+
private complete;
|
|
372
|
+
/**
|
|
373
|
+
* Stream a chat request.
|
|
374
|
+
*/
|
|
375
|
+
private completeStream;
|
|
376
|
+
/**
|
|
377
|
+
* Create an executor for chat requests.
|
|
378
|
+
*/
|
|
379
|
+
createExecutor(config?: TConfig): Executor<AIContextAny, AIMetadataAny>;
|
|
380
|
+
/**
|
|
381
|
+
* Create a streamer for chat requests.
|
|
382
|
+
*/
|
|
383
|
+
createStreamer(config?: TConfig): Streamer<AIContextAny, AIMetadataAny>;
|
|
384
|
+
/**
|
|
385
|
+
* generateContent parameters for image generation or editing with a
|
|
386
|
+
* Gemini image model: the prompt (after any images), image output only,
|
|
387
|
+
* and an aspect ratio and size from the requested size and quality.
|
|
388
|
+
*/
|
|
389
|
+
private imageParams;
|
|
390
|
+
/**
|
|
391
|
+
* Run image generation or editing: `n` calls with a Gemini image model
|
|
392
|
+
* (each makes one image), or one Imagen call.
|
|
393
|
+
*/
|
|
394
|
+
private makeImages;
|
|
395
|
+
/**
|
|
396
|
+
* Generate images: Gemini image models (Nano Banana) through
|
|
397
|
+
* generateContent, Imagen (Vertex AI) through generateImages.
|
|
398
|
+
*/
|
|
399
|
+
generateImage: Provider['generateImage'];
|
|
400
|
+
/**
|
|
401
|
+
* Edit or combine images with a prompt: the image, its references, and a
|
|
402
|
+
* mask (described to the model, which has no mask input) go before the
|
|
403
|
+
* prompt.
|
|
404
|
+
*/
|
|
405
|
+
editImage: Provider['editImage'];
|
|
406
|
+
/**
|
|
407
|
+
* The image parts of an edit.
|
|
408
|
+
*/
|
|
409
|
+
private editImages;
|
|
410
|
+
/**
|
|
411
|
+
* Stream image generation: the model's draft ("thought") images as
|
|
412
|
+
* progress, then each final image.
|
|
413
|
+
*/
|
|
414
|
+
generateImageStream: Provider['generateImageStream'];
|
|
415
|
+
/**
|
|
416
|
+
* Stream image editing.
|
|
417
|
+
*/
|
|
418
|
+
editImageStream: Provider['editImageStream'];
|
|
419
|
+
/**
|
|
420
|
+
* Stream one image call, with draft images as progress.
|
|
421
|
+
*/
|
|
422
|
+
private imageStream;
|
|
423
|
+
/**
|
|
424
|
+
* Generate speech with a Gemini TTS model. Gemini speaks 24 kHz 16-bit
|
|
425
|
+
* mono PCM, returned as WAV (the default) or raw PCM; other encodings
|
|
426
|
+
* aren't offered and come back as WAV (`responseFormat` says which).
|
|
427
|
+
* `instructions` and `speed` become the turn's speaking style
|
|
428
|
+
* (`speechMetadata.style` on Gemini 3.8 TTS, a spoken direction before).
|
|
429
|
+
*/
|
|
430
|
+
speech: Provider['speech'];
|
|
431
|
+
/**
|
|
432
|
+
* Transcription parameters: Gemini Transcribe models take an
|
|
433
|
+
* `audioTranscriptionConfig` (languages, custom vocabulary from the
|
|
434
|
+
* prompt, diarization and word timestamps for the formats that show
|
|
435
|
+
* them); other Gemini models are asked to transcribe.
|
|
436
|
+
*/
|
|
437
|
+
private transcriptionParams;
|
|
438
|
+
/**
|
|
439
|
+
* Transcript text and timed segments from a response.
|
|
440
|
+
*/
|
|
441
|
+
private transcript;
|
|
442
|
+
/**
|
|
443
|
+
* Transcribe audio. SRT and WebVTT are built from word timestamps.
|
|
444
|
+
*/
|
|
445
|
+
transcribe: Provider['transcribe'];
|
|
446
|
+
/**
|
|
447
|
+
* Transcribe audio, streaming text as it's recognized.
|
|
448
|
+
*/
|
|
449
|
+
transcribeStream: Provider['transcribeStream'];
|
|
450
|
+
/**
|
|
451
|
+
* Task prefixes Gemini Embedding 2 reads in place of a task type
|
|
452
|
+
* (/docs/embeddings "Task types with Embeddings 2").
|
|
453
|
+
*/
|
|
454
|
+
private static readonly TASK_PREFIXES;
|
|
455
|
+
/**
|
|
456
|
+
* Embed texts, and images with Gemini Embedding 2. Each input is its own
|
|
457
|
+
* content, so each gets its own vector. `extra.taskType` sets the task
|
|
458
|
+
* (gemini-embedding-001) or the task prefix (Gemini Embedding 2);
|
|
459
|
+
* `dimensions` is the output dimensionality.
|
|
460
|
+
*/
|
|
461
|
+
embed: Provider['embed'];
|
|
462
|
+
/**
|
|
463
|
+
* Typed answers about an input with Gemini Decision 1. A conversation is
|
|
464
|
+
* serialized as text (the API takes no turns); images go as image blocks.
|
|
465
|
+
* A blocked input answers every question with a refusal.
|
|
466
|
+
*/
|
|
467
|
+
decide: Provider['decide'];
|
|
468
|
+
/**
|
|
469
|
+
* Run chat requests as one batch on one model (half price, results
|
|
470
|
+
* within a day). Each request is the call a direct request would make.
|
|
471
|
+
*/
|
|
472
|
+
submitBatch: Provider['submitBatch'];
|
|
473
|
+
/**
|
|
474
|
+
* A batch as it stands, with its results once it completes.
|
|
475
|
+
*/
|
|
476
|
+
getBatch: Provider['getBatch'];
|
|
477
|
+
/**
|
|
478
|
+
* A batch job as @aeye reports it.
|
|
479
|
+
*/
|
|
480
|
+
private batchJob;
|
|
481
|
+
/**
|
|
482
|
+
* An image analysis request as a chat request.
|
|
483
|
+
*/
|
|
484
|
+
private analysisChat;
|
|
485
|
+
/**
|
|
486
|
+
* Analyze images with a vision model, as chat.
|
|
487
|
+
*/
|
|
488
|
+
analyzeImage: Provider['analyzeImage'];
|
|
489
|
+
/**
|
|
490
|
+
* Analyze images, streaming the answer.
|
|
491
|
+
*/
|
|
492
|
+
analyzeImageStream: Provider['analyzeImageStream'];
|
|
493
|
+
}
|
|
494
|
+
//# sourceMappingURL=google.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../src/google.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAIb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,gBAAgB,EAEhB,sBAAsB,EACtB,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,cAAc,EAEd,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,QAAQ,EAIb,KAAK,cAAc,EACnB,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,SAAS,EAKd,KAAK,OAAO,EAGZ,KAAK,QAAQ,EACb,mBAAmB,EAInB,KAAK,QAAQ,EAKd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,OAAO,EAGZ,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAE9B,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,KAAK,IAAI,WAAW,EACzB,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,IAAI,EACT,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAkBvB,OAAO,EAAgE,KAAK,oBAAoB,EAAwC,MAAM,aAAa,CAAC;AAG5J,OAAO,EAAsC,KAAK,WAAW,EAAqB,KAAK,WAAW,EAA4B,MAAM,SA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