@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/types.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { GoogleGenAI } from "@google/genai";
|
|
2
|
+
import { type GenerateContentParameters } from "@google/genai";
|
|
3
|
+
import { type ProviderClientOptions } from "@agentick/core";
|
|
4
|
+
import { StopReason } from "@agentick/shared";
|
|
5
|
+
/**
|
|
6
|
+
* Google-specific client initialization options.
|
|
7
|
+
*/
|
|
8
|
+
export interface GoogleClientOptions {
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
vertexai?: boolean;
|
|
11
|
+
project?: string;
|
|
12
|
+
location?: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
googleAuthOptions?: {
|
|
16
|
+
keyFilename?: string;
|
|
17
|
+
keyFile?: string;
|
|
18
|
+
credentials?: any;
|
|
19
|
+
clientOptions?: any;
|
|
20
|
+
scopes?: string[];
|
|
21
|
+
projectId?: string;
|
|
22
|
+
universeDomain?: string;
|
|
23
|
+
};
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Google-specific generation options.
|
|
28
|
+
*/
|
|
29
|
+
export type GoogleGenerationOptions = Partial<GenerateContentParameters> & {
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Google-specific tool options.
|
|
34
|
+
*/
|
|
35
|
+
export interface GoogleToolOptions {
|
|
36
|
+
functionDeclarations?: Array<{
|
|
37
|
+
name?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
parameters?: Record<string, unknown>;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}>;
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Module augmentation: Extend provider option interfaces to include Google-specific options.
|
|
46
|
+
*/
|
|
47
|
+
declare module "@agentick/core" {
|
|
48
|
+
interface ProviderClientOptions {
|
|
49
|
+
google?: GoogleClientOptions;
|
|
50
|
+
}
|
|
51
|
+
interface ProviderGenerationOptions {
|
|
52
|
+
google?: GoogleGenerationOptions;
|
|
53
|
+
}
|
|
54
|
+
interface ProviderToolOptions {
|
|
55
|
+
google?: GoogleToolOptions;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export interface GoogleAdapterConfig {
|
|
59
|
+
apiKey?: string;
|
|
60
|
+
vertexai?: boolean;
|
|
61
|
+
project?: string;
|
|
62
|
+
location?: string;
|
|
63
|
+
timeout?: number;
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
googleAuthOptions?: GoogleClientOptions["googleAuthOptions"];
|
|
66
|
+
model?: string;
|
|
67
|
+
client?: GoogleGenAI;
|
|
68
|
+
providerOptions?: ProviderClientOptions;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Map Google FinishReason enum values to normalized StopReason.
|
|
72
|
+
*
|
|
73
|
+
* Google FinishReason values (from @google/genai):
|
|
74
|
+
* - FINISH_REASON_UNSPECIFIED: Default/unused value
|
|
75
|
+
* - STOP: Natural stop or provided stop sequence
|
|
76
|
+
* - MAX_TOKENS: Maximum token limit reached
|
|
77
|
+
* - SAFETY: Flagged for safety reasons
|
|
78
|
+
* - RECITATION: Flagged for recitation
|
|
79
|
+
* - LANGUAGE: Unsupported language
|
|
80
|
+
* - OTHER: Unknown reason
|
|
81
|
+
* - BLOCKLIST: Contains forbidden terms
|
|
82
|
+
* - PROHIBITED_CONTENT: Potentially prohibited content
|
|
83
|
+
* - SPII: Sensitive Personally Identifiable Information
|
|
84
|
+
* - MALFORMED_FUNCTION_CALL: Invalid function call
|
|
85
|
+
* - IMAGE_SAFETY/IMAGE_PROHIBITED_CONTENT/IMAGE_OTHER/NO_IMAGE/IMAGE_RECITATION: Image-related stops
|
|
86
|
+
* - UNEXPECTED_TOOL_CALL: Tool call when no tools enabled
|
|
87
|
+
* - TOO_MANY_TOOL_CALLS: Consecutive tool call limit exceeded
|
|
88
|
+
* - MISSING_THOUGHT_SIGNATURE: Missing thought signature
|
|
89
|
+
*/
|
|
90
|
+
export declare const STOP_REASON_MAP: Record<string, StopReason>;
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EA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AAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,eAAe,CAAC,EAAE,qBAAqB,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA6BtD,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {} from "@google/genai";
|
|
2
|
+
import {} from "@agentick/core";
|
|
3
|
+
import { StopReason } from "@agentick/shared";
|
|
4
|
+
/**
|
|
5
|
+
* Map Google FinishReason enum values to normalized StopReason.
|
|
6
|
+
*
|
|
7
|
+
* Google FinishReason values (from @google/genai):
|
|
8
|
+
* - FINISH_REASON_UNSPECIFIED: Default/unused value
|
|
9
|
+
* - STOP: Natural stop or provided stop sequence
|
|
10
|
+
* - MAX_TOKENS: Maximum token limit reached
|
|
11
|
+
* - SAFETY: Flagged for safety reasons
|
|
12
|
+
* - RECITATION: Flagged for recitation
|
|
13
|
+
* - LANGUAGE: Unsupported language
|
|
14
|
+
* - OTHER: Unknown reason
|
|
15
|
+
* - BLOCKLIST: Contains forbidden terms
|
|
16
|
+
* - PROHIBITED_CONTENT: Potentially prohibited content
|
|
17
|
+
* - SPII: Sensitive Personally Identifiable Information
|
|
18
|
+
* - MALFORMED_FUNCTION_CALL: Invalid function call
|
|
19
|
+
* - IMAGE_SAFETY/IMAGE_PROHIBITED_CONTENT/IMAGE_OTHER/NO_IMAGE/IMAGE_RECITATION: Image-related stops
|
|
20
|
+
* - UNEXPECTED_TOOL_CALL: Tool call when no tools enabled
|
|
21
|
+
* - TOO_MANY_TOOL_CALLS: Consecutive tool call limit exceeded
|
|
22
|
+
* - MISSING_THOUGHT_SIGNATURE: Missing thought signature
|
|
23
|
+
*/
|
|
24
|
+
export const STOP_REASON_MAP = {
|
|
25
|
+
// Core stop reasons
|
|
26
|
+
FINISH_REASON_UNSPECIFIED: StopReason.UNSPECIFIED,
|
|
27
|
+
STOP: StopReason.STOP,
|
|
28
|
+
MAX_TOKENS: StopReason.MAX_TOKENS,
|
|
29
|
+
// Safety and content filtering
|
|
30
|
+
SAFETY: StopReason.CONTENT_FILTER,
|
|
31
|
+
RECITATION: StopReason.CONTENT_FILTER,
|
|
32
|
+
LANGUAGE: StopReason.CONTENT_FILTER,
|
|
33
|
+
BLOCKLIST: StopReason.CONTENT_FILTER,
|
|
34
|
+
PROHIBITED_CONTENT: StopReason.CONTENT_FILTER,
|
|
35
|
+
SPII: StopReason.CONTENT_FILTER,
|
|
36
|
+
// Tool/function call related
|
|
37
|
+
MALFORMED_FUNCTION_CALL: StopReason.FORMAT_ERROR,
|
|
38
|
+
UNEXPECTED_TOOL_CALL: StopReason.ERROR,
|
|
39
|
+
TOO_MANY_TOOL_CALLS: StopReason.ERROR,
|
|
40
|
+
// Image generation related
|
|
41
|
+
IMAGE_SAFETY: StopReason.CONTENT_FILTER,
|
|
42
|
+
IMAGE_PROHIBITED_CONTENT: StopReason.CONTENT_FILTER,
|
|
43
|
+
IMAGE_OTHER: StopReason.OTHER,
|
|
44
|
+
NO_IMAGE: StopReason.NO_CONTENT,
|
|
45
|
+
IMAGE_RECITATION: StopReason.CONTENT_FILTER,
|
|
46
|
+
// Other
|
|
47
|
+
OTHER: StopReason.OTHER,
|
|
48
|
+
MISSING_THOUGHT_SIGNATURE: StopReason.ERROR,
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,MAAM,eAAe,CAAC;AAC/D,OAAO,EAA8B,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA0E9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,eAAe,GAA+B;IACzD,oBAAoB;IACpB,yBAAyB,EAAE,UAAU,CAAC,WAAW;IACjD,IAAI,EAAE,UAAU,CAAC,IAAI;IACrB,UAAU,EAAE,UAAU,CAAC,UAAU;IAEjC,+BAA+B;IAC/B,MAAM,EAAE,UAAU,CAAC,cAAc;IACjC,UAAU,EAAE,UAAU,CAAC,cAAc;IACrC,QAAQ,EAAE,UAAU,CAAC,cAAc;IACnC,SAAS,EAAE,UAAU,CAAC,cAAc;IACpC,kBAAkB,EAAE,UAAU,CAAC,cAAc;IAC7C,IAAI,EAAE,UAAU,CAAC,cAAc;IAE/B,6BAA6B;IAC7B,uBAAuB,EAAE,UAAU,CAAC,YAAY;IAChD,oBAAoB,EAAE,UAAU,CAAC,KAAK;IACtC,mBAAmB,EAAE,UAAU,CAAC,KAAK;IAErC,2BAA2B;IAC3B,YAAY,EAAE,UAAU,CAAC,cAAc;IACvC,wBAAwB,EAAE,UAAU,CAAC,cAAc;IACnD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,QAAQ,EAAE,UAAU,CAAC,UAAU;IAC/B,gBAAgB,EAAE,UAAU,CAAC,cAAc;IAE3C,QAAQ;IACR,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,yBAAyB,EAAE,UAAU,CAAC,KAAK;CAC5C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentick/google",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Google AI adapter for Agentick",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"adapter",
|
|
7
|
+
"agent",
|
|
8
|
+
"ai",
|
|
9
|
+
"gemini",
|
|
10
|
+
"google"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/agenticklabs/agentick#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/agenticklabs/agentick/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"author": "Ryan Lindgren",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/agenticklabs/agentick.git",
|
|
21
|
+
"directory": "packages/adapters/google"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@agentick/core": "0.0.1",
|
|
33
|
+
"@agentick/shared": "0.0.1"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@google/genai": "^1.31.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -p tsconfig.build.json",
|
|
40
|
+
"test": "echo \"Tests run from workspace root\"",
|
|
41
|
+
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
42
|
+
"lint": "oxlint src/",
|
|
43
|
+
"format:check": "oxfmt --check src/",
|
|
44
|
+
"clean": "rm -rf dist",
|
|
45
|
+
"dev": "tsc --watch"
|
|
46
|
+
},
|
|
47
|
+
"types": "./dist/index.d.ts"
|
|
48
|
+
}
|