mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
e1e64e3de3
* docs: apply Vercel technical writing standards Audit the complete documentation corpus, package READMEs, skills, and source TSDoc/comments against the vercel-technical-writing skill and style-rules.md. Normalize sentence-case headings without changing published anchors, remove prose em dashes and filler wording, improve active voice and self-contained phrasing, standardize product/brand capitalization, American English, list punctuation, units, and code fence languages, and preserve exact runtime strings/table placeholders. All executable code is unchanged. Modified skills have their metadata versions bumped. * docs: extend writing audit to repository Markdown Apply the same technical-writing rules to design documents, compiler specifications, workbench guides, package changelogs, and the remaining tracked Markdown outside the deployed docs corpus. Preserve historical meaning, commands, output literals, table placeholders, and heading anchors. * docs: exclude generated package changelogs from audit
47 lines
1.2 KiB
Markdown
47 lines
1.2 KiB
Markdown
# @workflow/ai
|
|
|
|
A helper library that makes [Workflow SDK](https://workflow-sdk.dev) compatible with the [AI SDK](https://ai-sdk.dev/).
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
npm install @workflow/ai
|
|
```
|
|
|
|
## AI SDK compatibility
|
|
|
|
This package supports both **AI SDK v5** and **AI SDK v6**. The `ai` package is a peer dependency, so you control which version to use:
|
|
|
|
```bash
|
|
# For AI SDK v6 (recommended, latest)
|
|
npm install ai
|
|
|
|
# For AI SDK v5
|
|
npm install ai@5
|
|
```
|
|
|
|
### Version differences
|
|
|
|
| Feature | AI SDK v5 | AI SDK v6 |
|
|
|---------|-----------|-----------|
|
|
| Model interface | `LanguageModelV2` | `LanguageModelV3` |
|
|
| Provider package | `@ai-sdk/provider@2.x` | `@ai-sdk/provider@3.x` |
|
|
|
|
Both versions work with `@workflow/ai`. The package handles their differences through an internal compatibility layer.
|
|
|
|
### Provider packages
|
|
|
|
If you use the provider wrappers (e.g., `@workflow/ai/anthropic`, `@workflow/ai/openai`), install the corresponding provider packages:
|
|
|
|
```bash
|
|
# Example: Using Anthropic with AI SDK v6
|
|
npm install ai @ai-sdk/anthropic
|
|
|
|
# Example: Using OpenAI with AI SDK v5
|
|
npm install ai@5 @ai-sdk/openai@2
|
|
```
|
|
|
|
## Documentation
|
|
|
|
For usage examples and full documentation, see the [API reference](https://workflow-sdk.dev/docs/api-reference/workflow-ai/).
|