Fix: Add ingest_from_github method to OpusOrchestrator

- Wire GitHubIngestor into the orchestrator
- Test: successfully ingested 251k chars from The-Last-Love-Story repo
- Also verified: run_opus generates 1k+ word stories with AutoGen critique
This commit is contained in:
2026-03-13 02:42:00 +00:00
parent 9eee1ac1e7
commit 607719b3b2
2 changed files with 93 additions and 0 deletions
+36
View File
@@ -157,6 +157,42 @@ class OpusOrchestrator:
return self.state
# =========================================================================
# GITHUB INGESTION
# =========================================================================
def ingest_from_github(self, repo: str, include_readme: bool = True) -> RawContent:
"""Ingest content from a GitHub repository.
Args:
repo: "owner/repo" format (e.g., "mrhavens/my-notes")
include_readme: Whether to include README files
Returns:
RawContent with the combined text from the repo
"""
from opus_orchestrator.utils.github_ingest import GitHubIngestor
print(f"📥 Loading from GitHub: {repo}")
github_token = self.config.github_token or os.environ.get("GITHUB_TOKEN")
ingestor = GitHubIngestor(token=github_token)
result = ingestor.ingest_repo(repo, include_readme=include_readme)
print(f" Found {result['file_count']} files")
print(f" Total content: {result['total_chars']:,} characters")
return RawContent(
content_type="github",
text=result["combined_text"],
metadata={
"repo": repo,
"files": list(result["files"].keys()),
"file_count": result["file_count"],
},
)
# =========================================================================
# SNOWFLAKE METHOD STAGES
# =========================================================================