feat(prompt): Use date, not time in prompts

This commit is contained in:
Willie Zutz 2025-05-26 11:05:11 -06:00
parent 4edd173207
commit 8e6934bb64
12 changed files with 34 additions and 18 deletions

View file

@ -8,6 +8,7 @@ import formatChatHistoryAsString from '../utils/formatHistory';
import { BaseMessage } from '@langchain/core/messages';
import LineOutputParser from '../outputParsers/lineOutputParser';
import { searchSearxng } from '../searxng';
import { formatDateForLLM } from '../utils';
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
const VideoSearchChainPrompt = `
@ -23,7 +24,7 @@ const VideoSearchChainPrompt = `
- The history is contained in the <conversation> tag after the <examples> below
- The user question is contained in the <question> tag after the <examples> below
- Output your answer in an <answer> tag
- Current date & time in ISO format (UTC timezone) is: {date}
- Current date is: {date}
- Do not include any other text in your answer
<examples>
@ -100,7 +101,7 @@ const createVideoSearchChain = (llm: BaseChatModel) => {
query: (input: VideoSearchChainInput) => {
return input.query;
},
date: () => new Date().toISOString(),
date: () => formatDateForLLM(),
}),
PromptTemplate.fromTemplate(VideoSearchChainPrompt),
llm,