babf0b593a
- Proper StateGraph with compiled nodes - Conditional edges for writing iteration - Checkpoint memory for resumability - Structured state with Pydantic - Node_validate for cross-stage validation - Writing loop with iterate/next logic - Full end-to-end workflow This is the rigorous LangGraph integration.
67 lines
1.6 KiB
Python
67 lines
1.6 KiB
Python
"""Opus Orchestrator AI.
|
|
|
|
Full-flow AI book generation using LangGraph, CrewAI, AutoGen, and PydanticAI.
|
|
Integrates Fiction Fortress and Nonfiction Fortress methodologies.
|
|
"""
|
|
|
|
from opus_orchestrator.agents.fiction import (
|
|
ArchitectAgent,
|
|
CharacterLeadAgent,
|
|
EditorAgent,
|
|
VoiceAgent,
|
|
WorldsmithAgent,
|
|
)
|
|
from opus_orchestrator.agents.nonfiction import (
|
|
AnalystAgent,
|
|
FactCheckerAgent,
|
|
NonfictionEditorAgent,
|
|
NonfictionWriterAgent,
|
|
ResearcherAgent,
|
|
)
|
|
from opus_orchestrator.config import OpusConfig, get_config
|
|
from opus_orchestrator.schemas import (
|
|
BookIntent,
|
|
BookType,
|
|
Manuscript,
|
|
RawContent,
|
|
)
|
|
from opus_orchestrator.state import OpusState, create_initial_state
|
|
from opus_orchestrator.langgraph_workflow import OpusGraph, run_opus, OpusGraphState
|
|
from opus_orchestrator.frameworks import StoryFramework
|
|
|
|
__all__ = [
|
|
# Config
|
|
"OpusConfig",
|
|
"get_config",
|
|
# State
|
|
"OpusState",
|
|
"create_initial_state",
|
|
# Schemas
|
|
"BookIntent",
|
|
"BookType",
|
|
"Manuscript",
|
|
"RawContent",
|
|
# Fiction Agents
|
|
"ArchitectAgent",
|
|
"CharacterLeadAgent",
|
|
"EditorAgent",
|
|
"VoiceAgent",
|
|
"WorldsmithAgent",
|
|
# Nonfiction Agents
|
|
"ResearcherAgent",
|
|
"AnalystAgent",
|
|
"NonfictionWriterAgent",
|
|
"FactCheckerAgent",
|
|
"NonfictionEditorAgent",
|
|
# LangGraph
|
|
"OpusGraph",
|
|
"OpusGraphState",
|
|
"run_opus",
|
|
"StoryFramework",
|
|
# Main (legacy)
|
|
"OpusOrchestrator",
|
|
]
|
|
|
|
# Import legacy orchestrator for backward compatibility
|
|
from opus_orchestrator.orchestrator import OpusOrchestrator
|