|
from dotenv import load_dotenv |
|
from langgraph_supervisor import create_supervisor |
|
from langchain.chat_models import init_chat_model |
|
from langchain_core.messages import SystemMessage |
|
|
|
from agents.shopper import shopper_agent |
|
from agents.researcher import craft_research_agent |
|
from agents.mentor import mentor_agent |
|
from agents.prompts import supervisor_prompt |
|
|
|
load_dotenv() |
|
|
|
|
|
model = init_chat_model("gemini-2.0-flash", model_provider="google_genai") |
|
|
|
supervisor = create_supervisor( |
|
model=model, |
|
agents=[shopper_agent, craft_research_agent, mentor_agent], |
|
|
|
prompt=SystemMessage(content=supervisor_prompt), |
|
add_handoff_messages=True, |
|
add_handoff_back_messages=True, |
|
output_mode="last_message", |
|
).compile() |
|
|