chatgpt-api/docs/quickstart.mdx

203 wiersze
5.2 KiB
Markdown

---
title: Quick Start
---
<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>
<Step title='Install core deps'>
<CodeGroup>
```bash npm
npm install @agentic/core zod
```
```bash yarn
yarn add @agentic/core zod
```
```bash pnpm
pnpm add @agentic/core zod
```
</CodeGroup>
</Step>
<Step title='Install AI tools'>
You can either install all of the AI tools via the convenience package `@agentic/stdlib`, or you can install them individually via their respective packages (`@agentic/weather`, `@agentic/twitter`, etc.).
<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).
Here's an example of how to install the [Weather tool](/tools/weather):
<CodeGroup>
```bash npm
npm install @agentic/weather
```
```bash yarn
yarn add @agentic/weather
```
```bash pnpm
pnpm add @agentic/weather
```
</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).
The default examples all use `@agentic/stdlib` because it provides a simpler DX.
</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>
See the [AI SDK adapter docs](/sdks/ai-sdk) for usage details.
</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>
See the [LangChain adapter docs](/sdks/langchain) for usage details.
</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>
See the [LlamaIndex adapter docs](/sdks/llamaindex) for usage details.
</Accordion>
<Accordion title="Firebase Genkit">
<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>
See the [Genkit adapter docs](/sdks/genkit) for usage details.
</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>
See the [Dexter adapter docs](/sdks/dexter) for usage details.
</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.
See the [OpenAI adapter docs](/sdks/openai) for usage details.
</Accordion>
</AccordionGroup>
<Note>
You can use Agentic without any of these AI SDKs. `@agentic/core`, `@agentic/stdlib`, and all individual tool packages are completely agnostic to specific LLMs and AI SDKs.
</Note>
</Step>
</Steps>