feat(agent): Pretty decent first pass at agent mode

This commit is contained in:
Willie Zutz 2025-06-09 23:00:25 -06:00
parent 3f1f437d4f
commit b4e2585856
18 changed files with 2380 additions and 5193 deletions

View file

@ -43,7 +43,7 @@ type EmbeddingModel = {
type Body = {
message: Message;
optimizationMode: 'speed' | 'balanced' | 'quality';
optimizationMode: 'speed' | 'balanced' | 'agent';
focusMode: string;
history: Array<[string, string]>;
files: Array<string>;

View file

@ -30,7 +30,7 @@ interface embeddingModel {
}
interface ChatRequestBody {
optimizationMode: 'speed' | 'balanced';
optimizationMode: 'speed' | 'balanced' | 'agent';
focusMode: string;
chatModel?: chatModel;
embeddingModel?: embeddingModel;
@ -128,7 +128,9 @@ export const POST = async (req: Request) => {
const abortController = new AbortController();
const { signal } = abortController;
const promptData = await getSystemPrompts(body.selectedSystemPromptIds || []);
const promptData = await getSystemPrompts(
body.selectedSystemPromptIds || [],
);
const emitter = await searchHandler.searchAndAnswer(
body.query,
@ -139,7 +141,7 @@ export const POST = async (req: Request) => {
[],
promptData.systemInstructions,
signal,
promptData.personaInstructions
promptData.personaInstructions,
);
if (!body.stream) {