Skip to content

Commit ac92325

Browse files
committed
fix
1 parent b619b19 commit ac92325

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

python/flink_agents/plan/actions/chat_model_action.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ async def _process_tool_response(event: ToolResponseEvent, ctx: RunnerContext) -
251251
initial_request_id = tool_request_event_context["initial_request_id"]
252252

253253
# update tool call context, and get the entire chat messages.
254-
print(f"RequestId: {request_id}, Initial request_id: {initial_request_id}")
255254
messages = _update_tool_call_context(
256255
sensory_memory,
257256
initial_request_id,
@@ -286,6 +285,8 @@ async def process_chat_request_or_tool_response(
286285
the complete chat flow including tool calls. It uses sensory memory to save
287286
the tool call context, which is a dict mapping request id to chat messages.
288287
"""
288+
# To avoid https://github.com/alibaba/pemja/issues/88, we log a message here.
289+
logging.debug("Processing chat request asynchronously.")
289290
if isinstance(event, ChatRequestEvent):
290291
await _process_chat_request(event, ctx)
291292
elif isinstance(event, ToolResponseEvent):

python/flink_agents/plan/actions/context_retrieval_action.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#################################################################################
18+
import logging
19+
1820
from flink_agents.api.core_options import AgentExecutionOptions
1921
from flink_agents.api.events.context_retrieval_event import (
2022
ContextRetrievalRequestEvent,
@@ -27,6 +29,7 @@
2729
from flink_agents.plan.actions.action import Action
2830
from flink_agents.plan.function import PythonFunction
2931

32+
_logger = logging.getLogger(__name__)
3033

3134
async def process_context_retrieval_request(event: Event, ctx: RunnerContext) -> None:
3235
"""Built-in action for processing context retrieval requests."""
@@ -37,6 +40,9 @@ async def process_context_retrieval_request(event: Event, ctx: RunnerContext) ->
3740

3841
rag_async = ctx.config.get(AgentExecutionOptions.RAG_ASYNC)
3942
if rag_async:
43+
# To avoid https://github.com/alibaba/pemja/issues/88,
44+
# we log a message here.
45+
_logger.debug("Processing context retrieval asynchronously.")
4046
result = await ctx.execute_async(vector_store.query, query)
4147
else:
4248
result = vector_store.query(query)

python/flink_agents/plan/actions/tool_call_action.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#################################################################################
18+
import logging
1819

1920
from flink_agents.api.core_options import AgentExecutionOptions
2021
from flink_agents.api.events.tool_event import ToolRequestEvent, ToolResponseEvent
@@ -23,11 +24,16 @@
2324
from flink_agents.plan.actions.action import Action
2425
from flink_agents.plan.function import PythonFunction
2526

27+
_logger = logging.getLogger(__name__)
2628

2729
async def process_tool_request(event: ToolRequestEvent, ctx: RunnerContext) -> None:
2830
"""Built-in action for processing tool call requests."""
2931
tool_call_async = ctx.config.get(AgentExecutionOptions.TOOL_CALL_ASYNC)
3032

33+
if tool_call_async:
34+
# To avoid https://github.com/alibaba/pemja/issues/88, we log a message here.
35+
_logger.debug("Processing tool call asynchronously.")
36+
3137
responses = {}
3238
external_ids = {}
3339
for tool_call in event.tool_calls:

0 commit comments

Comments
 (0)