mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
refactor(core): move get_now_time function and update imports
This commit is contained in:
parent
b3d68dbc02
commit
59aa253e85
3 changed files with 15 additions and 7 deletions
|
|
@ -4,15 +4,25 @@ This module defines the MemoryNode class for storing and retrieving
|
|||
memories in the ReMe system.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from .vector_node import VectorNode
|
||||
from ..enumeration import MemoryType
|
||||
from ..schema import VectorNode
|
||||
from ..utils import get_now_time
|
||||
|
||||
|
||||
def get_now_time() -> str:
|
||||
"""Get current timestamp in YYYY-MM-DD HH:MM:SS format.
|
||||
|
||||
Returns:
|
||||
str: Current timestamp string in format 'YYYY-MM-DD HH:MM:SS'.
|
||||
"""
|
||||
return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
|
||||
# Length of the memory ID (first N characters of SHA-256 hash)
|
||||
MEMORY_ID_LENGTH: int = 16
|
||||
|
|
|
|||
|
|
@ -374,8 +374,6 @@ Examples:
|
|||
args = parser.parse_args()
|
||||
|
||||
# Determine which LLMs to test
|
||||
llms_to_test = []
|
||||
|
||||
if args.all:
|
||||
llms_to_test = [
|
||||
(OpenAILLM, "OpenAILLM"),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ search tools (Dashscope, Mock, Tavily) and execution tools (Code, Shell).
|
|||
|
||||
import asyncio
|
||||
|
||||
from reme_ai.core.reme import ReMe
|
||||
from reme_ai.reme import ReMe
|
||||
|
||||
ReMe()
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ def test_simple_chat():
|
|||
Tests the SimpleChat agent with a basic query to verify
|
||||
it can process and respond to user input.
|
||||
"""
|
||||
from reme_ai.mem_agent import SimpleChat
|
||||
from reme_ai.mem_agent.chat import SimpleChat
|
||||
|
||||
op = SimpleChat()
|
||||
asyncio.run(op.call(query="你好"))
|
||||
|
|
@ -168,7 +168,7 @@ async def test_stream_chat():
|
|||
Tests the StreamChat agent with a query to verify it can
|
||||
process and stream responses in real-time using async operations.
|
||||
"""
|
||||
from reme_ai.mem_agent import StreamChat
|
||||
from reme_ai.mem_agent.chat import StreamChat
|
||||
from reme_ai.core.utils import execute_stream_task
|
||||
from reme_ai.core.context import RuntimeContext
|
||||
from asyncio import Queue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue