Skip to content

Commit b43df43

Browse files
committed
manual fix
1 parent 43cd203 commit b43df43

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

template_langgraph/services/streamlits/pages/chat_with_tools_agent.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ def load_stt_wrapper(model_size: str = "base"):
6464
return stt_wrapper
6565

6666

67-
# 以前は Streamlit セッションに chat_history を保持していたが、
68-
# 仕様変更により LangGraph の state (messages) を直接参照する方式へ移行。
69-
# そのため chat_history の初期化は削除。
70-
71-
7267
@dataclass(slots=True)
7368
class AudioSettings:
7469
audio_bytes: bytes | None
@@ -93,7 +88,6 @@ def to_history_message(self) -> dict[str, object]:
9388

9489

9590
def ensure_session_state_defaults(tool_names: list[str]) -> None:
96-
# chat_history は利用せず(LangGraph 側の messages を利用)
9791
st.session_state.setdefault("input_output_mode", "テキスト")
9892
st.session_state.setdefault("selected_tool_names", tool_names)
9993
st.session_state.setdefault("checkpoint_type", DEFAULT_CHECKPOINT_TYPE.value)
@@ -133,14 +127,6 @@ def get_checkpointer():
133127
def ensure_agent_graph(selected_tools: list) -> None:
134128
signature = (tuple(tool.name for tool in selected_tools), get_selected_checkpoint_type().value)
135129
graph_signature = st.session_state.get("graph_tools_signature")
136-
checkpointer = get_checkpointer()
137-
if checkpointer:
138-
for checkpoint in checkpointer.list(config=None):
139-
logger.debug(checkpoint)
140-
logger.debug(
141-
f"thread_id={checkpoint.config['configurable'].get('thread_id')}, checkpoint={checkpoint.checkpoint['channel_values']}", # noqa: E501
142-
)
143-
144130
if "graph" not in st.session_state or graph_signature != signature:
145131
st.session_state["graph"] = ChatWithToolsAgent(
146132
tools=selected_tools,
@@ -470,7 +456,6 @@ def invoke_agent(graph_messages: list) -> AgentState:
470456
],
471457
"configurable": {
472458
"thread_id": st.session_state.get("thread_id"),
473-
"user_id": "user_1",
474459
},
475460
},
476461
)

0 commit comments

Comments
 (0)