Skip to content

Commit

Permalink
fix (examples): use togetherai provider (#3863)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel authored Nov 25, 2024
1 parent 126bb12 commit 902b411
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 1 addition & 6 deletions examples/ai-core/src/generate-text/togetherai.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { createTogetherAI } from '@ai-sdk/togetherai';
import { togetherai } from '@ai-sdk/togetherai';
import { generateText } from 'ai';
import 'dotenv/config';

const togetherai = createTogetherAI({
apiKey: process.env.TOGETHER_AI_API_KEY!,
baseURL: 'https://api.together.xyz/v1/',
});

async function main() {
const { text, usage } = await generateText({
model: togetherai('meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo'),
Expand Down
8 changes: 1 addition & 7 deletions examples/ai-core/src/stream-text/togetherai.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { createOpenAI } from '@ai-sdk/openai';
import { togetherai } from '@ai-sdk/togetherai';
import { streamText } from 'ai';
import 'dotenv/config';

const togetherai = createOpenAI({
name: 'togetherai',
apiKey: process.env.TOGETHER_AI_API_KEY!,
baseURL: 'https://api.together.xyz/v1/',
});

async function main() {
const result = streamText({
model: togetherai('google/gemma-2-9b-it'),
Expand Down

0 comments on commit 902b411

Please sign in to comment.