mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
Fix type-checker issues with proper type annotations
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import logging
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
from typing import Any, Callable, Dict, List, Mapping, Optional, Union
|
||||
|
||||
from crewai.cli.authentication.utils import TokenManager
|
||||
from crewai.tools import BaseTool
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import logging
|
||||
from typing import Any, Callable, Dict, Optional, Union
|
||||
from typing import Any, Callable, Dict, Mapping, Optional, Union
|
||||
from urllib.parse import urljoin
|
||||
|
||||
import requests
|
||||
@@ -55,8 +55,8 @@ class SSEClient:
|
||||
self.headers = headers or {}
|
||||
self.timeout = timeout
|
||||
self.logger = logging.getLogger(__name__)
|
||||
self._client = None
|
||||
self._response = None
|
||||
self._client: Optional[sseclient.SSEClient] = None
|
||||
self._response: Optional[requests.Response] = None
|
||||
|
||||
def connect(self) -> None:
|
||||
"""Establish a connection to the SSE server."""
|
||||
@@ -93,7 +93,7 @@ class SSEClient:
|
||||
)
|
||||
raise
|
||||
|
||||
def listen(self, event_handlers: Optional[Dict[str, Callable[[Any], None]]] = None) -> None:
|
||||
def listen(self, event_handlers: Optional[Mapping[str, Callable[[Any], None]]] = None) -> None:
|
||||
"""Listen for SSE events and process them with registered handlers.
|
||||
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user