HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/textanalyse/team/proofreading_team.py
# team/proofreading_team.py
from agno.agent import Agent  # Use Agent with team for coordination
from textwrap import dedent

# Import model config for the coordinator
from config import SelectedModelClass, SELECTED_MODEL_ID, SELECTED_API_KEY

# Import specialist agents (handle potential None values if config failed)
from agents.spelling_agent import SpellingAgent # Assuming this imports an instance or None
from agents.punctuation_agent import PunctuationAgent # Assuming this imports an instance or None
from agents.dictionary_agent import DictionaryAgent # Assuming this imports an instance or None
from agents.grammar_agent import GrammarAgent # Assuming this imports an instance or None
from agents.logic_agent import LogicAgent # Assuming this imports an instance or None
from agents.tempus_agent import TempusAgent # TempusAgent für Zeitformanalyse
from agents.modus_agent import ModusAgent # ModusAgent für Konjunktiv in indirekter Rede
from agents.phonetics_agent import PhoneticsAgent # Agent für Laut-Buchstaben-Zuordnung
from agents.citation_agent import CitationAgent # Neuer Agent für Zitiertechnik
from agents.style_agent import StyleAgent
from agents.structure_agent import StructureAgent
from agents.coherence_agent import CoherenceAgent
from agents.vocabulary_agent import VocabularyAgent
from agents.readability_agent import ReadabilityAgent
from agents.argumentation_agent import ArgumentationAgent

# Assign the imported agent instances directly
# The actual agent objects (or None) are created within their respective modules
spelling_agent_instance = SpellingAgent
punctuation_agent_instance = PunctuationAgent
dictionary_agent_instance = DictionaryAgent
grammar_agent_instance = GrammarAgent
logic_agent_instance = LogicAgent
tempus_agent_instance = TempusAgent
modus_agent_instance = ModusAgent
phonetics_agent_instance = PhoneticsAgent
citation_agent_instance = CitationAgent # Neu: CitationAgent-Instanz
style_agent_instance = StyleAgent
structure_agent_instance = StructureAgent
coherence_agent_instance = CoherenceAgent
vocabulary_agent_instance = VocabularyAgent
readability_agent_instance = ReadabilityAgent
argumentation_agent_instance = ArgumentationAgent

# Create the list of specialist agents, filtering out any that failed to initialize
potential_agents = [
    spelling_agent_instance,
    punctuation_agent_instance,
    dictionary_agent_instance,
    grammar_agent_instance,
    logic_agent_instance,
    tempus_agent_instance,
    modus_agent_instance,
    phonetics_agent_instance,
    citation_agent_instance, # Neu: CitationAgent zur Liste hinzufügen
    style_agent_instance,
    structure_agent_instance,
    coherence_agent_instance,
    vocabulary_agent_instance,
    readability_agent_instance,
    argumentation_agent_instance
]
specialist_agents = [agent for agent in potential_agents if agent is not None]

# Exportiere auch für Debugging-Zwecke
specialist_agents_instance = specialist_agents

## Koordinator zum Orchestrieren der Spezialagenten
proofreading_coordinator = None
if SelectedModelClass and specialist_agents:
    # Agent mit Team-Parameter koordiniert alle Spezialagenten
    proofreading_coordinator = Agent(
        name="ProofreadingCoordinator",
        model=SelectedModelClass(
            id=SELECTED_MODEL_ID,
            api_key=SELECTED_API_KEY,
            max_output_tokens=8192
        ),
        role="Koordiniert ein Team von spezialisierter KI-Agenten zur deutschen Textkorrektur.",
        team=specialist_agents,
        instructions=dedent("""\
            WICHTIG: Deine gesamte Ausgabe muss IMMER auf Deutsch sein.
            Du bist der Koordinator für ein Team spezialisierter KI-Agenten zur deutschen Textkorrektur.
            Deine Aufgaben:
            - Verteile den gesamten Text parallel an alle Spezialagenten und sammle ihre Korrekturvorschläge.
            - Wenn der Nutzer eine zeilenweise Überprüfung verlangt, unterteile den Text in einzelne Zeilen, leite jede Zeile an die relevanten Agenten (Rechtschreibung, Grammatik, Zeichensetzung, Stil) weiter und gib die Fehler je Zeile tabellarisch zurück.
            - Fasse alle Ergebnisse zu einer gut strukturierten Gesamtantwort zusammen.
        """),
        show_tool_calls=True,
        markdown=True,
        enable_agentic_memory=True,
        add_history_to_messages=True,
        session_id="proofreading_coordinator_session",
        parse_response=False,
        enable_session_summaries=False,
    )
elif not SelectedModelClass:
    print("ERROR: Proofreading Coordinator could not be created due to invalid model configuration.")
elif not specialist_agents:
    print("ERROR: Proofreading Coordinator could not be created because no specialist agents were available.")