@convex-dev/agent 0.1.15-alpha.0 → 0.1.15-alpha.2
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 +13 -12
- package/dist/client/index.d.ts +494 -173
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +148 -170
- package/dist/client/index.js.map +1 -1
- package/dist/client/listMessages.d.ts +22 -0
- package/dist/client/listMessages.d.ts.map +1 -0
- package/dist/client/listMessages.js +25 -0
- package/dist/client/listMessages.js.map +1 -0
- package/dist/client/search.d.ts +162 -0
- package/dist/client/search.d.ts.map +1 -0
- package/dist/client/search.js +113 -0
- package/dist/client/search.js.map +1 -0
- package/dist/client/streaming.d.ts +17 -3
- package/dist/client/streaming.d.ts.map +1 -1
- package/dist/client/streaming.js +32 -0
- package/dist/client/streaming.js.map +1 -1
- package/dist/client/types.d.ts +5 -1
- package/dist/client/types.d.ts.map +1 -1
- package/dist/component/_generated/api.d.ts +2 -2
- package/dist/component/messages.d.ts +3 -3
- package/dist/component/messages.d.ts.map +1 -1
- package/dist/component/messages.js +12 -7
- package/dist/component/messages.js.map +1 -1
- package/dist/component/vector/index.js +3 -3
- package/dist/component/vector/index.js.map +1 -1
- package/dist/react/optimisticallySendMessage.d.ts +1 -0
- package/dist/react/optimisticallySendMessage.d.ts.map +1 -1
- package/dist/react/optimisticallySendMessage.js +8 -1
- package/dist/react/optimisticallySendMessage.js.map +1 -1
- package/dist/react/toUIMessages.d.ts +1 -0
- package/dist/react/toUIMessages.d.ts.map +1 -1
- package/dist/react/toUIMessages.js +2 -0
- package/dist/react/toUIMessages.js.map +1 -1
- package/dist/validators.d.ts +41 -52
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +1 -8
- package/dist/validators.js.map +1 -1
- package/package.json +6 -4
- package/src/client/index.ts +283 -274
- package/src/client/listMessages.ts +38 -0
- package/src/client/search.ts +172 -0
- package/src/client/streaming.ts +49 -2
- package/src/client/types.ts +5 -1
- package/src/component/_generated/api.d.ts +2 -2
- package/src/component/messages.ts +13 -7
- package/src/component/vector/index.ts +4 -4
- package/src/react/optimisticallySendMessage.ts +11 -1
- package/src/react/toUIMessages.ts +3 -0
- package/src/validators.ts +2 -10
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/@convex-dev%2fagent)
|
|
4
4
|
|
|
5
|
+
```sh
|
|
6
|
+
npm i @convex-dev/agent
|
|
7
|
+
```
|
|
5
8
|
<!-- START: Include on https://convex.dev/components -->
|
|
6
9
|
|
|
7
10
|
AI Agent framework built on Convex.
|
|
@@ -19,23 +22,27 @@ AI Agent framework built on Convex.
|
|
|
19
22
|
Enables long-lived, durable workflows defined as code.
|
|
20
23
|
- Reactive & realtime updates from asynchronous functions / workflows.
|
|
21
24
|
- Support for streaming text and storing the final result.
|
|
22
|
-
See [
|
|
25
|
+
See [chat/chat-streaming](./example/convex/chat/README.md).
|
|
23
26
|
- Rate limiting for chat messages and token usage via the
|
|
24
27
|
[Rate Limiter component](https://convex.dev/components/rate-limiter).
|
|
25
|
-
See [examples/rate-limiting](./
|
|
28
|
+
See [examples/rate-limiting](./example/convex/rate_limiting/README.md).
|
|
26
29
|
- Optionally filter tool calls out of the thread history.
|
|
27
30
|
|
|
28
31
|
[Read the associated Stack post here](https://stack.convex.dev/ai-agents).
|
|
29
32
|
|
|
30
33
|
[](https://youtu.be/tUKMPUlOCHY)
|
|
31
34
|
|
|
32
|
-
Play with the [
|
|
35
|
+
Play with the [example](./example/) by cloning this repo and running:
|
|
36
|
+
|
|
33
37
|
```sh
|
|
38
|
+
npm run setup
|
|
34
39
|
npm run example
|
|
35
40
|
```
|
|
36
41
|
|
|
37
42
|
## Example usage:
|
|
38
43
|
|
|
44
|
+
See example usage in [example/convex](./example/convex).
|
|
45
|
+
|
|
39
46
|
```ts
|
|
40
47
|
// Define an agent similarly to the AI SDK
|
|
41
48
|
const supportAgent = new Agent(components.agent, {
|
|
@@ -283,8 +290,8 @@ function MyComponent({ threadId }: { threadId: string }) {
|
|
|
283
290
|
}
|
|
284
291
|
```
|
|
285
292
|
|
|
286
|
-
See [
|
|
287
|
-
[
|
|
293
|
+
See [ChatBasic.tsx](./example/ui/ChatBasic.tsx) for an example, and
|
|
294
|
+
[ChatStreaming.tsx](./example/ui/ChatStreaming.tsx) for a streaming example.
|
|
288
295
|
|
|
289
296
|
### Configuring the context of message generation
|
|
290
297
|
|
|
@@ -558,7 +565,7 @@ export const supportAgentWorkflow = workflow.define({
|
|
|
558
565
|
});
|
|
559
566
|
```
|
|
560
567
|
|
|
561
|
-
See another example in [
|
|
568
|
+
See another example in [workflows/chaining.ts](./example/convex/workflows/chaining.ts).
|
|
562
569
|
|
|
563
570
|
## Extra control: how to do more things yourself
|
|
564
571
|
|
|
@@ -638,12 +645,6 @@ const ids = await ctx.runMutation(
|
|
|
638
645
|
);
|
|
639
646
|
```
|
|
640
647
|
|
|
641
|
-
See example usage in [example.ts](./example/convex/example.ts).
|
|
642
|
-
Read more in [this Stack post](https://stack.convex.dev/ai-agents).
|
|
643
|
-
|
|
644
|
-
```sh
|
|
645
|
-
npm i @convex-dev/agent
|
|
646
|
-
```
|
|
647
648
|
|
|
648
649
|
### Tracking token usage
|
|
649
650
|
|