From 59aa253e856e18c31bef2d69846e2bc14405f5d3 Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Thu, 8 Jan 2026 11:39:16 +0800 Subject: [PATCH] refactor(core): move get_now_time function and update imports --- reme_ai/core/schema/memory_node.py | 14 ++++++++++++-- tests/test_llm.py | 2 -- tests/test_tool.py | 6 +++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/reme_ai/core/schema/memory_node.py b/reme_ai/core/schema/memory_node.py index b8b6c92a..95d58f67 100644 --- a/reme_ai/core/schema/memory_node.py +++ b/reme_ai/core/schema/memory_node.py @@ -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 diff --git a/tests/test_llm.py b/tests/test_llm.py index 308a69a9..12c6eca3 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -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"), diff --git a/tests/test_tool.py b/tests/test_tool.py index 7f6c7afb..9db5a3ed 100644 --- a/tests/test_tool.py +++ b/tests/test_tool.py @@ -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