Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (package): Specify Node version and document versions. #3352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"turbo": "^1.10.13",
"vitest": "1.6.0"
},
"engines": {
"node": "^18.0.0 || ^20.0.0"
},
Comment on lines +41 to +43
Copy link
Collaborator

@lgrammel lgrammel Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What effect does the engine spec have on the root level in the day-to-day usage for maintainers, i.e. when will the warning show up?

"homepage": "https://sdk.vercel.ai/docs",
"repository": {
"type": "git",
Expand Down
13 changes: 9 additions & 4 deletions packages/ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ To learn more about how to use the AI SDK, check out our [API Reference](https:/

## Installation

You will need Node.js 18+ and pnpm installed on your local development machine.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README is for using the AI SDK and should not be changed. We have a separate contribution guide ( CONTRIBUTING.md in root ) that should contain this information.

Install on your local development machine:

- Node.js `v18` or `v20`. We recommend managing Node installation and versions with [fnm](https://github.com/Schniz/fnm) or [nvm](https://github.com/nvm-sh/nvm).
- For package management we recommend (and the subsequent docs assume) [pnpm](https://pnpm.io/installation) `v8`, e.g. installed via `npm install -g [email protected]`.

Once you've got those in place:

```shell
npm install ai
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPM is fine for using the AI SDK ( as is pnpm, bun, etc) - only NPM here for illustration purposes.

pnpm install ai
```

## Usage
Expand All @@ -20,10 +25,10 @@ npm install ai

The [AI SDK Core](https://sdk.vercel.ai/docs/ai-sdk-core/overview) module provides a unified API to interact with model providers like [OpenAI](https://sdk.vercel.ai/providers/ai-sdk-providers/openai), [Anthropic](https://sdk.vercel.ai/providers/ai-sdk-providers/anthropic), [Google](https://sdk.vercel.ai/providers/ai-sdk-providers/google-generative-ai), and more.

You will then install the model provider of your choice.
You will then install the model provider of your choice:

```shell
npm install @ai-sdk/openai
pnpm install @ai-sdk/openai
```

###### @/index.ts (Node.js Runtime)
Expand Down
Loading