Download packages/agent-core-v2/src/features/reminder/systemReminder.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/features/reminder/systemReminder.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/features/reminder/systemReminder.ts
-
curl -L -o systemReminder.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/features/reminder/systemReminder.ts
721 Bytes
| import type { ContextMessage } from '#/agent/contextMemory/types'; | |
| const SYSTEM_REMINDER_PREFIX = '<system-reminder>\n'; | |
| const SYSTEM_REMINDER_SUFFIX = '\n</system-reminder>'; | |
| export function wrapSystemReminder(content: string): string { | |
| return `${SYSTEM_REMINDER_PREFIX}${content.trim()}${SYSTEM_REMINDER_SUFFIX}`; | |
| } | |
| export function systemReminderContent(message: ContextMessage): string | undefined { | |
| const text = message.content.map((part) => (part.type === 'text' ? part.text : '')).join(''); | |
| if (!text.startsWith(SYSTEM_REMINDER_PREFIX) || !text.endsWith(SYSTEM_REMINDER_SUFFIX)) { | |
| return undefined; | |
| } | |
| return text.slice(SYSTEM_REMINDER_PREFIX.length, text.length - SYSTEM_REMINDER_SUFFIX.length); | |
| } | |