feat: Add main to generate graph
This commit is contained in:
25
src/main.py
Normal file
25
src/main.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import os
|
||||||
|
from naliiabot.bot.agent.agent import Agent, AgentConfig
|
||||||
|
from naliiabot.bot.tools.naliia_tools import NaliiaTools
|
||||||
|
from naliiabot.bot.prompts.load_prompt import get_prompt_template
|
||||||
|
from langchain_anthropic import ChatAnthropic
|
||||||
|
|
||||||
|
model_name = "claude-sonnet-4-5-20250929"
|
||||||
|
model = ChatAnthropic(
|
||||||
|
model=model_name
|
||||||
|
)
|
||||||
|
|
||||||
|
MODEL_NAME = os.getenv("LLM_MODEL", "anthropic")
|
||||||
|
NALIIA_PROMPT = get_prompt_template(
|
||||||
|
"NALIIA_PROMPT")
|
||||||
|
naliia_tools = NaliiaTools().get_tools()
|
||||||
|
config = AgentConfig(system_prompt=NALIIA_PROMPT)
|
||||||
|
|
||||||
|
|
||||||
|
agent = Agent(model=model, config=config, tools=naliia_tools)
|
||||||
|
|
||||||
|
|
||||||
|
graph_image = agent._compiled_agent.get_graph().draw_mermaid_png()
|
||||||
|
|
||||||
|
with open("graph.png", "wb") as f:
|
||||||
|
f.write(graph_image)
|
||||||
Reference in New Issue
Block a user