mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-13 17:22:37 +02:00
Add date and time to universal system message
This commit is contained in:
parent
56d111c53c
commit
eead4a9b1f
2 changed files with 10 additions and 4 deletions
|
|
@ -739,8 +739,14 @@ function ensureSystemMessage(logger: PrefixLogger, messages: z.infer<typeof Mess
|
|||
|
||||
// ensure that system message isn't blank
|
||||
if (messages.length > 0 && messages[0]?.role === 'system' && !messages[0].content) {
|
||||
messages[0].content = 'You are a helpful assistant.';
|
||||
logger.log(`updated system message: ${messages[0].content}`);
|
||||
const defaultContext = `You are a helpful assistant.
|
||||
|
||||
Basic context:
|
||||
- Today's date is ${new Date().toLocaleDateString()}
|
||||
- Current time is ${new Date().toLocaleTimeString()}.`;
|
||||
|
||||
messages[0].content = defaultContext;
|
||||
logger.log(`updated system message with default context: ${messages[0].content}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
'use client';
|
||||
import { Spinner } from "@heroui/react";
|
||||
import { useEffect, useMemo, useRef, useState, useCallback } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
import z from "zod";
|
||||
import { Workflow } from "@/app/lib/types/workflow_types";
|
||||
import { WorkflowTool } from "@/app/lib/types/workflow_types";
|
||||
import MarkdownContent from "@/app/lib/components/markdown-content";
|
||||
import { MessageSquareIcon, EllipsisIcon, CircleCheckIcon, ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PlusIcon, CodeIcon, CheckCircleIcon, FileTextIcon } from "lucide-react";
|
||||
import { ChevronRightIcon, ChevronDownIcon, ChevronUpIcon, CodeIcon, CheckCircleIcon, FileTextIcon } from "lucide-react";
|
||||
import { TestProfile } from "@/app/lib/types/testing_types";
|
||||
import { ProfileContextBox } from "./profile-context-box";
|
||||
import { Message, ToolMessage, AssistantMessageWithToolCalls } from "@/app/lib/types/types";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue