diff --git a/astrbot/core/agent/runners/base.py b/astrbot/core/agent/runners/base.py index c53bdc0d..21e79643 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 20efdbbd..291699f2 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,