Skip to content

Commit

Permalink
schema inference
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Aug 9, 2024
1 parent b2470dd commit 8fd3e16
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/src/content/docs/guides/tool-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ defTool(
)
```

You can also simplify the parameter definition by provider an example object and the schema will be inferred._createMdxContent

```js "{ a: 1, b: 2 }"
defTool(
"sum",
"Sum two numbers",
{ a: 1, b: 2 },
({ a, b }) => `${a + b}`
)
```

## Parameters

The arithmetic question can be declared as a [script parameter](/genaiscript/reference/scripts/variables) to be used in the agent script.
Expand Down

0 comments on commit 8fd3e16

Please sign in to comment.