@arcote.tech/arc-ai-gemini 0.7.12 → 0.7.14
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/package.json +2 -2
- package/src/index.ts +14 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcote.tech/arc-ai-gemini",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.14",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Gemini (Google) adapter for Arc AI framework",
|
|
7
7
|
"main": "./src/index.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type-check": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@arcote.tech/arc-ai": "^0.7.
|
|
13
|
+
"@arcote.tech/arc-ai": "^0.7.14",
|
|
14
14
|
"typescript": "^5.0.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,18 @@ export interface GeminiConfig {
|
|
|
22
22
|
export function gemini(config: GeminiConfig): LLMProvider {
|
|
23
23
|
const baseUrl = "https://generativelanguage.googleapis.com/v1beta";
|
|
24
24
|
|
|
25
|
+
let filesWarned = false;
|
|
26
|
+
function warnIfFiles(request: CompletionRequest): void {
|
|
27
|
+
if (!request.files || request.files.length === 0) return;
|
|
28
|
+
if (filesWarned) return;
|
|
29
|
+
filesWarned = true;
|
|
30
|
+
console.warn(
|
|
31
|
+
"[arc-ai-gemini] request.files is set but Gemini adapter does not yet " +
|
|
32
|
+
"support file attachments — pliki będą zignorowane. Użyj OpenAI " +
|
|
33
|
+
"providera dla flow który wymaga file context.",
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
25
37
|
function generateToolCallId(): string {
|
|
26
38
|
return `tc_${crypto.randomUUID().replace(/-/g, "").slice(0, 24)}`;
|
|
27
39
|
}
|
|
@@ -130,6 +142,7 @@ export function gemini(config: GeminiConfig): LLMProvider {
|
|
|
130
142
|
async function complete(
|
|
131
143
|
request: CompletionRequest,
|
|
132
144
|
): Promise<CompletionResult> {
|
|
145
|
+
warnIfFiles(request);
|
|
133
146
|
const body = buildBody(request);
|
|
134
147
|
|
|
135
148
|
const response = await fetch(
|
|
@@ -181,6 +194,7 @@ export function gemini(config: GeminiConfig): LLMProvider {
|
|
|
181
194
|
request: CompletionRequest,
|
|
182
195
|
onChunk: (chunk: StreamChunk) => void,
|
|
183
196
|
): Promise<CompletionResult> {
|
|
197
|
+
warnIfFiles(request);
|
|
184
198
|
const body = buildBody(request);
|
|
185
199
|
|
|
186
200
|
const response = await fetch(
|