File size: 3,582 Bytes
fd1472e fa696e8 fd1472e 627c291 fd1472e 627c291 fd1472e 627c291 fd1472e fa696e8 fd1472e 599a754 fd1472e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
"""Centralized domain configuration for research agents.
This module defines research domains and their associated prompts,
allowing the agent to operate in domain-agnostic or domain-specific modes.
Usage:
from src.config.domain import get_domain_config, ResearchDomain
# Get default config
config = get_domain_config()
# Get specific domain
config = get_domain_config(ResearchDomain.SEXUAL_HEALTH)
# Use in prompts
system_prompt = config.judge_system_prompt
"""
from enum import Enum
from pydantic import BaseModel
class ResearchDomain(str, Enum):
"""Available research domains.
DeepBoner is a focused Sexual Health Research Specialist.
Only SEXUAL_HEALTH domain is supported.
"""
SEXUAL_HEALTH = "sexual_health"
class DomainConfig(BaseModel):
"""Configuration for a research domain.
Contains all domain-specific text used across the codebase,
ensuring consistency and single-source-of-truth.
"""
# Identity
name: str
description: str
# Report generation
report_title: str
report_focus: str
# Search context
search_description: str
search_example_query: str
# Agent descriptions (for Magentic mode)
search_agent_description: str
hypothesis_agent_description: str
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Domain Configuration - Sexual Health Only
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
SEXUAL_HEALTH_CONFIG = DomainConfig(
name="Sexual Health Research",
description="Sexual health and wellness research specialist",
report_title="## Sexual Health Analysis",
report_focus="sexual health and wellness interventions",
search_description="Searches biomedical literature for sexual health evidence",
search_example_query="testosterone therapy female libido",
search_agent_description="Searches PubMed for sexual health evidence",
hypothesis_agent_description="Generates hypotheses for sexual health interventions",
)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Domain Registry
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
DOMAIN_CONFIGS: dict[ResearchDomain, DomainConfig] = {
ResearchDomain.SEXUAL_HEALTH: SEXUAL_HEALTH_CONFIG,
}
# Default domain - DeepBoner is Sexual Health focused
DEFAULT_DOMAIN = ResearchDomain.SEXUAL_HEALTH
def get_domain_config(domain: ResearchDomain | str | None = None) -> DomainConfig:
"""Get configuration for a research domain.
Args:
domain: The research domain. Defaults to sexual_health if None.
Returns:
DomainConfig for the specified domain.
"""
if domain is None:
domain = DEFAULT_DOMAIN
if isinstance(domain, str):
try:
domain = ResearchDomain(domain)
except ValueError as e:
valid_domains = [d.value for d in ResearchDomain]
raise ValueError(f"Invalid domain '{domain}'. Valid domains: {valid_domains}") from e
return DOMAIN_CONFIGS[domain]
|