上下文摘要

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': {}})]}

相关推荐
Y幽谷客8 小时前
Python加载本地大模型(Qwen3.5 8B)
python·大模型
伞伞悦读9 小时前
【第36期】Python 目录与路径详解:pathlib、文件遍历、创建、复制、移动和删除风险
开发语言·python
线上放牧人9 小时前
Windows删除图标缓存
windows·python·pyqt
qq_54702617910 小时前
Python 变量和简单数据类型
python
智搜广告11 小时前
智搜广告:科技行业AI回答优化公司如何破局
大数据·python·elasticsearch·geo
IpdataCloud11 小时前
AI智能体调用工具怎么核验来源IP?归属地、网络类型与代理风险识别(含Python代码)
数据库·python·tcp/ip
2601_9669496512 小时前
只拿到股票代码还不够:量化程序到底还需要哪些标的信息?——从数据建模开始理解股票元数据
开发语言·python·数据分析·pandas·量化交易·股票数据·quantdash
蒸鱼Yuzheng12 小时前
Python 游戏测试开发怎么准备:日志解析、接口校验、并发与可维护性
自动化测试·python·测试开发·面试题·游戏测试
Ivanqhz12 小时前
BM1688 双核架构
python·深度学习·神经网络·cnn·mlir
Java后端的Ai之路12 小时前
Python进阶探索17 - Python中的深拷贝与浅拷贝
人工智能·python·ai·浅拷贝·深拷贝