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)[源代码]

基类: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][源代码]

Filters the chat messages to only include those which contain time-related keywords.

返回:

A list of filtered messages that mention time.

返回类型:

List[Message]

build_message(filter_messages: List[Message]) List[Message][源代码]
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.

参数:

filter_messages (List[Message]) -- A list of Message objects that have been filtered for processing.

返回:

A list containing the newly constructed Message object for further interaction.

返回类型:

List[Message]

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
logger: Logger