Skip to content

Commit 9e38c5c

Browse files
committed
rename from basic workflow to chat with tools
1 parent e71cc29 commit 9e38c5c

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ uv run python -m template_langgraph.tasks.search_documents_on_elasticsearch
2525
uv run python -m template_langgraph.tasks.run_kabuto_helpdesk_agent "KABUTOの起動時に、画面全体が紫色に点滅し、システムがフリーズします。"
2626
uv run python -m template_langgraph.tasks.run_kabuto_helpdesk_agent "KABUTOのマニュアルから禅モードに関する情報を教えて下さい"
2727

28-
# BasicWorkflowAgent
29-
uv run python -m template_langgraph.tasks.draw_basic_workflow_agent_mermaid_png "data/basic_workflow_agent.png"
30-
uv run python -m template_langgraph.tasks.run_basic_workflow_agent
28+
# ChatWithToolsAgent
29+
uv run python -m template_langgraph.tasks.draw_chat_with_tools_agent_mermaid_png "data/chat_with_tools_agent.png"
30+
uv run python -m template_langgraph.tasks.run_chat_with_tools_agent
3131
# KABUTOの起動時に、画面全体が紫色に点滅し、システムがフリーズします。KABUTO のマニュアルから、関連する情報を取得したり過去のシステムのトラブルシュート事例が蓄積されたデータベースから、関連する情報を取得して質問に答えてください
3232
# 天狗のいたずら という現象について KABUTO のマニュアルから、関連する情報を取得したり過去のシステムのトラブルシュート事例が蓄積されたデータベースから、関連する情報を取得して質問に答えてください
3333

langgraph.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"."
44
],
55
"graphs": {
6-
"basic_workflow_agent": "template_langgraph.agents.basic_workflow_agent.agent:graph",
6+
"chat_with_tools_agent": "template_langgraph.agents.chat_with_tools_agent.agent:graph",
77
"kabuto_helpdesk_agent": "template_langgraph.agents.kabuto_helpdesk_agent:graph",
88
"issue_formatter_agent": "template_langgraph.agents.issue_formatter_agent.agent:graph"
99
},
File renamed without changes.

template_langgraph/agents/basic_workflow_agent/agent.py renamed to template_langgraph/agents/chat_with_tools_agent/agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from langchain_core.messages import ToolMessage
44
from langgraph.graph import END, StateGraph
55

6-
from template_langgraph.agents.basic_workflow_agent.models import AgentState
6+
from template_langgraph.agents.chat_with_tools_agent.models import AgentState
77
from template_langgraph.llms.azure_openais import AzureOpenAiWrapper
88
from template_langgraph.loggers import get_logger
99
from template_langgraph.tools.elasticsearch_tool import search_elasticsearch
@@ -36,7 +36,7 @@ def __call__(self, inputs: dict):
3636
return {"messages": outputs}
3737

3838

39-
class BasicWorkflowAgent:
39+
class ChatWithToolsAgent:
4040
def __init__(self):
4141
self.llm = AzureOpenAiWrapper().chat_model
4242

@@ -80,7 +80,7 @@ def create_graph(self):
8080

8181
def initialize(self, state: AgentState) -> AgentState:
8282
"""Initialize the agent with the given state."""
83-
logger.info(f"Initializing BasicWorkflowAgent with state: {state}")
83+
logger.info(f"Initializing ChatWithToolsAgent with state: {state}")
8484
# Here you can add any initialization logic if needed
8585
return state
8686

@@ -119,7 +119,7 @@ def route_tools(
119119

120120
def finalize(self, state: AgentState) -> AgentState:
121121
"""Finalize the agent's work and prepare the output."""
122-
logger.info(f"Finalizing BasicWorkflowAgent with state: {state}")
122+
logger.info(f"Finalizing ChatWithToolsAgent with state: {state}")
123123
# Here you can add any finalization logic if needed
124124
return state
125125

@@ -128,4 +128,4 @@ def draw_mermaid_png(self) -> bytes:
128128
return self.create_graph().get_graph().draw_mermaid_png()
129129

130130

131-
graph = BasicWorkflowAgent().create_graph()
131+
graph = ChatWithToolsAgent().create_graph()
File renamed without changes.

template_langgraph/tasks/draw_basic_workflow_agent_mermaid_png.py

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import sys
2+
3+
from template_langgraph.agents.chat_with_tools_agent.agent import ChatWithToolsAgent
4+
5+
if __name__ == "__main__":
6+
png_path = "data/chat_with_tools_agent.png"
7+
if len(sys.argv) > 1:
8+
png_path = sys.argv[1]
9+
10+
with open(png_path, "wb") as f:
11+
f.write(ChatWithToolsAgent().draw_mermaid_png())

template_langgraph/tasks/run_basic_workflow_agent.py renamed to template_langgraph/tasks/run_chat_with_tools_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

3-
from template_langgraph.agents.basic_workflow_agent.agent import AgentState
4-
from template_langgraph.agents.basic_workflow_agent.agent import graph as basic_workflow_agent_graph
3+
from template_langgraph.agents.chat_with_tools_agent.agent import AgentState
4+
from template_langgraph.agents.chat_with_tools_agent.agent import graph as chat_with_tools_agent_graph
55
from template_langgraph.loggers import get_logger
66

77
logger = get_logger(__name__)
@@ -11,7 +11,7 @@
1111
def stream_graph_updates(
1212
state: AgentState,
1313
) -> dict:
14-
for event in basic_workflow_agent_graph.stream(input=state):
14+
for event in chat_with_tools_agent_graph.stream(input=state):
1515
logger.info("-" * 20)
1616
logger.info(f"Event: {event}")
1717
return event

0 commit comments

Comments
 (0)