6144 char limit

This commit is contained in:
Dhravya 2024-04-14 01:04:06 -07:00
parent 3494f1242f
commit d6609d4302

View file

@ -122,8 +122,6 @@ export async function POST(request: Request, _: CloudflareVectorizeStore, embedd
`You are an agent that summarizes a page based on the query. don't say 'based on the context'. I expect you to be like a 'Second Brain'. you will be provided with the context (old saved posts) and questions. Answer accordingly. Answer in markdown format` +
`Context:\n${preparedContext ?? 'No context'}\n\nQuestion: ${query}\nAnswer:`;
console.log('Prompt', prompt);
// const output = await chat.sendMessageStream(prompt);
// const response = new Response(
@ -145,7 +143,7 @@ export async function POST(request: Request, _: CloudflareVectorizeStore, embedd
const ai = new Ai(env?.AI);
// @ts-ignore
const output: AiTextGenerationOutput = (await ai.run('@hf/mistralai/mistral-7b-instruct-v0.2', {
prompt,
prompt: prompt.slice(0, 6144),
stream: true,
})) as ReadableStream;