Rename to blocks (#502)
This commit is contained in:
parent
22a09de6e6
commit
729634e1d6
10 changed files with 108 additions and 111 deletions
|
|
@ -9,7 +9,7 @@ import { z } from 'zod';
|
|||
|
||||
import { customModel } from '@/ai';
|
||||
import { models } from '@/ai/models';
|
||||
import { canvasPrompt, regularPrompt } from '@/ai/prompts';
|
||||
import { blocksPrompt, regularPrompt } from '@/ai/prompts';
|
||||
import { auth } from '@/app/(auth)/auth';
|
||||
import {
|
||||
deleteChatById,
|
||||
|
|
@ -37,7 +37,7 @@ type AllowedTools =
|
|||
| 'requestSuggestions'
|
||||
| 'getWeather';
|
||||
|
||||
const canvasTools: AllowedTools[] = [
|
||||
const blocksTools: AllowedTools[] = [
|
||||
'createDocument',
|
||||
'updateDocument',
|
||||
'requestSuggestions',
|
||||
|
|
@ -89,11 +89,11 @@ export async function POST(request: Request) {
|
|||
|
||||
const result = await streamText({
|
||||
model: customModel(model.apiIdentifier),
|
||||
system: modelId === 'gpt-4o-canvas' ? canvasPrompt : regularPrompt,
|
||||
system: modelId === 'gpt-4o-blocks' ? blocksPrompt : regularPrompt,
|
||||
messages: coreMessages,
|
||||
maxSteps: 5,
|
||||
experimental_activeTools:
|
||||
modelId === 'gpt-4o-canvas' ? canvasTools : weatherTools,
|
||||
modelId === 'gpt-4o-blocks' ? blocksTools : weatherTools,
|
||||
tools: {
|
||||
getWeather: {
|
||||
description: 'Get the current weather at a location',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue