Skip to content

Commit

Permalink
changed deprecated imports(experimental_generateObject and experiment…
Browse files Browse the repository at this point in the history
…al_streamText)
  • Loading branch information
DhrishP committed May 9, 2024
1 parent f7e7760 commit 8a7361a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/actions/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ export async function saveChat(chat: Chat, userId: string = 'anonymous') {
member: `chat:${chat.id}`
})
await pipeline.exec()
}
}
4 changes: 2 additions & 2 deletions lib/agents/researcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CoreMessage,
ToolCallPart,
ToolResultPart,
experimental_streamText
streamText as nonexperimental_streamText
} from 'ai'
import { searchSchema } from '@/lib/schema/search'
import { Section } from '@/components/section'
Expand Down Expand Up @@ -36,7 +36,7 @@ export async function researcher(
)

let isFirstToolResponse = true
const result = await experimental_streamText({
const result = await nonexperimental_streamText({
model: openai.chat(process.env.OPENAI_API_MODEL || 'gpt-4-turbo'),
maxTokens: 2500,
system: `As a professional search expert, you possess the ability to search for any information on the web.
Expand Down
4 changes: 2 additions & 2 deletions lib/agents/task-manager.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CoreMessage, experimental_generateObject } from 'ai'
import { CoreMessage, generateObject } from 'ai'
import { OpenAI } from '@ai-sdk/openai'
import { nextActionSchema } from '../schema/next-action'

Expand All @@ -11,7 +11,7 @@ export async function taskManager(messages: CoreMessage[]) {
})

try {
const result = await experimental_generateObject({
const result = await generateObject({
model: openai.chat(process.env.OPENAI_API_MODEL || 'gpt-4-turbo'),
system: `As a professional web researcher, your primary objective is to fully comprehend the user's query, conduct thorough web searches to gather the necessary information, and provide an appropriate response.
To achieve this, you must first analyze the user's input and determine the optimal course of action. You have two options at your disposal:
Expand Down
4 changes: 2 additions & 2 deletions lib/agents/writer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OpenAI } from '@ai-sdk/openai'
import { createStreamableUI, createStreamableValue } from 'ai/rsc'
import { CoreMessage, experimental_streamText } from 'ai'
import { CoreMessage, streamText as nonexperimental_streamText } from 'ai'
import { Section } from '@/components/section'
import { BotMessage } from '@/components/message'
import { createAnthropic } from '@ai-sdk/anthropic'
Expand Down Expand Up @@ -30,7 +30,7 @@ export async function writer(
)
uiStream.append(answerSection)

await experimental_streamText({
await nonexperimental_streamText({
model:
process.env.SPECIFIC_PROVIDER === 'anthropic'
? anthropic!(
Expand Down

0 comments on commit 8a7361a

Please sign in to comment.