alaa wael commited on
Commit ·
d5c9e32
1
Parent(s): fcb643e
alaa update project
Browse files- agents/books/book_content.py +2 -2
- agents/books/book_content_gpt.py +3 -3
- agents/books/book_content_new.py +1 -1
- agents/books/book_planning.py +2 -2
- agents/books/book_structure.py +2 -2
- agents/books/queries_agent.py +2 -2
- agents/books/units_structure.py +2 -2
- modules/__init__.py +1 -0
- modules/env.py +7 -0
agents/books/book_content.py
CHANGED
|
@@ -19,7 +19,7 @@ os.environ["CREWAI_TRACING_ENABLED"] = "false"
|
|
| 19 |
os.environ["CREWAI_DISABLE_TELEMETRY"] = "true"
|
| 20 |
|
| 21 |
from crewai import Agent, Task, Crew, Process
|
| 22 |
-
from modules import
|
| 23 |
|
| 24 |
# ---------------------------------------------------------
|
| 25 |
# Helpers
|
|
@@ -812,7 +812,7 @@ def make_writer_agent() -> Agent:
|
|
| 812 |
|
| 813 |
|
| 814 |
def make_quality_agent() -> Agent:
|
| 815 |
-
model =
|
| 816 |
return Agent(
|
| 817 |
name="ArabicBookQualityGateV3",
|
| 818 |
role="Arabic Developmental Editor & Compliance QA",
|
|
|
|
| 19 |
os.environ["CREWAI_DISABLE_TELEMETRY"] = "true"
|
| 20 |
|
| 21 |
from crewai import Agent, Task, Crew, Process
|
| 22 |
+
from modules import llm_open_4m, llm_open_grok
|
| 23 |
|
| 24 |
# ---------------------------------------------------------
|
| 25 |
# Helpers
|
|
|
|
| 812 |
|
| 813 |
|
| 814 |
def make_quality_agent() -> Agent:
|
| 815 |
+
model = llm_open_4m()
|
| 816 |
return Agent(
|
| 817 |
name="ArabicBookQualityGateV3",
|
| 818 |
role="Arabic Developmental Editor & Compliance QA",
|
agents/books/book_content_gpt.py
CHANGED
|
@@ -19,7 +19,7 @@ os.environ["CREWAI_TRACING_ENABLED"] = "false"
|
|
| 19 |
os.environ["CREWAI_DISABLE_TELEMETRY"] = "true"
|
| 20 |
|
| 21 |
from crewai import Agent, Task, Crew, Process
|
| 22 |
-
from modules import
|
| 23 |
|
| 24 |
# ---------------------------------------------------------
|
| 25 |
# Helpers
|
|
@@ -386,7 +386,7 @@ QUALITY_EXPECTED_OUTPUT = "Strict JSON with keys: generated_content, sources"
|
|
| 386 |
|
| 387 |
|
| 388 |
def make_writer_agent() -> Agent:
|
| 389 |
-
model =
|
| 390 |
return Agent(
|
| 391 |
name="ArabicNonFictionBookAuthorV3",
|
| 392 |
role="Arabic Non-Fiction Book Author (Adaptive | RAG-Strict | APA7 | Style-Exact)",
|
|
@@ -406,7 +406,7 @@ def make_writer_agent() -> Agent:
|
|
| 406 |
|
| 407 |
|
| 408 |
def make_quality_agent() -> Agent:
|
| 409 |
-
model =
|
| 410 |
return Agent(
|
| 411 |
name="ArabicBookQualityGateV3",
|
| 412 |
role="Arabic Developmental Editor & Compliance QA",
|
|
|
|
| 19 |
os.environ["CREWAI_DISABLE_TELEMETRY"] = "true"
|
| 20 |
|
| 21 |
from crewai import Agent, Task, Crew, Process
|
| 22 |
+
from modules import llm_open_4m, llm_open_grok
|
| 23 |
|
| 24 |
# ---------------------------------------------------------
|
| 25 |
# Helpers
|
|
|
|
| 386 |
|
| 387 |
|
| 388 |
def make_writer_agent() -> Agent:
|
| 389 |
+
model = llm_open_4m()
|
| 390 |
return Agent(
|
| 391 |
name="ArabicNonFictionBookAuthorV3",
|
| 392 |
role="Arabic Non-Fiction Book Author (Adaptive | RAG-Strict | APA7 | Style-Exact)",
|
|
|
|
| 406 |
|
| 407 |
|
| 408 |
def make_quality_agent() -> Agent:
|
| 409 |
+
model = llm_open_4m()
|
| 410 |
return Agent(
|
| 411 |
name="ArabicBookQualityGateV3",
|
| 412 |
role="Arabic Developmental Editor & Compliance QA",
|
agents/books/book_content_new.py
CHANGED
|
@@ -31,7 +31,7 @@ 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
|
| 35 |
|
| 36 |
|
| 37 |
# ---------------------------------------------------------
|
|
|
|
| 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 |
# ---------------------------------------------------------
|
agents/books/book_planning.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
from crewai import Agent, Task
|
| 2 |
-
from modules import
|
| 3 |
from schemas.books.book_planning import ChapterPlanningBlockDTO
|
| 4 |
|
| 5 |
# ================================
|
| 6 |
# Agent
|
| 7 |
# ================================
|
| 8 |
def agent_task_planning():
|
| 9 |
-
model =
|
| 10 |
book_planner_agent = Agent(
|
| 11 |
name="BookPlanningAgent",
|
| 12 |
role="مخطط محتوى كتاب غير روائي (Non-fiction) على مستوى الشابتر",
|
|
|
|
| 1 |
from crewai import Agent, Task
|
| 2 |
+
from modules import llm_open_4m
|
| 3 |
from schemas.books.book_planning import ChapterPlanningBlockDTO
|
| 4 |
|
| 5 |
# ================================
|
| 6 |
# Agent
|
| 7 |
# ================================
|
| 8 |
def agent_task_planning():
|
| 9 |
+
model = llm_open_4m()
|
| 10 |
book_planner_agent = Agent(
|
| 11 |
name="BookPlanningAgent",
|
| 12 |
role="مخطط محتوى كتاب غير روائي (Non-fiction) على مستوى الشابتر",
|
agents/books/book_structure.py
CHANGED
|
@@ -255,7 +255,7 @@
|
|
| 255 |
# async_execution=False,
|
| 256 |
# )
|
| 257 |
from crewai import Agent, Task
|
| 258 |
-
from modules import
|
| 259 |
from schemas import BookOutlineOutput
|
| 260 |
|
| 261 |
|
|
@@ -263,7 +263,7 @@ from schemas import BookOutlineOutput
|
|
| 263 |
# Agent: Book Structure Designer
|
| 264 |
# ---------------------------------------------------
|
| 265 |
def book_structure_agent():
|
| 266 |
-
model =
|
| 267 |
|
| 268 |
return Agent(
|
| 269 |
name="BookStructureDesigner",
|
|
|
|
| 255 |
# async_execution=False,
|
| 256 |
# )
|
| 257 |
from crewai import Agent, Task
|
| 258 |
+
from modules import llm_open_4m
|
| 259 |
from schemas import BookOutlineOutput
|
| 260 |
|
| 261 |
|
|
|
|
| 263 |
# Agent: Book Structure Designer
|
| 264 |
# ---------------------------------------------------
|
| 265 |
def book_structure_agent():
|
| 266 |
+
model = llm_open_4m()
|
| 267 |
|
| 268 |
return Agent(
|
| 269 |
name="BookStructureDesigner",
|
agents/books/queries_agent.py
CHANGED
|
@@ -117,7 +117,7 @@ from crewai import Agent, Task
|
|
| 117 |
import os
|
| 118 |
import json
|
| 119 |
from schemas.books.queries_schema import QueriesOutput
|
| 120 |
-
from modules import
|
| 121 |
|
| 122 |
|
| 123 |
|
|
@@ -127,7 +127,7 @@ from modules import llm_4m
|
|
| 127 |
|
| 128 |
|
| 129 |
def query_agent():
|
| 130 |
-
model =
|
| 131 |
|
| 132 |
return Agent(
|
| 133 |
name="BookSourceQueryAgent",
|
|
|
|
| 117 |
import os
|
| 118 |
import json
|
| 119 |
from schemas.books.queries_schema import QueriesOutput
|
| 120 |
+
from modules import llm_open_4m
|
| 121 |
|
| 122 |
|
| 123 |
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
def query_agent():
|
| 130 |
+
model = llm_open_4m()
|
| 131 |
|
| 132 |
return Agent(
|
| 133 |
name="BookSourceQueryAgent",
|
agents/books/units_structure.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
from crewai import Agent, Task
|
| 2 |
-
from modules import
|
| 3 |
from schemas import CourseSchema
|
| 4 |
|
| 5 |
|
| 6 |
def course_structuring_agent():
|
| 7 |
-
model =
|
| 8 |
return Agent(
|
| 9 |
name="CourseStructuringAgent",
|
| 10 |
role="Educational Content Structuring Expert",
|
|
|
|
| 1 |
from crewai import Agent, Task
|
| 2 |
+
from modules import llm_open_4m
|
| 3 |
from schemas import CourseSchema
|
| 4 |
|
| 5 |
|
| 6 |
def course_structuring_agent():
|
| 7 |
+
model = llm_open_4m()
|
| 8 |
return Agent(
|
| 9 |
name="CourseStructuringAgent",
|
| 10 |
role="Educational Content Structuring Expert",
|
modules/__init__.py
CHANGED
|
@@ -12,6 +12,7 @@ from .env import (
|
|
| 12 |
llm_open_nova,
|
| 13 |
llm_open_hermes,
|
| 14 |
llm_open_grok,
|
|
|
|
| 15 |
llm_qwen,
|
| 16 |
model,
|
| 17 |
model_open_router,
|
|
|
|
| 12 |
llm_open_nova,
|
| 13 |
llm_open_hermes,
|
| 14 |
llm_open_grok,
|
| 15 |
+
llm_open_4m,
|
| 16 |
llm_qwen,
|
| 17 |
model,
|
| 18 |
model_open_router,
|
modules/env.py
CHANGED
|
@@ -58,6 +58,13 @@ def llm_4m():
|
|
| 58 |
model="gpt-4.1-mini-2025-04-14",
|
| 59 |
)
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
def llm_5n():
|
| 62 |
return LLM(
|
| 63 |
model="gpt-5-nano-2025-08-07",
|
|
|
|
| 58 |
model="gpt-4.1-mini-2025-04-14",
|
| 59 |
)
|
| 60 |
|
| 61 |
+
def llm_open_4m():
|
| 62 |
+
return LLM(
|
| 63 |
+
api_key=os.environ["OPENROUTER_API_KEY"],
|
| 64 |
+
base_url="https://openrouter.ai/api/v1",
|
| 65 |
+
model="openrouter/openai/gpt-4.1-mini",
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
def llm_5n():
|
| 69 |
return LLM(
|
| 70 |
model="gpt-5-nano-2025-08-07",
|