-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #664 from pelikhan/genaiscript
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: GenAIScript | ||
description: Builtin agentic tool support in GenAIScript. | ||
--- | ||
|
||
- package: none necessary | ||
- [GenAIScript docs](https://microsoft.github.io/genaiscript/guides/agentic-tools/) | ||
|
||
## Usage | ||
|
||
```ts | ||
import { calculator } from '@agentic/calculator' | ||
defTool(calculator) | ||
|
||
$`Answer the following arithmetic question: How much is 11 + 4? then divide by 3?` | ||
``` | ||
|
||
## Running this example | ||
|
||
<Info> | ||
You'll need an [OpenAI API key](https://platform.openai.com/docs/quickstart) | ||
to run this example. Store it in a local `.env` file as `OPENAI_API_KEY`. | ||
</Info> | ||
|
||
```sh | ||
git clone [email protected]:transitive-bullshit/agentic.git | ||
cd agentic | ||
pnpm install | ||
echo 'OPENAI_API_KEY=your-key' >> .env | ||
npx genaiscript examples/genaiscript/calculator.genai.mts | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { calculator } from '@agentic/calculator' | ||
defTool(calculator) | ||
|
||
$`Answer the following arithmetic question: How much is 11 + 4? then divide by 3?` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters