Spaces:
Running
Running
Fix: Corrected ai imports in API routes
Browse files
app/api/analyze-edit-intent/route.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { createGroq } from '@ai-sdk/groq';
|
|
| 3 |
import { createAnthropic } from '@ai-sdk/anthropic';
|
| 4 |
import { createOpenAI } from '@ai-sdk/openai';
|
| 5 |
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
| 6 |
-
import { generateObject } from 'ai';
|
| 7 |
import { z } from 'zod';
|
| 8 |
// import type { FileManifest } from '@/types/file-manifest'; // Type is used implicitly through manifest parameter
|
| 9 |
|
|
|
|
| 3 |
import { createAnthropic } from '@ai-sdk/anthropic';
|
| 4 |
import { createOpenAI } from '@ai-sdk/openai';
|
| 5 |
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
| 6 |
+
import { generateObject } from '@ai-sdk/core';
|
| 7 |
import { z } from 'zod';
|
| 8 |
// import type { FileManifest } from '@/types/file-manifest'; // Type is used implicitly through manifest parameter
|
| 9 |
|
app/api/text-generation/route.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import OpenAI from 'openai';
|
| 2 |
-
import {
|
|
|
|
| 3 |
|
| 4 |
// Create an OpenAI API client (that's edge friendly!)
|
| 5 |
const openai = new OpenAI({
|
|
|
|
| 1 |
import OpenAI from 'openai';
|
| 2 |
+
import { StreamingTextResponse } from 'ai/web';
|
| 3 |
+
import { OpenAIStream } from '@ai-sdk/openai/stream';
|
| 4 |
|
| 5 |
// Create an OpenAI API client (that's edge friendly!)
|
| 6 |
const openai = new OpenAI({
|