-
-
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.
- Loading branch information
1 parent
9296e75
commit e65a0e6
Showing
42 changed files
with
734 additions
and
3,164 deletions.
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
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,77 @@ | ||
--- | ||
title: Vercel AI SDK | ||
description: Agentic adapter for the Vercel AI SDK. | ||
--- | ||
|
||
- package: `@agentic/ai-sdk` | ||
- exports: `function createAISDKTools` | ||
- [source](https://github.com/transitive-bullshit/agentic/blob/main/packages/ai-sdk/src/ai-sdk.ts) | ||
- [Vercel AI SDK docs](https://sdk.vercel.ai) | ||
|
||
## Install | ||
|
||
<CodeGroup> | ||
```bash npm | ||
npm install @agentic/ai-sdk ai | ||
``` | ||
|
||
```bash yarn | ||
yarn add @agentic/ai-sdk ai | ||
``` | ||
|
||
```bash pnpm | ||
pnpm add @agentic/ai-sdk ai | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Usage | ||
|
||
This example also requires you to install `@ai-sdk/openai`. | ||
|
||
```ts | ||
import 'dotenv/config' | ||
|
||
import { createAISDKTools } from '@agentic/ai-sdk' | ||
import { WeatherClient } from '@agentic/weather' | ||
import { openai } from '@ai-sdk/openai' | ||
import { generateText } from 'ai' | ||
|
||
async function main() { | ||
const weather = new WeatherClient() | ||
|
||
const result = await generateText({ | ||
model: openai('gpt-4o-mini'), | ||
tools: createAISDKTools(weather), | ||
toolChoice: 'required', | ||
temperature: 0, | ||
system: 'You are a helpful assistant. Be as concise as possible.', | ||
prompt: 'What is the weather in San Francisco?' | ||
}) | ||
|
||
console.log(result.toolResults[0]) | ||
} | ||
|
||
await main() | ||
``` | ||
|
||
## Running this example | ||
|
||
<Info> | ||
You'll need a free API key from [weatherapi.com](https://www.weatherapi.com) | ||
to run this example. Store it in a local `.env` file as `WEATHER_API_KEY`. | ||
</Info> | ||
|
||
<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 'WEATHER_API_KEY=your-key' >> .env | ||
echo 'OPENAI_API_KEY=your-key' >> .env | ||
npx tsx examples/ai-sdk/bin/weather.ts | ||
``` |
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,75 @@ | ||
--- | ||
title: Dexter | ||
description: Agentic adapter for the Dexa Dexter SDK. | ||
--- | ||
|
||
- package: `@agentic/dexter` | ||
- exports: `function createDexterFunctions` | ||
- [source](https://github.com/transitive-bullshit/agentic/blob/main/packages/dexter/src/dexter.ts) | ||
- [Dexa Dexter SDK docs](https://dexter.dexa.ai) | ||
|
||
## Install | ||
|
||
<CodeGroup> | ||
```bash npm | ||
npm install @agentic/dexter @dexaai/dexter | ||
``` | ||
|
||
```bash yarn | ||
yarn add @agentic/dexter @dexaai/dexter | ||
``` | ||
|
||
```bash pnpm | ||
pnpm add @agentic/dexter @dexaai/dexter | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Usage | ||
|
||
```ts | ||
import 'dotenv/config' | ||
|
||
import { createDexterFunctions } from '@agentic/dexter' | ||
import { WeatherClient } from '@agentic/weather' | ||
import { ChatModel, createAIRunner } from '@dexaai/dexter' | ||
|
||
async function main() { | ||
const weather = new WeatherClient() | ||
|
||
const runner = createAIRunner({ | ||
chatModel: new ChatModel({ | ||
params: { model: 'gpt-4o-mini', temperature: 0 } | ||
// debug: true | ||
}), | ||
functions: createDexterFunctions(weather), | ||
systemMessage: 'You are a helpful assistant. Be as concise as possible.' | ||
}) | ||
|
||
const result = await runner('What is the weather in San Francisco?') | ||
console.log(result) | ||
} | ||
|
||
await main() | ||
``` | ||
|
||
## Running this example | ||
|
||
<Info> | ||
You'll need a free API key from [weatherapi.com](https://www.weatherapi.com) | ||
to run this example. Store it in a local `.env` file as `WEATHER_API_KEY`. | ||
</Info> | ||
|
||
<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 'WEATHER_API_KEY=your-key' >> .env | ||
echo 'OPENAI_API_KEY=your-key' >> .env | ||
npx tsx examples/dexter/bin/weather.ts | ||
``` |
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,89 @@ | ||
--- | ||
title: Genkit | ||
description: Agentic adapter for the Firebase Genkit SDK. | ||
--- | ||
|
||
- package: `@agentic/genkit` | ||
- exports: `function createGenkitTools` | ||
- [source](https://github.com/transitive-bullshit/agentic/blob/main/packages/genkit/src/genkit.ts) | ||
- [Firebase Genkit docs](https://firebase.google.com/docs/genkit) | ||
|
||
## Install | ||
|
||
<CodeGroup> | ||
```bash npm | ||
npm install @agentic/genkit @genkit-ai/ai @genkit-ai/core | ||
``` | ||
|
||
```bash yarn | ||
yarn add @agentic/genkit @genkit-ai/ai @genkit-ai/core | ||
``` | ||
|
||
```bash pnpm | ||
pnpm add @agentic/genkit @genkit-ai/ai @genkit-ai/core | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Usage | ||
|
||
This example also requires you to install the [genkitx-openai](https://github.com/TheFireCo/genkit-plugins/tree/main/plugins/openai) package, which adds support for OpenAI to Genkit. | ||
|
||
```ts | ||
import 'dotenv/config' | ||
|
||
import { createGenkitTools } from '@agentic/genkit' | ||
import { WeatherClient } from '@agentic/stdlib' | ||
import { generate } from '@genkit-ai/ai' | ||
import { configureGenkit } from '@genkit-ai/core' | ||
import { gpt4oMini, openAI } from 'genkitx-openai' | ||
|
||
async function main() { | ||
const weather = new WeatherClient() | ||
|
||
configureGenkit({ | ||
plugins: [openAI()] | ||
}) | ||
|
||
const result = await generate({ | ||
model: gpt4oMini, | ||
tools: createGenkitTools(weather), | ||
history: [ | ||
{ | ||
role: 'system', | ||
content: [ | ||
{ | ||
text: 'You are a helpful assistant. Be as concise as possible.' | ||
} | ||
] | ||
} | ||
], | ||
prompt: 'What is the weather in San Francisco?' | ||
}) | ||
|
||
console.log(result) | ||
} | ||
|
||
await main() | ||
``` | ||
|
||
## Running this example | ||
|
||
<Info> | ||
You'll need a free API key from [weatherapi.com](https://www.weatherapi.com) | ||
to run this example. Store it in a local `.env` file as `WEATHER_API_KEY`. | ||
</Info> | ||
|
||
<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 'WEATHER_API_KEY=your-key' >> .env | ||
echo 'OPENAI_API_KEY=your-key' >> .env | ||
npx tsx examples/genkit/bin/weather.ts | ||
``` |
Oops, something went wrong.