feat: add reasoning model (#750)
Co-authored-by: Matt Apperson <me@mattapperson.com>
This commit is contained in:
parent
76804269c4
commit
c61d4f91d4
19 changed files with 342 additions and 209 deletions
|
|
@ -1,20 +1,17 @@
|
|||
import { z } from 'zod';
|
||||
import { Model } from '../models';
|
||||
import { Session } from 'next-auth';
|
||||
import { DataStreamWriter, streamObject, tool } from 'ai';
|
||||
import { getDocumentById, saveSuggestions } from '@/lib/db/queries';
|
||||
import { Suggestion } from '@/lib/db/schema';
|
||||
import { customModel } from '..';
|
||||
import { generateUUID } from '@/lib/utils';
|
||||
import { myProvider } from '../models';
|
||||
|
||||
interface RequestSuggestionsProps {
|
||||
model: Model;
|
||||
session: Session;
|
||||
dataStream: DataStreamWriter;
|
||||
}
|
||||
|
||||
export const requestSuggestions = ({
|
||||
model,
|
||||
session,
|
||||
dataStream,
|
||||
}: RequestSuggestionsProps) =>
|
||||
|
|
@ -39,7 +36,7 @@ export const requestSuggestions = ({
|
|||
> = [];
|
||||
|
||||
const { elementStream } = streamObject({
|
||||
model: customModel(model.apiIdentifier),
|
||||
model: myProvider.languageModel('block-model'),
|
||||
system:
|
||||
'You are a help writing assistant. Given a piece of writing, please offer suggestions to improve the piece of writing and describe the change. It is very important for the edits to contain full sentences instead of just words. Max 5 suggestions.',
|
||||
prompt: document.content,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue