julee.services.knowledge_service.memory ======================================= .. py:module:: julee.services.knowledge_service.memory .. autoapi-nested-parse:: Memory-based implementation of KnowledgeService for testing and development. This module provides an in-memory implementation of the KnowledgeService protocol that stores file registrations in memory and returns configurable canned responses for queries. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/julee/services/knowledge_service/memory/knowledge_service/index Classes ------- .. autoapisummary:: julee.services.knowledge_service.memory.MemoryKnowledgeService Package Contents ---------------- .. py:class:: MemoryKnowledgeService(config) Bases: :py:obj:`julee.services.knowledge_service.knowledge_service.KnowledgeService` In-memory implementation of the KnowledgeService protocol. This class stores file registrations in memory using a dictionary keyed by knowledge_service_file_id. Query results are returned from a configurable queue of canned responses. Useful for testing and development scenarios where you want to avoid external service dependencies while still exercising the full knowledge service workflow. .. py:method:: add_canned_query_result(query_result) Add a canned query result to be returned by execute_query. :param query_result: QueryResult to return from future execute_query calls .. py:method:: add_canned_query_results(query_results) Add multiple canned query results to be returned by execute_query. :param query_results: List of QueryResult objects to return from future execute_query calls .. py:method:: clear_canned_query_results() Clear all canned query results. .. py:method:: execute_query(config, query_text, service_file_ids = None, query_metadata = None, assistant_prompt = None) :async: Execute a query by returning a canned response. :param config: KnowledgeServiceConfig for this operation :param query_text: The query to execute :param service_file_ids: Optional list of service file IDs for query :param query_metadata: Optional service-specific metadata (ignored in memory implementation) :param assistant_prompt: Optional assistant message content (ignored in memory implementation) :returns: QueryResult from the queue of canned responses :raises ValueError: If no canned query results are available .. py:method:: get_all_registered_files() Get all registered files. :returns: Dictionary mapping knowledge_service_file_id to FileRegistrationResult .. py:method:: get_registered_file(knowledge_service_file_id) Get a registered file by its knowledge service file ID. :param knowledge_service_file_id: The file ID assigned by this service :returns: FileRegistrationResult if found, None otherwise .. py:method:: register_file(config, document) :async: Register a document file by storing metadata in memory. :param config: KnowledgeServiceConfig for this operation :param document: Document domain object to register :returns: FileRegistrationResult with memory-specific details .. py:attribute:: config