julee.services.knowledge_service.anthropic.knowledge_service¶
Anthropic implementation of KnowledgeService for the Capture, Extract, Assemble, Publish workflow.
This module provides the Anthropic-specific implementation of the KnowledgeService protocol. It handles interactions with Anthropic’s API for document registration and query execution.
- Requirements:
ANTHROPIC_API_KEY environment variable must be set
Attributes¶
Classes¶
Anthropic implementation of the KnowledgeService protocol. |
Module Contents¶
- class julee.services.knowledge_service.anthropic.knowledge_service.AnthropicKnowledgeService[source]¶
Bases:
julee.services.knowledge_service.knowledge_service.KnowledgeServiceAnthropic implementation of the KnowledgeService protocol.
This class handles interactions with Anthropic’s API for document registration and query execution. It implements the KnowledgeService protocol with Anthropic-specific logic.
- async execute_query(config, query_text, service_file_ids=None, query_metadata=None, assistant_prompt=None)[source]¶
Execute a query against Anthropic.
- Parameters:
config (julee.domain.models.knowledge_service_config.KnowledgeServiceConfig) – KnowledgeServiceConfig for this operation
query_text (str) – The query to execute
service_file_ids (list[str] | None) – Optional list of Anthropic file IDs to provide as context for the query
query_metadata (dict[str, Any] | None) – Optional Anthropic-specific configuration such as model, temperature, max_tokens, etc.
assistant_prompt (str | None) – Optional assistant message content to constrain or prime the model’s response
- Returns:
QueryResult with Anthropic query results
- Return type:
julee.services.knowledge_service.knowledge_service.QueryResult
- async register_file(config, document)[source]¶
Register a document file with Anthropic.
- Parameters:
config (julee.domain.models.knowledge_service_config.KnowledgeServiceConfig) – KnowledgeServiceConfig for this operation
document (julee.domain.models.document.Document) – Document domain object to register
- Returns:
FileRegistrationResult with Anthropic-specific details
- Return type:
julee.services.knowledge_service.knowledge_service.FileRegistrationResult