feat(prompt): Use date, not time in prompts
This commit is contained in:
parent
4edd173207
commit
8e6934bb64
12 changed files with 34 additions and 18 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue