@simulacra-ai/google 0.0.1 → 0.0.3
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 +7 -4
- package/package.json +15 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Simulacra Google Provider
|
|
2
2
|
|
|
3
|
-
Google Gemini
|
|
3
|
+
The Google provider allows Simulacra to use Google Gemini models via the Google GenAI SDK, with support for thinking and automatic handling of Gemini's tool call quirks.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -15,10 +15,11 @@ import { Conversation } from "@simulacra-ai/core";
|
|
|
15
15
|
import { GoogleProvider } from "@simulacra-ai/google";
|
|
16
16
|
import { GoogleGenAI } from "@google/genai";
|
|
17
17
|
|
|
18
|
+
// create a provider and conversation
|
|
18
19
|
const provider = new GoogleProvider(new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY }), {
|
|
19
20
|
model: MODEL_NAME,
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
using conversation = new Conversation(provider);
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
### GoogleProviderConfig
|
|
@@ -35,6 +36,8 @@ Additional properties spread into the Gemini `config` object in the API request.
|
|
|
35
36
|
|
|
36
37
|
## Thinking
|
|
37
38
|
|
|
39
|
+
Thinking captures the model's reasoning process as `ThinkingMessageContent` blocks in the conversation history.
|
|
40
|
+
|
|
38
41
|
```typescript
|
|
39
42
|
const provider = new GoogleProvider(sdk, {
|
|
40
43
|
model,
|
|
@@ -45,9 +48,9 @@ const provider = new GoogleProvider(sdk, {
|
|
|
45
48
|
|
|
46
49
|
## GoogleToolCodeContextTransformer
|
|
47
50
|
|
|
48
|
-
Gemini models sometimes emit tool calls as inline code blocks instead of structured function calls. `GoogleToolCodeContextTransformer` intercepts these and converts them to standard `ToolContent` entries so the workflow engine can execute them.
|
|
51
|
+
Gemini models sometimes emit tool calls as inline code blocks instead of structured function calls. `GoogleToolCodeContextTransformer` intercepts these and converts them to standard `ToolContent` entries so the workflow engine can execute them normally.
|
|
49
52
|
|
|
50
|
-
This transformer is bundled with `GoogleProvider` by default as a provider context transformer
|
|
53
|
+
This transformer is bundled with `GoogleProvider` by default as a provider context transformer. To disable it, pass an empty array.
|
|
51
54
|
|
|
52
55
|
```typescript
|
|
53
56
|
const provider = new GoogleProvider(sdk, config, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simulacra-ai/google",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Google Gemini provider for the Simulacra conversation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,8 +17,21 @@
|
|
|
17
17
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@simulacra-ai/core": "0.0.
|
|
20
|
+
"@simulacra-ai/core": "0.0.3",
|
|
21
21
|
"@google/genai": ">=0.10.0 <2.0.0"
|
|
22
22
|
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/simulacra-ai/simulacra.git",
|
|
26
|
+
"directory": "packages/google"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/simulacra-ai/simulacra",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"ai",
|
|
31
|
+
"llm",
|
|
32
|
+
"google",
|
|
33
|
+
"gemini",
|
|
34
|
+
"agent"
|
|
35
|
+
],
|
|
23
36
|
"license": "MIT"
|
|
24
37
|
}
|