chatgpt-api/docs/quickstart.mdx

203 wiersze
5.0 KiB
Plaintext
Czysty Zwykły widok Historia

2024-08-06 04:31:58 +00:00
---
2024-08-17 11:03:17 +00:00
title: Quick Start
2024-08-06 04:31:58 +00:00
---
<Info>
**Prerequisite**: All Agentic packages are [ESM
only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
and require `Node.js >= 18` or an equivalent environment (Bun, Deno, CF
workers, etc).
</Info>
<Steps>
2025-02-20 19:29:04 +00:00
<Step title='Install core deps (zod)'>
2024-08-06 04:31:58 +00:00
<CodeGroup>
```bash npm
2025-02-20 19:29:04 +00:00
npm install zod
2024-08-06 04:31:58 +00:00
```
```bash yarn
2025-02-20 19:29:04 +00:00
yarn add zod
2024-08-06 04:31:58 +00:00
```
```bash pnpm
2025-02-20 19:29:04 +00:00
pnpm add zod
2024-08-06 04:31:58 +00:00
```
</CodeGroup>
</Step>
<Step title='Install AI tools'>
2025-02-20 19:29:04 +00:00
You can either install all of the AI tools via `@agentic/stdlib`, or you can install them individually via their respective packages (`@agentic/weather`, `@agentic/twitter`, etc.).
2024-08-06 04:31:58 +00:00
<AccordionGroup>
<Accordion title="Install all AI tools">
<CodeGroup>
```bash npm
npm install @agentic/stdlib
```
```bash yarn
yarn add @agentic/stdlib
```
```bash pnpm
pnpm add @agentic/stdlib
```
</CodeGroup>
</Accordion>
<Accordion title="Install individual AI tools">
Docs for individual tools are available [here](/tools).
2024-08-17 11:03:17 +00:00
Here's an example of how to install the [Weather tool](/tools/weather):
2024-08-06 04:31:58 +00:00
<CodeGroup>
```bash npm
2024-08-17 11:03:17 +00:00
npm install @agentic/weather
2024-08-06 04:31:58 +00:00
```
```bash yarn
2024-08-17 11:03:17 +00:00
yarn add @agentic/weather
2024-08-06 04:31:58 +00:00
```
```bash pnpm
2024-08-17 11:03:17 +00:00
pnpm add @agentic/weather
2024-08-06 04:31:58 +00:00
```
</CodeGroup>
</Accordion>
</AccordionGroup>
<Note>
There is no functional difference between using `@agentic/stdlib` versus using the individual tool packages directly. The only difference is if you want to optimize your install size (when running on serverless functions, for instance).
2025-02-20 19:29:04 +00:00
The default examples all use `@agentic/stdlib` for simplicity.
2024-08-06 04:31:58 +00:00
</Note>
</Step>
<Step title='Install an AI SDK Adapter'>
To use Agentic with one of the supported AI SDKs, you'll also need to install its corresponding adapter package.
<AccordionGroup>
<Accordion title="Vercel AI SDK">
<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>
2024-08-17 11:03:17 +00:00
See the [AI SDK adapter docs](/sdks/ai-sdk) for usage details.
2024-08-06 04:31:58 +00:00
</Accordion>
<Accordion title="LangChain">
<CodeGroup>
```bash npm
npm install @agentic/langchain @langchain/core langchain
```
```bash yarn
yarn add @agentic/langchain @langchain/core langchain
```
```bash pnpm
pnpm add @agentic/langchain @langchain/core langchain
```
</CodeGroup>
2024-08-17 11:03:17 +00:00
See the [LangChain adapter docs](/sdks/langchain) for usage details.
2024-08-06 04:31:58 +00:00
</Accordion>
<Accordion title="LlamaIndex">
<CodeGroup>
```bash npm
npm install @agentic/llamaindex llamaindex
```
```bash yarn
yarn add @agentic/llamaindex llamaindex
```
```bash pnpm
pnpm add @agentic/llamaindex llamaindex
```
</CodeGroup>
2024-08-17 11:03:17 +00:00
See the [LlamaIndex adapter docs](/sdks/llamaindex) for usage details.
2024-08-06 04:31:58 +00:00
</Accordion>
<Accordion title="Firebase Genkit">
<CodeGroup>
```bash npm
2025-02-20 19:29:04 +00:00
npm install @agentic/genkit genkit
2024-08-06 04:31:58 +00:00
```
```bash yarn
2025-02-20 19:29:04 +00:00
yarn add @agentic/genkit genkit
2024-08-06 04:31:58 +00:00
```
```bash pnpm
2025-02-20 19:29:04 +00:00
pnpm add @agentic/genkit genkit
2024-08-06 04:31:58 +00:00
```
</CodeGroup>
2024-08-17 11:03:17 +00:00
See the [Genkit adapter docs](/sdks/genkit) for usage details.
2024-08-06 04:31:58 +00:00
</Accordion>
<Accordion title="Dexa Dexter">
<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>
2024-08-17 11:03:17 +00:00
See the [Dexter adapter docs](/sdks/dexter) for usage details.
2024-08-06 04:31:58 +00:00
</Accordion>
<Accordion title="OpenAI SDK">
<CodeGroup>
```bash npm
npm install openai
```
```bash yarn
yarn add openai
```
```bash pnpm
pnpm add openai
```
</CodeGroup>
There's no need for a separate adapter with the OpenAI SDK since all agentic tools are compatible with OpenAI by default. You can use `AIFunctionSet.specs` for function calling or `AIFunctionSet.toolSpecs` for parallel tool calling.
2024-08-17 11:03:17 +00:00
See the [OpenAI adapter docs](/sdks/openai) for usage details.
2024-08-06 04:31:58 +00:00
</Accordion>
</AccordionGroup>
<Note>
You can use Agentic without any of these AI SDKs. `@agentic/core`, `@agentic/stdlib`, and all individual tool packages are compatible with any LLM and AI SDK that supports function calling / tool use.
2024-08-06 04:31:58 +00:00
</Note>
</Step>
</Steps>