@convex-dev/agent 0.0.1 → 0.0.3-alpha.0
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 +27 -0
- package/dist/commonjs/client/index.d.ts +792 -83
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +119 -155
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/component/messages.d.ts +11 -3
- package/dist/commonjs/component/messages.d.ts.map +1 -1
- package/dist/commonjs/component/messages.js +2 -1
- package/dist/commonjs/component/messages.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +18 -12
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +1 -0
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/commonjs/component/vector/index.d.ts.map +1 -1
- package/dist/commonjs/component/vector/index.js +1 -1
- package/dist/commonjs/component/vector/index.js.map +1 -1
- package/dist/commonjs/logging.d.ts +18 -0
- package/dist/commonjs/logging.d.ts.map +1 -0
- package/dist/commonjs/logging.js +78 -0
- package/dist/commonjs/logging.js.map +1 -0
- package/dist/commonjs/mapping.d.ts +3 -6
- package/dist/commonjs/mapping.d.ts.map +1 -1
- package/dist/commonjs/mapping.js +46 -20
- package/dist/commonjs/mapping.js.map +1 -1
- package/dist/commonjs/validators.d.ts +2736 -76
- package/dist/commonjs/validators.d.ts.map +1 -1
- package/dist/commonjs/validators.js +72 -7
- package/dist/commonjs/validators.js.map +1 -1
- package/dist/esm/client/index.d.ts +792 -83
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +119 -155
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/component/messages.d.ts +11 -3
- package/dist/esm/component/messages.d.ts.map +1 -1
- package/dist/esm/component/messages.js +2 -1
- package/dist/esm/component/messages.js.map +1 -1
- package/dist/esm/component/schema.d.ts +18 -12
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +1 -0
- package/dist/esm/component/schema.js.map +1 -1
- package/dist/esm/component/vector/index.d.ts.map +1 -1
- package/dist/esm/component/vector/index.js +1 -1
- package/dist/esm/component/vector/index.js.map +1 -1
- package/dist/esm/logging.d.ts +18 -0
- package/dist/esm/logging.d.ts.map +1 -0
- package/dist/esm/logging.js +78 -0
- package/dist/esm/logging.js.map +1 -0
- package/dist/esm/mapping.d.ts +3 -6
- package/dist/esm/mapping.d.ts.map +1 -1
- package/dist/esm/mapping.js +46 -20
- package/dist/esm/mapping.js.map +1 -1
- package/dist/esm/validators.d.ts +2736 -76
- package/dist/esm/validators.d.ts.map +1 -1
- package/dist/esm/validators.js +72 -7
- package/dist/esm/validators.js.map +1 -1
- package/package.json +7 -7
- package/src/client/index.ts +277 -193
- package/src/component/_generated/api.d.ts +5 -0
- package/src/component/messages.ts +2 -1
- package/src/component/schema.ts +1 -0
- package/src/component/vector/index.ts +1 -7
- package/src/logging.ts +103 -0
- package/src/mapping.ts +61 -29
- package/src/validators.ts +102 -9
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ AI Agent framework built on Convex.
|
|
|
10
10
|
- RAG for chat context, via hybrid text & vector search, with configuration options.
|
|
11
11
|
Or use the API to query the history yourself and do it your way.
|
|
12
12
|
- Opt-in search for messages from other threads (for the same specified user).
|
|
13
|
+
- Support for generating and storing objects in messages (as JSON).
|
|
13
14
|
- Tool calls via the AI SDK, along with Convex-specific helpers.
|
|
14
15
|
- Easy workflow integration with the [Workflow component](https://convex.dev/components/workflow).
|
|
15
16
|
- Reactive & realtime updates to asynchronous threads.
|
|
@@ -341,4 +342,30 @@ Read more in [this Stack post](https://stack.convex.dev/ai-agents).
|
|
|
341
342
|
npm i @convex-dev/agent
|
|
342
343
|
```
|
|
343
344
|
|
|
345
|
+
## Troubleshooting
|
|
346
|
+
|
|
347
|
+
### Circular dependencies
|
|
348
|
+
|
|
349
|
+
Having the return value of workflows depend on other Convex functions can lead to circular dependencies due to the
|
|
350
|
+
`internal.foo.bar` way of specifying functions. The way to fix this is to explicitly type the return value of the
|
|
351
|
+
workflow. When in doubt, add return types to more `handler` functions, like this:
|
|
352
|
+
|
|
353
|
+
```diff
|
|
354
|
+
export const supportAgentWorkflow = workflow.define({
|
|
355
|
+
args: { prompt: v.string(), userId: v.string(), threadId: v.string() },
|
|
356
|
+
+ handler: async (step, { prompt, userId, threadId }): Promise<string> => {
|
|
357
|
+
// ...
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// And regular functions too:
|
|
362
|
+
export const myFunction = action({
|
|
363
|
+
args: { prompt: v.string() },
|
|
364
|
+
+ handler: async (ctx, { prompt }): Promise<string> => {
|
|
365
|
+
// ...
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
|
|
344
371
|
<!-- END: Include on https://convex.dev/components -->
|