@mindstudio-ai/agent 0.0.2 → 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 +8 -8
- package/dist/index.d.ts +1382 -1596
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,25 +20,25 @@ import { MindStudioAgent } from '@mindstudio-ai/agent';
|
|
|
20
20
|
const agent = new MindStudioAgent({ apiKey: 'your-api-key' });
|
|
21
21
|
|
|
22
22
|
// Generate an image
|
|
23
|
-
const {
|
|
23
|
+
const { imageUrl } = await agent.generateImage({
|
|
24
24
|
prompt: 'A mountain landscape at sunset',
|
|
25
25
|
mode: 'background',
|
|
26
26
|
});
|
|
27
|
-
console.log(
|
|
27
|
+
console.log(imageUrl);
|
|
28
28
|
|
|
29
29
|
// Send a message to an AI model
|
|
30
|
-
const {
|
|
30
|
+
const { content } = await agent.userMessage({
|
|
31
31
|
message: 'Summarize this article: ...',
|
|
32
32
|
source: 'user',
|
|
33
33
|
});
|
|
34
|
-
console.log(
|
|
34
|
+
console.log(content);
|
|
35
35
|
|
|
36
36
|
// Search Google
|
|
37
|
-
const {
|
|
37
|
+
const { results } = await agent.searchGoogle({
|
|
38
38
|
query: 'TypeScript best practices 2025',
|
|
39
39
|
exportType: 'json',
|
|
40
40
|
});
|
|
41
|
-
console.log(
|
|
41
|
+
console.log(results);
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Every method is fully typed — your editor will autocomplete available parameters, show enum options, and infer the output shape.
|
|
@@ -70,7 +70,7 @@ Resolution order: constructor `apiKey` > `MINDSTUDIO_API_KEY` env > `CALLBACK_TO
|
|
|
70
70
|
|
|
71
71
|
## Thread persistence
|
|
72
72
|
|
|
73
|
-
Steps execute within threads. Pass
|
|
73
|
+
Steps execute within threads. Pass `$threadId` and `$appId` from a previous call to maintain state across calls:
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
76
|
const r1 = await agent.userMessage({
|
|
@@ -81,7 +81,7 @@ const r1 = await agent.userMessage({
|
|
|
81
81
|
// The model remembers the conversation
|
|
82
82
|
const r2 = await agent.userMessage(
|
|
83
83
|
{ message: 'What is my name?', source: 'user' },
|
|
84
|
-
{ threadId: r1
|
|
84
|
+
{ threadId: r1.$threadId, appId: r1.$appId },
|
|
85
85
|
);
|
|
86
86
|
```
|
|
87
87
|
|