mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-12 05:52:39 +00:00
fix: mypy errors in streaming.py and core.py
This commit is contained in:
@@ -1013,7 +1013,7 @@ class Agent(BaseAgent):
|
||||
task=task,
|
||||
i18n=self.i18n,
|
||||
agent=self,
|
||||
crew=self.crew, # type: ignore[arg-type]
|
||||
crew=self.crew,
|
||||
tools=parsed_tools,
|
||||
prompt=prompt,
|
||||
original_tools=raw_tools,
|
||||
@@ -1075,7 +1075,7 @@ class Agent(BaseAgent):
|
||||
self.agent_executor.tools_handler = self.tools_handler
|
||||
self.agent_executor.request_within_rpm_limit = rpm_limit_fn
|
||||
|
||||
if self.agent_executor.llm:
|
||||
if isinstance(self.agent_executor.llm, BaseLLM):
|
||||
existing_stop = getattr(self.agent_executor.llm, "stop", [])
|
||||
self.agent_executor.llm.stop = list(
|
||||
set(
|
||||
|
||||
@@ -142,8 +142,8 @@ def _unregister_handler(handler: Callable[[Any, BaseEvent], None]) -> None:
|
||||
handler: The handler function to unregister.
|
||||
"""
|
||||
with crewai_event_bus._rwlock.w_locked():
|
||||
handlers: frozenset[Callable[[Any, BaseEvent], None]] = (
|
||||
crewai_event_bus._sync_handlers.get(LLMStreamChunkEvent, frozenset())
|
||||
handlers: frozenset[Callable[..., None]] = crewai_event_bus._sync_handlers.get(
|
||||
LLMStreamChunkEvent, frozenset()
|
||||
)
|
||||
crewai_event_bus._sync_handlers[LLMStreamChunkEvent] = handlers - {handler}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user