feat(agent): Pretty decent first pass at agent mode
This commit is contained in:
parent
3f1f437d4f
commit
b4e2585856
18 changed files with 2380 additions and 5193 deletions
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue