julee.services.knowledge_service.factory ======================================== .. py:module:: julee.services.knowledge_service.factory .. autoapi-nested-parse:: Factory function for creating KnowledgeService implementations. This module provides the factory function for creating configured KnowledgeService instances based on the service API configuration. Classes ------- .. autoapisummary:: julee.services.knowledge_service.factory.ConfigurableKnowledgeService Functions --------- .. autoapisummary:: julee.services.knowledge_service.factory.knowledge_service_factory Module Contents --------------- .. py:class:: ConfigurableKnowledgeService Bases: :py:obj:`julee.services.knowledge_service.knowledge_service.KnowledgeService` KnowledgeService implementation that uses the factory pattern. This class implements the KnowledgeService protocol by delegating to a factory-created service instance. It can be wrapped by temporal decorators while maintaining proper protocol compliance. No constructor configuration is required - the factory is called within each method using the provided config parameter. .. py:method:: execute_query(config, query_text, output_schema = None, service_file_ids = None, query_metadata = None, assistant_prompt = None) :async: Execute a query against the knowledge service. .. py:method:: register_file(config, document) :async: Register a document with the knowledge service. .. py:function:: knowledge_service_factory(knowledge_service_config) Create a configured KnowledgeService instance. This factory function takes a KnowledgeServiceConfig domain object (containing metadata and service_api information) and returns a properly configured KnowledgeService implementation that can handle external operations. :param knowledge_service_config: KnowledgeServiceConfig domain object with configuration and API information :returns: Configured KnowledgeService implementation ready for external operations :raises ValueError: If the service_api is not supported .. admonition:: Example >>> from julee.domain import KnowledgeServiceConfig >>> from julee.domain.models.knowledge_service_config import ( ... ServiceApi ... ) >>> config = KnowledgeServiceConfig( ... knowledge_service_id="ks-123", ... name="My Anthropic Service", ... description="Anthropic-powered document analysis", ... service_api=ServiceApi.ANTHROPIC ... ) >>> service = knowledge_service_factory(config) >>> result = await service.register_file(document)