refactor: tool models

This commit is contained in:
Yeuoly
2024-08-30 15:55:10 +08:00
parent 1fa3b9cfd8
commit cf4e9f317e
6 changed files with 60 additions and 48 deletions

View File

@ -1,5 +1,5 @@
import os
from collections.abc import Mapping, Sequence
from collections.abc import Iterable, Mapping
from typing import Any, Optional, TextIO, Union
from pydantic import BaseModel
@ -55,7 +55,7 @@ class DifyAgentCallbackHandler(BaseModel):
self,
tool_name: str,
tool_inputs: Mapping[str, Any],
tool_outputs: Sequence[ToolInvokeMessage],
tool_outputs: Iterable[ToolInvokeMessage] | str,
message_id: Optional[str] = None,
timer: Optional[Any] = None,
trace_manager: Optional[TraceQueueManager] = None