Skip to content

Commit

Permalink
docs: add Gemini to LLM options in Getting Started guide (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamzah-syed authored Nov 9, 2024
1 parent 99d7d7c commit e8a110c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions apps/docs/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ npm install @assistant-ui/react

Install provider SDK:

<Tabs id="provider" items={["OpenAI", "Anthropic", "AWS", "Azure", "GCP", "Groq", "Fireworks", "Cohere", "Ollama", "Chrome AI"]}>
<Tabs id="provider" items={["OpenAI", "Anthropic", "AWS", "Azure", "Gemini", "GCP", "Groq", "Fireworks", "Cohere", "Ollama", "Chrome AI"]}>

```sh title="Terminal" tab="OpenAI"
npm install @ai-sdk/openai
Expand All @@ -80,6 +80,10 @@ npm install @ai-sdk/amazon-bedrock
npm install @ai-sdk/azure
```

```sh title="Terminal" tab="Gemini"
npm install @ai-sdk/google
```

```sh title="Terminal" tab="GCP"
npm install @ai-sdk/google-vertex
```
Expand Down Expand Up @@ -108,7 +112,7 @@ npm install chrome-ai

Add an API endpoint:

<Tabs id="provider" items={["OpenAI", "Anthropic", "Azure", "AWS", "GCP", "Groq", "Fireworks", "Cohere", "Ollama", "Chrome AI"]}>
<Tabs id="provider" items={["OpenAI", "Anthropic", "Azure", "AWS", "Gemini", "GCP", "Groq", "Fireworks", "Cohere", "Ollama", "Chrome AI"]}>
```ts title="/app/api/chat/route.ts" tab="OpenAI"
import { openai } from "@ai-sdk/openai";
import { createEdgeRuntimeAPI } from "@assistant-ui/react/edge";
Expand Down Expand Up @@ -145,6 +149,15 @@ export const { POST } = createEdgeRuntimeAPI({
});
```

```ts title="/app/api/chat/route.ts" tab="Gemini"
import { google } from "@ai-sdk/google";
import { createEdgeRuntimeAPI } from "@assistant-ui/react/edge";

export const { POST } = createEdgeRuntimeAPI({
model: google("gemini-1.5-flash"),
});
```

```ts title="/app/api/chat/route.ts" tab="GCP"
import { vertex } from "@ai-sdk/google-vertex";
import { createEdgeRuntimeAPI } from "@assistant-ui/react/edge";
Expand Down Expand Up @@ -213,7 +226,7 @@ export const { POST } = createEdgeRuntimeAPI({

Define environment variables:

<Tabs id="provider" items={["OpenAI", "Anthropic", "AWS", "Azure", "GCP", "Groq", "Fireworks", "Cohere", "Ollama", "Chrome AI"]}>
<Tabs id="provider" items={["OpenAI", "Anthropic", "AWS", "Azure", "Gemini", "GCP", "Groq", "Fireworks", "Cohere", "Ollama", "Chrome AI"]}>

```sh title="/.env.local" tab="OpenAI"
OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Expand All @@ -234,6 +247,10 @@ AZURE_RESOURCE_NAME="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
AZURE_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

```sh title="/.env.local" tab="Gemini"
GOOGLE_GENERATIVE_AI_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

```sh title="/.env.local" tab="GCP"
GOOGLE_VERTEX_PROJECT="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
GOOGLE_VERTEX_LOCATION="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Expand Down

0 comments on commit e8a110c

Please sign in to comment.