Refactor chat route to remove mistral dependency and update provider registry
This commit is contained in:
parent
c90e72664b
commit
dc104ea3ca
@ -1,6 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { createAzure } from '@ai-sdk/azure';
|
||||
import { mistral } from '@ai-sdk/mistral';
|
||||
import {
|
||||
convertToCoreMessages,
|
||||
streamText,
|
||||
@ -50,7 +49,6 @@ const anthropicVertex = createAnthropicVertex({
|
||||
const registry = experimental_createProviderRegistry({
|
||||
anthropicVertex,
|
||||
azure,
|
||||
mistral,
|
||||
});
|
||||
|
||||
function sanitizeUrl(url: string): string {
|
||||
@ -73,7 +71,7 @@ export async function POST(req: Request) {
|
||||
const result = await streamText({
|
||||
model: registry.languageModel(model),
|
||||
messages: convertToCoreMessages(messages),
|
||||
temperature: provider === "azure" ? 0.72 : provider === "mistral" ? 0.5 : 0,
|
||||
temperature: provider === "azure" ? 0.72 : 0,
|
||||
topP: 0.5,
|
||||
frequencyPenalty: 0,
|
||||
presencePenalty: 0,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user