Atlas: opening message, isInit flag, strip trigger from history
- Add opening message instruction to atlas prompt - Handle isInit flag in atlasChat() to not store the greeting trigger as a user turn in conversation history - Update server.ts to pass is_init through to atlasChat() Made-with: Cursor
This commit is contained in:
@@ -73,6 +73,8 @@ export async function atlasChat(
|
||||
ctx: ToolContext,
|
||||
opts?: {
|
||||
preloadedHistory?: LLMMessage[];
|
||||
/** When true, the user message is an internal init trigger and should not be stored in history */
|
||||
isInit?: boolean;
|
||||
}
|
||||
): Promise<AtlasChatResult> {
|
||||
const llm = createLLM(process.env.ATLAS_MODEL ?? 'A', { temperature: 0.5 });
|
||||
@@ -86,7 +88,10 @@ export async function atlasChat(
|
||||
const oaiTools = toOAITools(ATLAS_TOOLS);
|
||||
const systemPrompt = resolvePrompt('atlas');
|
||||
|
||||
session.history.push({ role: 'user', content: userMessage });
|
||||
// For init triggers, don't add the synthetic prompt as a user turn
|
||||
if (!opts?.isInit) {
|
||||
session.history.push({ role: 'user', content: userMessage });
|
||||
}
|
||||
|
||||
const buildMessages = (): LLMMessage[] => [
|
||||
{ role: 'system', content: systemPrompt },
|
||||
|
||||
Reference in New Issue
Block a user