This is an automated email from the ASF dual-hosted git repository. sxnan pushed a commit to branch release-0.1 in repository https://gitbox.apache.org/repos/asf/flink-agents.git
commit c95b71844450b5263b652fe1f8abd493392745e1 Author: sxnan <[email protected]> AuthorDate: Mon Oct 13 14:15:19 2025 +0800 [hotfix] Always include assistant message after prompt applied --- python/flink_agents/api/chat_models/chat_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/flink_agents/api/chat_models/chat_model.py b/python/flink_agents/api/chat_models/chat_model.py index 09c2f39..5a0671a 100644 --- a/python/flink_agents/api/chat_models/chat_model.py +++ b/python/flink_agents/api/chat_models/chat_model.py @@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Sequence, Tuple from pydantic import Field from typing_extensions import override -from flink_agents.api.chat_message import ChatMessage +from flink_agents.api.chat_message import ChatMessage, MessageRole from flink_agents.api.prompts.prompt import Prompt from flink_agents.api.resource import Resource, ResourceType from flink_agents.api.tools.tool import Tool @@ -190,7 +190,7 @@ class BaseChatModelSetup(Resource): # append meaningful messages for msg in messages: - if msg.content is not None and msg.content != "": + if (msg.content is not None and msg.content != "") or msg.role == MessageRole.ASSISTANT: prompt_messages.append(msg) messages = prompt_messages # Bind tools
