@agentick/google 0.1.8
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/LICENSE +21 -0
- package/README.md +96 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/.tsbuildinfo.build +1 -0
- package/dist/google.d.ts +41 -0
- package/dist/google.d.ts.map +1 -0
- package/dist/google.js +414 -0
- package/dist/google.js.map +1 -0
- package/dist/google.model.d.ts +40 -0
- package/dist/google.model.d.ts.map +1 -0
- package/dist/google.model.js +39 -0
- package/dist/google.model.js.map +1 -0
- package/dist/google.model.jsx +39 -0
- package/dist/google.model.jsx.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +50 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -0
package/dist/google.js
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google GenAI Adapter
|
|
3
|
+
*
|
|
4
|
+
* Native Google GenAI adapter for use with the engine.
|
|
5
|
+
* Uses createAdapter for minimal boilerplate.
|
|
6
|
+
*/
|
|
7
|
+
import { GoogleGenAI, FinishReason } from "@google/genai";
|
|
8
|
+
import { createAdapter, } from "@agentick/core/model";
|
|
9
|
+
// import { Logger } from "@agentick/core";
|
|
10
|
+
import { normalizeModelInput } from "@agentick/core/utils";
|
|
11
|
+
import { StopReason, AdapterError, ValidationError, } from "@agentick/shared";
|
|
12
|
+
import { STOP_REASON_MAP } from "./types";
|
|
13
|
+
// const logger = Logger.for("GoogleAdapter");
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// Factory Function
|
|
16
|
+
// ============================================================================
|
|
17
|
+
/**
|
|
18
|
+
* Factory function for creating Google model adapter.
|
|
19
|
+
*
|
|
20
|
+
* Returns a ModelClass that can be used both programmatically and as JSX.
|
|
21
|
+
*/
|
|
22
|
+
export function createGoogleModel(config = {}) {
|
|
23
|
+
const client = config.client ?? new GoogleGenAI(buildClientOptions(config));
|
|
24
|
+
return createAdapter({
|
|
25
|
+
metadata: {
|
|
26
|
+
id: "google",
|
|
27
|
+
provider: "google",
|
|
28
|
+
model: config.model,
|
|
29
|
+
type: "language",
|
|
30
|
+
capabilities: [
|
|
31
|
+
{ stream: true, toolCalls: true, provider: "google" },
|
|
32
|
+
{
|
|
33
|
+
messageTransformation: (_modelId, _provider) => ({
|
|
34
|
+
preferredRenderer: "markdown",
|
|
35
|
+
roleMapping: {
|
|
36
|
+
event: "user",
|
|
37
|
+
ephemeral: "user",
|
|
38
|
+
},
|
|
39
|
+
delimiters: {
|
|
40
|
+
useDelimiters: true,
|
|
41
|
+
event: "[Event]",
|
|
42
|
+
ephemeral: "[Context]",
|
|
43
|
+
},
|
|
44
|
+
ephemeralPosition: "flow",
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
prepareInput: async (input) => {
|
|
50
|
+
const normalizedInput = normalizeModelInput(input, config);
|
|
51
|
+
const contents = [];
|
|
52
|
+
let systemInstruction;
|
|
53
|
+
for (const message of normalizedInput.messages) {
|
|
54
|
+
if (message.role === "system") {
|
|
55
|
+
systemInstruction = message.content
|
|
56
|
+
.filter((block) => block.type === "text")
|
|
57
|
+
.map((block) => block.text)
|
|
58
|
+
.join("\n\n");
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const parts = convertBlocksToGoogleParts(message.content);
|
|
62
|
+
if (parts.length === 0)
|
|
63
|
+
continue;
|
|
64
|
+
contents.push({
|
|
65
|
+
role: message.role === "assistant" ? "model" : "user",
|
|
66
|
+
parts,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const generateConfig = {
|
|
70
|
+
temperature: normalizedInput.temperature,
|
|
71
|
+
maxOutputTokens: normalizedInput.maxTokens,
|
|
72
|
+
topP: normalizedInput.topP,
|
|
73
|
+
stopSequences: normalizedInput.stop,
|
|
74
|
+
};
|
|
75
|
+
if (systemInstruction) {
|
|
76
|
+
generateConfig.systemInstruction = { parts: [{ text: systemInstruction }] };
|
|
77
|
+
}
|
|
78
|
+
if (normalizedInput.tools.length > 0) {
|
|
79
|
+
const allFunctionDeclarations = normalizedInput.tools.flatMap((tool) => {
|
|
80
|
+
const mapped = mapToolDefinition(tool.metadata);
|
|
81
|
+
return mapped.functionDeclarations || [];
|
|
82
|
+
});
|
|
83
|
+
generateConfig.tools = [{ functionDeclarations: allFunctionDeclarations }];
|
|
84
|
+
}
|
|
85
|
+
// Map responseFormat
|
|
86
|
+
if (normalizedInput.responseFormat) {
|
|
87
|
+
const rf = normalizedInput.responseFormat;
|
|
88
|
+
if (rf.type === "json" || rf.type === "json_schema") {
|
|
89
|
+
generateConfig.responseMimeType = "application/json";
|
|
90
|
+
}
|
|
91
|
+
if (rf.type === "json_schema") {
|
|
92
|
+
generateConfig.responseSchema = rf.schema;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
Object.keys(generateConfig).forEach((key) => {
|
|
96
|
+
if (generateConfig[key] === undefined)
|
|
97
|
+
delete generateConfig[key];
|
|
98
|
+
});
|
|
99
|
+
const googleOptions = normalizedInput.providerOptions?.google || {};
|
|
100
|
+
const { model: providerModel, ...providerConfigOptions } = googleOptions;
|
|
101
|
+
const finalConfig = { ...generateConfig, ...providerConfigOptions };
|
|
102
|
+
if (contents.length === 0) {
|
|
103
|
+
throw new ValidationError("contents", "No valid contents to send to Google. All messages were either system messages or had empty parts.");
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
model: providerModel || normalizedInput.model || config.model || "gemini-2.5-flash",
|
|
107
|
+
contents,
|
|
108
|
+
config: finalConfig,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
mapChunk: (chunk) => {
|
|
112
|
+
const candidate = chunk.candidates?.[0];
|
|
113
|
+
if (!candidate)
|
|
114
|
+
return null;
|
|
115
|
+
const parts = candidate.content?.parts || [];
|
|
116
|
+
// Text content
|
|
117
|
+
for (const part of parts) {
|
|
118
|
+
if (part.text) {
|
|
119
|
+
return { type: "text", delta: part.text };
|
|
120
|
+
}
|
|
121
|
+
// Function calls
|
|
122
|
+
if (part.functionCall) {
|
|
123
|
+
return {
|
|
124
|
+
type: "tool_call",
|
|
125
|
+
id: part.functionCall.name || "",
|
|
126
|
+
name: part.functionCall.name || "",
|
|
127
|
+
input: part.functionCall.args || {},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Finish reason
|
|
132
|
+
if (candidate.finishReason) {
|
|
133
|
+
return {
|
|
134
|
+
type: "message_end",
|
|
135
|
+
stopReason: mapGoogleFinishReason(candidate.finishReason),
|
|
136
|
+
usage: chunk.usageMetadata
|
|
137
|
+
? {
|
|
138
|
+
inputTokens: chunk.usageMetadata.promptTokenCount || 0,
|
|
139
|
+
outputTokens: chunk.usageMetadata.candidatesTokenCount || 0,
|
|
140
|
+
totalTokens: chunk.usageMetadata.totalTokenCount || 0,
|
|
141
|
+
}
|
|
142
|
+
: undefined,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
},
|
|
147
|
+
processOutput: async (output) => {
|
|
148
|
+
const candidate = output.candidates?.[0];
|
|
149
|
+
if (!candidate) {
|
|
150
|
+
throw new AdapterError("google", "No candidates in Google response", "ADAPTER_RESPONSE");
|
|
151
|
+
}
|
|
152
|
+
const content = [];
|
|
153
|
+
for (const part of candidate.content?.parts || []) {
|
|
154
|
+
if (part.text) {
|
|
155
|
+
content.push({ type: "text", text: part.text || "" });
|
|
156
|
+
}
|
|
157
|
+
else if (part.functionCall) {
|
|
158
|
+
content.push({
|
|
159
|
+
type: "tool_use",
|
|
160
|
+
toolUseId: part.functionCall.name || "",
|
|
161
|
+
name: part.functionCall.name || "",
|
|
162
|
+
input: part.functionCall.args || {},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const toolCalls = content
|
|
167
|
+
.filter((block) => block.type === "tool_use")
|
|
168
|
+
.map((block) => ({
|
|
169
|
+
id: block.toolUseId,
|
|
170
|
+
name: block.name,
|
|
171
|
+
input: block.input,
|
|
172
|
+
}));
|
|
173
|
+
const messages = [{ role: "assistant", content }];
|
|
174
|
+
return {
|
|
175
|
+
model: output.modelVersion || "unknown",
|
|
176
|
+
createdAt: new Date().toISOString(),
|
|
177
|
+
messages,
|
|
178
|
+
get message() {
|
|
179
|
+
return messages.filter((m) => m.role === "assistant").at(-1);
|
|
180
|
+
},
|
|
181
|
+
stopReason: mapGoogleFinishReason(candidate.finishReason),
|
|
182
|
+
toolCalls: toolCalls.length > 0 ? toolCalls : undefined,
|
|
183
|
+
usage: output.usageMetadata
|
|
184
|
+
? {
|
|
185
|
+
inputTokens: output.usageMetadata.promptTokenCount || 0,
|
|
186
|
+
outputTokens: output.usageMetadata.candidatesTokenCount || 0,
|
|
187
|
+
totalTokens: output.usageMetadata.totalTokenCount || 0,
|
|
188
|
+
reasoningTokens: output.usageMetadata.thoughtsTokenCount || 0,
|
|
189
|
+
cachedInputTokens: output.usageMetadata.cachedContentTokenCount || 0,
|
|
190
|
+
}
|
|
191
|
+
: {
|
|
192
|
+
inputTokens: 0,
|
|
193
|
+
outputTokens: 0,
|
|
194
|
+
totalTokens: 0,
|
|
195
|
+
reasoningTokens: 0,
|
|
196
|
+
cachedInputTokens: 0,
|
|
197
|
+
},
|
|
198
|
+
raw: output,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
execute: async (params) => {
|
|
202
|
+
const model = params.model || "gemini-1.5-flash";
|
|
203
|
+
const { model: _, ...requestParams } = params;
|
|
204
|
+
return await client.models.generateContent({ model, ...requestParams });
|
|
205
|
+
},
|
|
206
|
+
executeStream: async function* (params) {
|
|
207
|
+
const model = params.model || "gemini-1.5-flash";
|
|
208
|
+
const { model: _, ...requestParams } = params;
|
|
209
|
+
const stream = await client.models.generateContentStream({ model, ...requestParams });
|
|
210
|
+
for await (const chunk of stream) {
|
|
211
|
+
yield chunk;
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
reconstructRaw: (accumulated) => {
|
|
215
|
+
// Reconstruct a GenerateContentResponse-like object from streaming data
|
|
216
|
+
const chunks = accumulated.chunks;
|
|
217
|
+
const firstChunk = chunks[0];
|
|
218
|
+
// Map internal stop reason to Google FinishReason
|
|
219
|
+
const finishReason = (() => {
|
|
220
|
+
switch (accumulated.stopReason) {
|
|
221
|
+
case StopReason.STOP:
|
|
222
|
+
return FinishReason.STOP;
|
|
223
|
+
case StopReason.MAX_TOKENS:
|
|
224
|
+
return FinishReason.MAX_TOKENS;
|
|
225
|
+
case StopReason.TOOL_USE:
|
|
226
|
+
return FinishReason.STOP; // Google doesn't have a tool_calls finish reason
|
|
227
|
+
case StopReason.CONTENT_FILTER:
|
|
228
|
+
return FinishReason.SAFETY;
|
|
229
|
+
default:
|
|
230
|
+
return FinishReason.STOP;
|
|
231
|
+
}
|
|
232
|
+
})();
|
|
233
|
+
// Build parts array from accumulated content
|
|
234
|
+
const parts = [];
|
|
235
|
+
if (accumulated.text) {
|
|
236
|
+
parts.push({ text: accumulated.text });
|
|
237
|
+
}
|
|
238
|
+
// Add function calls from tool calls
|
|
239
|
+
for (const tc of accumulated.toolCalls) {
|
|
240
|
+
parts.push({
|
|
241
|
+
functionCall: {
|
|
242
|
+
name: tc.name,
|
|
243
|
+
args: tc.input,
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
// Reconstruct the GenerateContentResponse format
|
|
248
|
+
const reconstructed = {
|
|
249
|
+
candidates: [
|
|
250
|
+
{
|
|
251
|
+
content: {
|
|
252
|
+
role: "model",
|
|
253
|
+
parts,
|
|
254
|
+
},
|
|
255
|
+
finishReason,
|
|
256
|
+
index: 0,
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
usageMetadata: {
|
|
260
|
+
promptTokenCount: accumulated.usage.inputTokens,
|
|
261
|
+
candidatesTokenCount: accumulated.usage.outputTokens,
|
|
262
|
+
totalTokenCount: accumulated.usage.totalTokens,
|
|
263
|
+
},
|
|
264
|
+
modelVersion: accumulated.model || firstChunk?.modelVersion,
|
|
265
|
+
};
|
|
266
|
+
return reconstructed;
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Convenience factory for creating Google model.
|
|
272
|
+
*
|
|
273
|
+
* Returns a ModelClass that can be used as:
|
|
274
|
+
* - JSX component: `<model><Agent /></model>`
|
|
275
|
+
* - App config: `createApp(Agent, { model })`
|
|
276
|
+
* - Direct calls: `await model.generate(input)`
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* ```typescript
|
|
280
|
+
* const model = google({ model: 'gemini-2.0-flash' });
|
|
281
|
+
*
|
|
282
|
+
* // As JSX
|
|
283
|
+
* <model><MyAgent /></model>
|
|
284
|
+
*
|
|
285
|
+
* // With createApp
|
|
286
|
+
* const app = createApp(MyAgent, { model });
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
export function google(config) {
|
|
290
|
+
return createGoogleModel(config);
|
|
291
|
+
}
|
|
292
|
+
// ============================================================================
|
|
293
|
+
// Helper Functions
|
|
294
|
+
// ============================================================================
|
|
295
|
+
export function buildClientOptions(config) {
|
|
296
|
+
const options = {};
|
|
297
|
+
if (config.apiKey)
|
|
298
|
+
options.apiKey = config.apiKey;
|
|
299
|
+
if (config.vertexai) {
|
|
300
|
+
options.vertexai = true;
|
|
301
|
+
if (config.project)
|
|
302
|
+
options.project = config.project;
|
|
303
|
+
if (config.location)
|
|
304
|
+
options.location = config.location;
|
|
305
|
+
}
|
|
306
|
+
if (config.timeout || config.baseUrl) {
|
|
307
|
+
options.httpOptions = {};
|
|
308
|
+
if (config.timeout)
|
|
309
|
+
options.httpOptions.timeout = config.timeout;
|
|
310
|
+
if (config.baseUrl)
|
|
311
|
+
options.httpOptions.baseUrl = config.baseUrl;
|
|
312
|
+
}
|
|
313
|
+
if (config.googleAuthOptions)
|
|
314
|
+
options.googleAuthOptions = config.googleAuthOptions;
|
|
315
|
+
if (config.providerOptions?.google)
|
|
316
|
+
Object.assign(options, config.providerOptions.google);
|
|
317
|
+
return options;
|
|
318
|
+
}
|
|
319
|
+
export function mapGoogleFinishReason(finishReason) {
|
|
320
|
+
return finishReason ? STOP_REASON_MAP[finishReason] || StopReason.STOP : StopReason.STOP;
|
|
321
|
+
}
|
|
322
|
+
export function convertBlocksToGoogleParts(blocks) {
|
|
323
|
+
const parts = [];
|
|
324
|
+
for (const block of blocks) {
|
|
325
|
+
switch (block.type) {
|
|
326
|
+
case "text":
|
|
327
|
+
parts.push({ text: block.text });
|
|
328
|
+
break;
|
|
329
|
+
case "image":
|
|
330
|
+
if (block.source.type === "url") {
|
|
331
|
+
parts.push({
|
|
332
|
+
fileData: {
|
|
333
|
+
mimeType: block.source.mimeType || "image/jpeg",
|
|
334
|
+
fileUri: block.source.url,
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
else if (block.source.type === "base64") {
|
|
339
|
+
parts.push({
|
|
340
|
+
inlineData: {
|
|
341
|
+
mimeType: block.source.mimeType || "image/jpeg",
|
|
342
|
+
data: block.source.data,
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
break;
|
|
347
|
+
case "tool_use":
|
|
348
|
+
parts.push({
|
|
349
|
+
functionCall: {
|
|
350
|
+
name: block.name,
|
|
351
|
+
args: block.input,
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
break;
|
|
355
|
+
case "tool_result":
|
|
356
|
+
const resultText = block.content
|
|
357
|
+
?.filter((c) => c.type === "text")
|
|
358
|
+
.map((c) => c.text)
|
|
359
|
+
.join("\n") || JSON.stringify(block.content);
|
|
360
|
+
parts.push({
|
|
361
|
+
functionResponse: {
|
|
362
|
+
id: block.toolUseId,
|
|
363
|
+
name: block.name,
|
|
364
|
+
response: { result: resultText },
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
break;
|
|
368
|
+
default:
|
|
369
|
+
const blockText = block.text || JSON.stringify(block, null, 2);
|
|
370
|
+
parts.push({ text: blockText });
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return parts;
|
|
375
|
+
}
|
|
376
|
+
export function mapToolDefinition(tool) {
|
|
377
|
+
if (typeof tool === "string") {
|
|
378
|
+
return {
|
|
379
|
+
functionDeclarations: [{ name: tool, description: "", parameters: {} }],
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
if ("name" in tool && "input" in tool) {
|
|
383
|
+
const toolDef = tool;
|
|
384
|
+
const baseTool = {
|
|
385
|
+
functionDeclarations: [
|
|
386
|
+
{
|
|
387
|
+
name: toolDef.name,
|
|
388
|
+
description: toolDef.description || "",
|
|
389
|
+
parameters: toolDef.input || {},
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
};
|
|
393
|
+
if (toolDef.providerOptions?.google) {
|
|
394
|
+
const googleConfig = toolDef.providerOptions.google;
|
|
395
|
+
return {
|
|
396
|
+
...baseTool,
|
|
397
|
+
...googleConfig,
|
|
398
|
+
functionDeclarations: googleConfig.functionDeclarations || baseTool.functionDeclarations,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
return baseTool;
|
|
402
|
+
}
|
|
403
|
+
const metadata = tool.metadata || tool;
|
|
404
|
+
return {
|
|
405
|
+
functionDeclarations: [
|
|
406
|
+
{
|
|
407
|
+
name: metadata?.id || metadata?.name || "unknown",
|
|
408
|
+
description: metadata?.description || "",
|
|
409
|
+
parameters: metadata?.inputSchema || {},
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
//# sourceMappingURL=google.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.js","sourceRoot":"","sources":["../src/google.ts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AAO;gBACL,GAAG,QAAQ;gBACX,GAAG,YAAY;gBACf,oBAAoB,EAAE,YAAY,CAAC,oBAAoB,IAAI,QAAQ,CAAC,oBAAoB;aACzF,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAI,IAAY,CAAC,QAAQ,IAAI,IAAI,CAAC;IAChD,OAAO;QACL,oBAAoB,EAAE;YACpB;gBACE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,QAAQ,EAAE,IAAI,IAAI,SAAS;gBACjD,WAAW,EAAE,QAAQ,EAAE,WAAW,IAAI,EAAE;gBACxC,UAAU,EAAE,QAAQ,EAAE,WAAW,IAAI,EAAE;aACxC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ModelComponentProps } from "@agentick/core/jsx";
|
|
2
|
+
import { type GoogleAdapterConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Props for GoogleModel component.
|
|
5
|
+
* Extends adapter config with optional Model component props.
|
|
6
|
+
*/
|
|
7
|
+
export interface GoogleModelProps extends GoogleAdapterConfig {
|
|
8
|
+
/** Optional callback when model is mounted */
|
|
9
|
+
onMount?: ModelComponentProps["onMount"];
|
|
10
|
+
/** Optional callback when model is unmounted */
|
|
11
|
+
onUnmount?: ModelComponentProps["onUnmount"];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* GoogleModel component for declarative model configuration in JSX.
|
|
15
|
+
*
|
|
16
|
+
* Creates a Google model adapter internally and wraps it in a Model component.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Basic usage
|
|
21
|
+
* <GoogleModel model="gemini-2.5-flash" />
|
|
22
|
+
*
|
|
23
|
+
* // With config
|
|
24
|
+
* <GoogleModel
|
|
25
|
+
* model="gemini-2.5-flash"
|
|
26
|
+
* temperature={0.7}
|
|
27
|
+
* maxTokens={1000}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* // With Vertex AI
|
|
31
|
+
* <GoogleModel
|
|
32
|
+
* model="gemini-2.5-flash"
|
|
33
|
+
* vertexai={true}
|
|
34
|
+
* project="my-project"
|
|
35
|
+
* location="us-central1"
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function GoogleModel(props: GoogleModelProps): import("@agentick/core/jsx-runtime").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=google.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.model.d.ts","sourceRoot":"","sources":["../src/google.model.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAS,MAAM,oBAAoB,CAAC;AAGrE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,8CAA8C;IAC9C,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACzC,gDAAgD;IAChD,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,oDAIlD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// JSX Component
|
|
3
|
+
// ============================================================================
|
|
4
|
+
import { Model } from "@tentickle/core/jsx";
|
|
5
|
+
import { createElement } from "@tentickle/core/jsx-runtime";
|
|
6
|
+
import { createGoogleModel } from "./google";
|
|
7
|
+
import {} from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* GoogleModel component for declarative model configuration in JSX.
|
|
10
|
+
*
|
|
11
|
+
* Creates a Google model adapter internally and wraps it in a Model component.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Basic usage
|
|
16
|
+
* <GoogleModel model="gemini-2.5-flash" />
|
|
17
|
+
*
|
|
18
|
+
* // With config
|
|
19
|
+
* <GoogleModel
|
|
20
|
+
* model="gemini-2.5-flash"
|
|
21
|
+
* temperature={0.7}
|
|
22
|
+
* maxTokens={1000}
|
|
23
|
+
* />
|
|
24
|
+
*
|
|
25
|
+
* // With Vertex AI
|
|
26
|
+
* <GoogleModel
|
|
27
|
+
* model="gemini-2.5-flash"
|
|
28
|
+
* vertexai={true}
|
|
29
|
+
* project="my-project"
|
|
30
|
+
* location="us-central1"
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export function GoogleModel(props) {
|
|
35
|
+
const { onMount, onUnmount, ...adapterConfig } = props;
|
|
36
|
+
const adapter = createGoogleModel(adapterConfig);
|
|
37
|
+
return createElement(Model, { model: adapter, onMount, onUnmount });
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=google.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.model.js","sourceRoot":"","sources":["../src/google.model.tsx"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,OAAO,EAA4B,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAA4B,MAAM,SAAS,CAAC;AAanD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,OAAO,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// JSX Component
|
|
3
|
+
// ============================================================================
|
|
4
|
+
import { Model } from "@agentick/core/jsx";
|
|
5
|
+
import { createElement } from "@agentick/core/jsx-runtime";
|
|
6
|
+
import { createGoogleModel } from "./google";
|
|
7
|
+
import {} from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* GoogleModel component for declarative model configuration in JSX.
|
|
10
|
+
*
|
|
11
|
+
* Creates a Google model adapter internally and wraps it in a Model component.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Basic usage
|
|
16
|
+
* <GoogleModel model="gemini-2.5-flash" />
|
|
17
|
+
*
|
|
18
|
+
* // With config
|
|
19
|
+
* <GoogleModel
|
|
20
|
+
* model="gemini-2.5-flash"
|
|
21
|
+
* temperature={0.7}
|
|
22
|
+
* maxTokens={1000}
|
|
23
|
+
* />
|
|
24
|
+
*
|
|
25
|
+
* // With Vertex AI
|
|
26
|
+
* <GoogleModel
|
|
27
|
+
* model="gemini-2.5-flash"
|
|
28
|
+
* vertexai={true}
|
|
29
|
+
* project="my-project"
|
|
30
|
+
* location="us-central1"
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export function GoogleModel(props) {
|
|
35
|
+
const { onMount, onUnmount, ...adapterConfig } = props;
|
|
36
|
+
const adapter = createGoogleModel(adapterConfig);
|
|
37
|
+
return createElement(Model, { model: adapter, onMount, onUnmount });
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=google.model.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.model.jsx","sourceRoot":"","sources":["../src/google.model.tsx"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,OAAO,EAA4B,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAA4B,MAAM,SAAS,CAAC;AAanD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,OAAO,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Agentick Google AI Adapter
|
|
3
|
+
*
|
|
4
|
+
* Native Google AI (Gemini) adapter for Agentick. Provides direct integration
|
|
5
|
+
* with Google's Gemini models without requiring the Vercel AI SDK.
|
|
6
|
+
*
|
|
7
|
+
* ## Features
|
|
8
|
+
*
|
|
9
|
+
* - **Native API** - Direct Google AI API integration
|
|
10
|
+
* - **Streaming** - Full streaming support
|
|
11
|
+
* - **Tool Calling** - Native function calling support
|
|
12
|
+
* - **Multimodal** - Image and document understanding
|
|
13
|
+
* - **All Models** - Gemini Pro, Gemini Flash, and more
|
|
14
|
+
*
|
|
15
|
+
* ## Quick Start
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { google } from '@agentick/google';
|
|
19
|
+
*
|
|
20
|
+
* const model = google('gemini-1.5-pro');
|
|
21
|
+
*
|
|
22
|
+
* // Use with app
|
|
23
|
+
* const app = createApp(<MyAgent />);
|
|
24
|
+
* const result = await app.run({ messages });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @module @agentick/google
|
|
28
|
+
*/
|
|
29
|
+
export * from "./google";
|
|
30
|
+
export * from "./google.model";
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Agentick Google AI Adapter
|
|
3
|
+
*
|
|
4
|
+
* Native Google AI (Gemini) adapter for Agentick. Provides direct integration
|
|
5
|
+
* with Google's Gemini models without requiring the Vercel AI SDK.
|
|
6
|
+
*
|
|
7
|
+
* ## Features
|
|
8
|
+
*
|
|
9
|
+
* - **Native API** - Direct Google AI API integration
|
|
10
|
+
* - **Streaming** - Full streaming support
|
|
11
|
+
* - **Tool Calling** - Native function calling support
|
|
12
|
+
* - **Multimodal** - Image and document understanding
|
|
13
|
+
* - **All Models** - Gemini Pro, Gemini Flash, and more
|
|
14
|
+
*
|
|
15
|
+
* ## Quick Start
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { google } from '@agentick/google';
|
|
19
|
+
*
|
|
20
|
+
* const model = google('gemini-1.5-pro');
|
|
21
|
+
*
|
|
22
|
+
* // Use with app
|
|
23
|
+
* const app = createApp(<MyAgent />);
|
|
24
|
+
* const result = await app.run({ messages });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @module @agentick/google
|
|
28
|
+
*/
|
|
29
|
+
export * from "./google";
|
|
30
|
+
export * from "./google.model";
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|