Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Mar 16, 2024
1 parent 72e8cc6 commit 8a2c34b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .changeset/soft-readers-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@statelyai/agent': patch
---

The `createSchemas(…)` function has been removed. The `defineEvents(…)` function should be used instead, as it is a simpler way of defining events and event schemas using Zod:

```ts
import { defineEvents } from '@statelyai/agent';
import { z } from 'zod';
import { setup } from 'xstate';

const events = defineEvents({
inc: z.object({
by: z.number().describe('Increment amount'),
}),
});

const machine = setup({
types: {
events: events.types,
},
schema: {
events: events.schemas,
},
}).createMachine({
// ...
});
```

0 comments on commit 8a2c34b

Please sign in to comment.