julee.domain.models.assembly_specification.knowledge_service_query

KnowledgeServiceQuery domain models for the Capture, Extract, Assemble, Publish workflow.

This module contains the KnowledgeServiceQuery domain object that represents specific queries to knowledge services for data extraction in the CEAP workflow system.

A KnowledgeServiceQuery defines a specific extraction operation that can be performed against a knowledge service to extract data for a particular part of an AssemblySpecification’s JSON schema.

All domain models use Pydantic BaseModel for validation, serialization, and type safety, following the patterns established in the sample project.

Classes

KnowledgeServiceQuery

Knowledge service query configuration for extracting specific data.

Module Contents

class julee.domain.models.assembly_specification.knowledge_service_query.KnowledgeServiceQuery(/, **data)[source]

Bases: pydantic.BaseModel

Knowledge service query configuration for extracting specific data.

A KnowledgeServiceQuery represents a specific extraction operation that can be performed against a knowledge service. It defines which knowledge service to use and what prompt to send for data extraction.

When executed, the relevant section of the AssemblySpecification’s JSON schema will be passed along with the prompt to ensure the knowledge service response conforms to the expected structure and validation requirements.

The mapping between queries and schema sections is handled by the AssemblySpecification’s knowledge_service_queries field.

Examples of query_metadata usage:

For Anthropic services:

query_metadata = {
    "model": "claude-sonnet-4-5",
    "max_tokens": 4000,
    "temperature": 0.1
}

For OpenAI services:

query_metadata = {
    "model": "gpt-4",
    "temperature": 0.2,
    "top_p": 0.9
}

For custom services:

query_metadata = {
    "endpoint": "custom-model-v2",
    "timeout": 30,
    "retries": 3
}
classmethod knowledge_service_id_must_not_be_empty(v)[source]
classmethod name_must_not_be_empty(v)[source]
classmethod prompt_must_not_be_empty(v)[source]
classmethod query_id_must_not_be_empty(v)[source]
assistant_prompt: str | None = None[source]
created_at: datetime.datetime | None = None[source]
knowledge_service_id: str = None[source]
name: str = None[source]
prompt: str = None[source]
query_id: str = None[source]
query_metadata: dict[str, Any] | None = None[source]
updated_at: datetime.datetime | None = None[source]