mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 03:46:23 +02:00
make the role aware of current time
This commit is contained in:
parent
400a1671ef
commit
a63b7d2829
1 changed files with 5 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import inspect
|
|||
import json
|
||||
import re
|
||||
import traceback
|
||||
from datetime import datetime
|
||||
from typing import Annotated, Callable, Dict, List, Literal, Optional, Tuple
|
||||
|
||||
from pydantic import Field, model_validator
|
||||
|
|
@ -233,6 +234,10 @@ class RoleZero(Role):
|
|||
msg.add_metadata(IMAGES, images)
|
||||
return memory
|
||||
|
||||
def _get_prefix(self) -> str:
|
||||
time_info = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
return super()._get_prefix() + f" The current time is {time_info}."
|
||||
|
||||
async def _act(self) -> Message:
|
||||
if self.use_fixed_sop:
|
||||
return await super()._act()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue