diff --git a/python/src/multi_agent_orchestrator/agents/agent.py b/python/src/multi_agent_orchestrator/agents/agent.py index 93ec3b83..4215a6e9 100644 --- a/python/src/multi_agent_orchestrator/agents/agent.py +++ b/python/src/multi_agent_orchestrator/agents/agent.py @@ -12,7 +12,7 @@ class AgentProcessingResult: agent_name: str user_id: str session_id: str - additional_params: Dict[str, any] = field(default_factory=dict) + additional_params: Dict[str, Any] = field(default_factory=dict) @dataclass @@ -76,7 +76,7 @@ async def process_request( session_id: str, chat_history: List[ConversationMessage], additional_params: Optional[Dict[str, str]] = None, - ) -> Union[ConversationMessage, AsyncIterable[any]]: + ) -> Union[ConversationMessage, AsyncIterable[Any]]: pass def log_debug(self, class_name, message, data=None): diff --git a/python/src/multi_agent_orchestrator/agents/chain_agent.py b/python/src/multi_agent_orchestrator/agents/chain_agent.py index ac8dee98..a008aa3e 100644 --- a/python/src/multi_agent_orchestrator/agents/chain_agent.py +++ b/python/src/multi_agent_orchestrator/agents/chain_agent.py @@ -1,4 +1,4 @@ -from typing import List, Dict, Union, AsyncIterable, Optional +from typing import List, Dict, Union, AsyncIterable, Optional, Any from multi_agent_orchestrator.types import ConversationMessage, ParticipantRole from multi_agent_orchestrator.utils.logger import Logger from .agent import Agent, AgentOptions @@ -24,9 +24,9 @@ async def process_request( session_id: str, chat_history: List[ConversationMessage], additional_params: Optional[Dict[str, str]] = None - ) -> Union[ConversationMessage, AsyncIterable[any]]: + ) -> Union[ConversationMessage, AsyncIterable[Any]]: current_input = input_text - final_response: Union[ConversationMessage, AsyncIterable[any]] + final_response: Union[ConversationMessage, AsyncIterable[Any]] for i, agent in enumerate(self.agents): is_last_agent = i == len(self.agents) - 1 @@ -67,11 +67,11 @@ async def process_request( return final_response @staticmethod - def is_async_iterable(obj: any) -> bool: + def is_async_iterable(obj: Any) -> bool: return hasattr(obj, '__aiter__') @staticmethod - def is_conversation_message(response: any) -> bool: + def is_conversation_message(response: Any) -> bool: return ( isinstance(response, ConversationMessage) and hasattr(response, 'role') and diff --git a/python/src/multi_agent_orchestrator/retrievers/retriever.py b/python/src/multi_agent_orchestrator/retrievers/retriever.py index d9bbff8d..62465c17 100644 --- a/python/src/multi_agent_orchestrator/retrievers/retriever.py +++ b/python/src/multi_agent_orchestrator/retrievers/retriever.py @@ -1,3 +1,4 @@ +from typing import Any from abc import ABC, abstractmethod class Retriever(ABC): @@ -16,7 +17,7 @@ def __init__(self, options: dict): self._options = options @abstractmethod - async def retrieve(self, text: str) -> any: + async def retrieve(self, text: str) -> Any: """ Abstract method for retrieving information based on input text. This method must be implemented by all concrete subclasses. @@ -25,12 +26,12 @@ async def retrieve(self, text: str) -> any: text (str): The input text to base the retrieval on. Returns: - any: The retrieved information. + Any: The retrieved information. """ pass @abstractmethod - async def retrieve_and_combine_results(self, text: str) -> any: + async def retrieve_and_combine_results(self, text: str) -> Any: """ Abstract method for retrieving information and combining results. This method must be implemented by all concrete subclasses. @@ -40,12 +41,12 @@ async def retrieve_and_combine_results(self, text: str) -> any: text (str): The input text to base the retrieval on. Returns: - any: The combined retrieval results. + Any: The combined retrieval results. """ pass @abstractmethod - async def retrieve_and_generate(self, text: str) -> any: + async def retrieve_and_generate(self, text: str) -> Any: """ Abstract method for retrieving information and generating something based on the results. This method must be implemented by all concrete subclasses. @@ -55,6 +56,6 @@ async def retrieve_and_generate(self, text: str) -> any: text (str): The input text to base the retrieval on. Returns: - any: The generated information based on retrieval results. + Any: The generated information based on retrieval results. """ pass \ No newline at end of file