Spaces:
Build error
Build error
Run @ai-sdk/codemod in Dockerfile
Browse files- Dockerfile +3 -0
- components/app/TextGeneration.tsx +1 -1
Dockerfile
CHANGED
|
@@ -13,6 +13,9 @@ RUN npm install -g pnpm
|
|
| 13 |
# Install dependencies
|
| 14 |
RUN pnpm install
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
# Copy the rest of the application's code
|
| 17 |
COPY . .
|
| 18 |
|
|
|
|
| 13 |
# Install dependencies
|
| 14 |
RUN pnpm install
|
| 15 |
|
| 16 |
+
# Upgrade AI SDK
|
| 17 |
+
RUN npx @ai-sdk/codemod upgrade
|
| 18 |
+
|
| 19 |
# Copy the rest of the application's code
|
| 20 |
COPY . .
|
| 21 |
|
components/app/TextGeneration.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { useChat } from '@ai-sdk/react';
|
|
| 5 |
|
| 6 |
export default function TextGeneration() {
|
| 7 |
const [model, setModel] = useState('alias-code');
|
| 8 |
-
const { messages,
|
| 9 |
api: '/api/text-generation',
|
| 10 |
body: {
|
| 11 |
model,
|
|
|
|
| 5 |
|
| 6 |
export default function TextGeneration() {
|
| 7 |
const [model, setModel] = useState('alias-code');
|
| 8 |
+
const { messages, handleInputChange, handleSubmit } = useChat({
|
| 9 |
api: '/api/text-generation',
|
| 10 |
body: {
|
| 11 |
model,
|