memoryscope.core.worker.backend.get_observation_with_time_worker
- class memoryscope.core.worker.backend.get_observation_with_time_worker.GetObservationWithTimeWorker(embedding_model: str = '', generation_model: str = '', rank_model: str = '', **kwargs)[source]
Bases:
GetObservationWorker
A specialized worker class that extends GetObservationWorker functionality to handle retrieval of observations which include associated timestamp information from chat messages.
- FILE_PATH: str = '/home/runner/work/MemoryScope/MemoryScope/memoryscope/core/worker/backend/get_observation_with_time_worker.py'
- OBS_STORE_KEY: str = 'new_obs_with_time_nodes'
- filter_messages() List[Message] [source]
Filters the chat messages to only include those which contain time-related keywords.
- Returns:
A list of filtered messages that mention time.
- Return type:
List[Message]
- build_message(filter_messages: List[Message]) List[Message] [source]
- Constructs a prompt message for obtaining observations with timestamp information
based on filtered chat messages.
This method processes each filtered message with the timestamp information. It then organizes these timestamped messages into a structured prompt that includes a system prompt, few-shot examples, and the concatenated user queries.
- name: str
- workflow_context: Dict[str, Any]
- memoryscope_context: MemoryscopeContext
- raise_exception: bool
- is_multi_thread: bool
- thread_pool: ThreadPoolExecutor
- enable_parallel: bool
- kwargs: dict
- continue_run: bool
- async_task_list: list
- thread_task_list: list