上下文摘要

befor_model_state: {'messages': [

HumanMessage(content='我叫张三,你是谁?"', additional_kwargs={}, response_metadata={}, id='f9bc8518-e8f5-4900-8840-10f578815278'),

AIMessage(content='你好!我是你的用户信息管理助手。我可以帮你获取和更新用户信息,也可以为你提供天气查询等帮助。\n\n张三,请问有什么我可以帮你的吗?比如你想查询或更新你的信息,或者需要了解其他方面的情况?',

HumanMessage(content='今天北京天气怎么样', additional_kwargs={}, response_metadata={}, id='262d514f-a59f-4f69-b540-d75b8d1b96db'),

AIMessage(content='好的,我来帮你查一下今天北京的天气情况。',

ToolMessage(content='北京的天气是晴天', name='get_weather', id='9f7bf2c5-2f28-4a90-91d5-4df0591eaaec', tool_call_id='call_00_acFewPFOkwUkfF71ITm9K218')]}

after_model_state: {'messages': [HumanMessage(content='Here is a summary of the conversation to date:\n\n根据对话内容,总结如下:\n\n- 用户自我介绍为"张三",AI确认自己为"用户信息管理助手",能够提供用户信息查询、更新及其他帮助(如天气查询)。\n- 用户随后询问"今天北京天气怎么样",表明需要天气查询服务。', additional_kwargs={'lc_source': 'summarization'}, response_metadata={}, id='cc49bb72-d010-4e6d-9055-f00f10e63fc5'),

AIMessage(content='好的,我来帮你查一下今天北京的天气情况。', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 54, 'prompt_tokens': 366, 'total_tokens': 420, 'completion_tokens_details': None, 'prompt_tokens_details': {'audio_tokens': None, 'cached_tokens': 256}, 'prompt_cache_hit_tokens': 256, 'prompt_cache_miss_tokens': 110}, 'model_provider': 'deepseek', 'model_name': 'deepseek-v4-flash', 'system_fingerprint': 'fp_058df29938_prod0820_fp8_kvcache_20260402', 'id': '1f036914-cf01-4eca-ac03-58331bd5f6ab', 'finish_reason': 'tool_calls', 'logprobs': None}, id='lc_run--019dd412-cb77-7120-b2e5-40832e854718-0', tool_calls={'name': 'get_weather', 'args': {'city': '北京'}, 'id': 'call_00_acFewPFOkwUkfF71ITm9K218', 'type': 'tool_call'}, invalid_tool_calls=\[\], usage_metadata={'input_tokens': 366, 'output_tokens': 54, 'total_tokens': 420, 'input_token_details': {'cache_read': 256}, 'output_token_details': {}}),

ToolMessage(content='北京的天气是晴天', name='get_weather', id='9f7bf2c5-2f28-4a90-91d5-4df0591eaaec', tool_call_id='call_00_acFewPFOkwUkfF71ITm9K218'),

AIMessage(content='今天北京的天气是 **晴天** ☀️,天气不错哦!适合出门活动。\n\n请问还有其他需要帮忙的吗?比如查询用户信息、更新信息或者其他方面的帮助?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 36, 'prompt_tokens': 440, 'total_tokens': 476, 'completion_tokens_details': None, 'prompt_tokens_details': {'audio_tokens': None, 'cached_tokens': 256}, 'prompt_cache_hit_tokens': 256, 'prompt_cache_miss_tokens': 184}, 'model_provider': 'deepseek', 'model_name': 'deepseek-v4-flash', 'system_fingerprint': 'fp_058df29938_prod0820_fp8_kvcache_20260402', 'id': '468f4e74-42aa-4380-a07c-d587be40c085', 'finish_reason': 'stop', 'logprobs': None}, id='lc_run--019dd412-d600-7172-b59a-6b2c4f3c7d64-0', tool_calls=\[\], invalid_tool_calls=\[\], usage_metadata={'input_tokens': 440, 'output_tokens': 36, 'total_tokens': 476, 'input_token_details': {'cache_read': 256}, 'output_token_details': {}})]}

相关推荐
世辰辰辰3 小时前
批量修改图片/文本名子
开发语言·python·批量修改文件名
myenjoy_15 小时前
MQTT 与 Sparkplug B——从车间到云端的最后一公里
网络·python
颜酱6 小时前
LangChain 输出解析器:把模型回复变成你要的数据
python·langchain
2401_873479406 小时前
企业安全运营中,如何用IP离线库提前发现失陷主机?三步实现风险画像
网络·数据库·python·tcp/ip·ip
weixin_523185327 小时前
Java基础知识总结(四):引用数据类型与参数传递机制
java·开发语言·python
码农飞哥7 小时前
我把RAG召回率从60%提到90%,就改了这两件事
python·知识库·向量检索·rag·效果提示
宸津-代码粉碎机7 小时前
Spring AI企业级实战|从RAG优化到Agent多工具调度
java·大数据·人工智能·后端·python·spring
yuhuofei20217 小时前
【Python入门】Python中的字典dict
python
Jinkxs8 小时前
Python基础 - 文件的写入操作 write与writelines方法
android·服务器·python
初学Python的小明8 小时前
Python格式化输出、运算符、分支&循环
python