agent-pulse 1.4.2 → 1.4.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/dist/providers/google.js +15 -0
- package/dist/providers/grok.js +3 -2
- package/package.json +2 -2
package/dist/providers/google.js
CHANGED
|
@@ -188,6 +188,21 @@ class GoogleProvider {
|
|
|
188
188
|
}];
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
+
// Inject reference_image from config as inlineData (provider-agnostic image editing)
|
|
192
|
+
if (config?.reference_image) {
|
|
193
|
+
const dataUriMatch = String(config.reference_image).match(/^data:(image\/\w+);base64,(.+)$/);
|
|
194
|
+
if (dataUriMatch) {
|
|
195
|
+
const lastUserMsg = [...contents].reverse().find((c) => c.role === 'user');
|
|
196
|
+
if (lastUserMsg) {
|
|
197
|
+
lastUserMsg.parts.push({
|
|
198
|
+
inlineData: {
|
|
199
|
+
mimeType: dataUriMatch[1],
|
|
200
|
+
data: dataUriMatch[2]
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
191
206
|
// 4. Call API (Streaming)
|
|
192
207
|
const result = await this.client.models.generateContentStream({
|
|
193
208
|
model: this.model,
|
package/dist/providers/grok.js
CHANGED
|
@@ -24,13 +24,14 @@ class GrokProvider {
|
|
|
24
24
|
? prompt.filter(m => m.role === 'user').map(m => m.content).join('\n')
|
|
25
25
|
: String(prompt);
|
|
26
26
|
let images;
|
|
27
|
-
if (config?.image_url) {
|
|
27
|
+
if (config?.reference_image || config?.image_url) {
|
|
28
28
|
// Image editing — direct JSON request to /v1/images/edits
|
|
29
29
|
// (OpenAI SDK's images.edit() uses multipart/form-data, but x.ai requires JSON)
|
|
30
|
+
const imageUrl = config.reference_image || config.image_url;
|
|
30
31
|
const body = {
|
|
31
32
|
model: this.model,
|
|
32
33
|
prompt: promptText,
|
|
33
|
-
image_url:
|
|
34
|
+
image_url: imageUrl,
|
|
34
35
|
n: config?.n || 1,
|
|
35
36
|
response_format: config?.response_format || 'b64_json',
|
|
36
37
|
...(config?.aspect_ratio && { aspect_ratio: config.aspect_ratio }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-pulse",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "A lightweight, agentic AI framework for JavaScript/TypeScript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
"typescript": "^5.3.3",
|
|
45
45
|
"vitest": "^1.3.1"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|