alaa wael commited on
Commit ·
ad2f07f
1
Parent(s): 3a84479
alaa handeled content
Browse files
agents/books/book_content_new.py
CHANGED
|
@@ -30,8 +30,9 @@ from typing import Any, Dict, List
|
|
| 30 |
os.environ["CREWAI_TRACING_ENABLED"] = "false"
|
| 31 |
os.environ["CREWAI_DISABLE_TELEMETRY"] = "true"
|
| 32 |
|
|
|
|
| 33 |
from crewai import Agent, Task, Crew, Process
|
| 34 |
-
from modules import llm_open_4m, llm_open_grok
|
| 35 |
|
| 36 |
|
| 37 |
# ---------------------------------------------------------
|
|
|
|
| 30 |
os.environ["CREWAI_TRACING_ENABLED"] = "false"
|
| 31 |
os.environ["CREWAI_DISABLE_TELEMETRY"] = "true"
|
| 32 |
|
| 33 |
+
from core.books.content_crew_config import safe_run_once
|
| 34 |
from crewai import Agent, Task, Crew, Process
|
| 35 |
+
from modules import inputs, llm_open_4m, llm_open_grok
|
| 36 |
|
| 37 |
|
| 38 |
# ---------------------------------------------------------
|
core/books/content_services.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing import Dict, Any, List, Tuple
|
|
| 7 |
from .content_crew_config import safe_run_once, build_rag_block
|
| 8 |
from agents.books.book_content import make_writer_crew, make_quality_crew
|
| 9 |
from agents.books.book_content_gpt import make_writer_crew_gpt, make_quality_crew_gpt
|
| 10 |
-
from agents.books import make_writer_editor_crew
|
| 11 |
|
| 12 |
MAX_CHAPTER_WORKERS = 3
|
| 13 |
|
|
@@ -205,7 +205,7 @@ def process_chapter(chapter: dict, book_meta: dict, chapter_idx: int) -> dict:
|
|
| 205 |
}
|
| 206 |
writer_crew = make_writer_crew()
|
| 207 |
quality_crew = make_quality_crew()
|
| 208 |
-
writer_editor_crew = make_writer_editor_crew()
|
| 209 |
|
| 210 |
for subsection_title, raw_plan in _iter_section_plans(section):
|
| 211 |
|
|
@@ -225,7 +225,8 @@ def process_chapter(chapter: dict, book_meta: dict, chapter_idx: int) -> dict:
|
|
| 225 |
)
|
| 226 |
|
| 227 |
# 1) Writer + retry (داخل safe_run_once)
|
| 228 |
-
generated, sources = safe_run_once(writer_editor_crew, inputs)
|
|
|
|
| 229 |
content_before_review = generated
|
| 230 |
sources_before_review = sources
|
| 231 |
|
|
|
|
| 7 |
from .content_crew_config import safe_run_once, build_rag_block
|
| 8 |
from agents.books.book_content import make_writer_crew, make_quality_crew
|
| 9 |
from agents.books.book_content_gpt import make_writer_crew_gpt, make_quality_crew_gpt
|
| 10 |
+
# from agents.books import make_writer_editor_crew
|
| 11 |
|
| 12 |
MAX_CHAPTER_WORKERS = 3
|
| 13 |
|
|
|
|
| 205 |
}
|
| 206 |
writer_crew = make_writer_crew()
|
| 207 |
quality_crew = make_quality_crew()
|
| 208 |
+
# writer_editor_crew = make_writer_editor_crew()
|
| 209 |
|
| 210 |
for subsection_title, raw_plan in _iter_section_plans(section):
|
| 211 |
|
|
|
|
| 225 |
)
|
| 226 |
|
| 227 |
# 1) Writer + retry (داخل safe_run_once)
|
| 228 |
+
# generated, sources = safe_run_once(writer_editor_crew, inputs)
|
| 229 |
+
generated, sources = safe_run_once(writer_crew, inputs)
|
| 230 |
content_before_review = generated
|
| 231 |
sources_before_review = sources
|
| 232 |
|