-
#22
8a2c34b
Thanks @davidkpiano! - ThecreateSchemas(…)
function has been removed. ThedefineEvents(…)
function should be used instead, as it is a simpler way of defining events and event schemas using Zod: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({ // ... });
- #18
dcaabab
Thanks @davidkpiano! -context
is now optional forcreateSchemas(…)
- #16
3ba5fb2
Thanks @davidkpiano! - Update to XState 5.8.0
-
#9
d8e7b67
Thanks @davidkpiano! - Addadapter.fromTool(…)
, which creates an actor that chooses agent logic based on a input.const actor = adapter.fromTool(() => "Draw me a picture of a donut", { // tools makeIllustration: { description: "Makes an illustration", run: async (input) => { /* ... */ }, inputSchema: { /* ... */ }, }, getWeather: { description: "Gets the weather", run: async (input) => { /* ... */ }, inputSchema: { /* ... */ }, }, }); //...
-
#5
ae473d7
Thanks @davidkpiano! - Simplify API (WIP) -
#5
687bed8
Thanks @davidkpiano! - AddcreateSchemas
,createOpenAIAdapter
, and changecreateAgent
- #1
3dc2880
Thanks @mellson! - Adds a convenient way to run the examples withpnpm example ${exampleName}
. If no example name is provided, the script will print the available examples. Also, adds a fun little loading animation to the joke example.
- e125728: Added
createAgent(...)