From 66b3eed273123f1ad2ad1daad0dec2cc8722ea59 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 24 Nov 2025 00:03:22 +0800 Subject: [PATCH] fix: correct typo in agent state transition log message --- astrbot/core/agent/runners/base.py | 2 +- astrbot/core/utils/dify_api_client.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/astrbot/core/agent/runners/base.py b/astrbot/core/agent/runners/base.py index c53bdc0dc..21e796433 100644 --- a/astrbot/core/agent/runners/base.py +++ b/astrbot/core/agent/runners/base.py @@ -61,5 +61,5 @@ class BaseAgentRunner(T.Generic[TContext]): def _transition_state(self, new_state: AgentState) -> None: """Transition the agent state.""" if self._state != new_state: - logger.debug(f"Dify Agent state transition: {self._state} -> {new_state}") + logger.debug(f"Agent state transition: {self._state} -> {new_state}") self._state = new_state diff --git a/astrbot/core/utils/dify_api_client.py b/astrbot/core/utils/dify_api_client.py index 20efdbbd0..291699f2e 100644 --- a/astrbot/core/utils/dify_api_client.py +++ b/astrbot/core/utils/dify_api_client.py @@ -1,4 +1,5 @@ import codecs +import io import json from collections.abc import AsyncGenerator from typing import Any @@ -108,9 +109,10 @@ class DifyAPIClient: url = f"{self.api_base}/files/upload" if file_data is not None: + io_data = io.BytesIO(file_data) payload = { "user": user, - "file": file_data, + "file": io_data, } async with self.session.post( url,