1.1.13 • Published 7 months ago

@ai-toolkit/xai v1.1.13

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

AI TOOLKIT - xAI Grok Provider

The xAI Grok provider for the AI TOOLKIT contains language model support for the xAI chat and completion APIs.

Setup

The xAI Grok provider is available in the @ai-toolkit/xai module. You can install it with

npm i @ai-toolkit/xai

Provider Instance

You can import the default provider instance xai from @ai-toolkit/xai:

import { xai } from '@ai-toolkit/xai';

Example

import { xai } from '@ai-toolkit/xai';
import { generateText } from 'ai-toolkit';

const { text } = await generateText({
  model: xai('grok-2-1212'),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});

Documentation

Please check out the xAI Grok provider documentation for more information.