Changyu Lee

Dev Log [01.14.2025] : [Langgraph Chat Memories]

Published at
2025/01/14
Last edited time
2025/01/14 10:43
Created
2025/01/14 10:41
Section
Dev Log
Status
Done
Series
Tags
Basic
Log
AI summary
Keywords
Langchain
Agent
LangGraph
Language
KOR
input_message = HumanMessage(content="hi! I'm bob") for event in graph.stream({"messages": [input_message]}, chain_config, stream_mode="values"): event["messages"][-1].pretty_print()
Python
복사
================================ Human Message ================================= hi! I'm bob 2025-01-14 19:40:32,082 - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" ================================== Ai Message ================================== Hi again, Bob! What would you like to talk about or do today?
YAML
복사
print(chain_config) print(chats_by_session_id)
YAML
복사
fake_session = uuid.uuid4() chain_config2 = { "configurable": { "session_id": "fake_session" } } # Here, let's confirm that the AI remembers our name! input_message = HumanMessage(content="what was my name?") for event in graph.stream({"messages": [input_message]}, chain_config2, stream_mode="values"): event["messages"][-1].pretty_print()
Python
복사
================================ Human Message ================================= what was my name? 2025-01-14 19:40:41,510 - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" ================================== Ai Message ================================== I'm sorry, but I don't have access to personal information about you, including your name.
YAML
복사