mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-01 07:13:00 +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,
|
task=task,
|
||||||
i18n=self.i18n,
|
i18n=self.i18n,
|
||||||
agent=self,
|
agent=self,
|
||||||
crew=self.crew, # type: ignore[arg-type]
|
crew=self.crew,
|
||||||
tools=parsed_tools,
|
tools=parsed_tools,
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
original_tools=raw_tools,
|
original_tools=raw_tools,
|
||||||
@@ -1075,7 +1075,7 @@ class Agent(BaseAgent):
|
|||||||
self.agent_executor.tools_handler = self.tools_handler
|
self.agent_executor.tools_handler = self.tools_handler
|
||||||
self.agent_executor.request_within_rpm_limit = rpm_limit_fn
|
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", [])
|
existing_stop = getattr(self.agent_executor.llm, "stop", [])
|
||||||
self.agent_executor.llm.stop = list(
|
self.agent_executor.llm.stop = list(
|
||||||
set(
|
set(
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ def _unregister_handler(handler: Callable[[Any, BaseEvent], None]) -> None:
|
|||||||
handler: The handler function to unregister.
|
handler: The handler function to unregister.
|
||||||
"""
|
"""
|
||||||
with crewai_event_bus._rwlock.w_locked():
|
with crewai_event_bus._rwlock.w_locked():
|
||||||
handlers: frozenset[Callable[[Any, BaseEvent], None]] = (
|
handlers: frozenset[Callable[..., None]] = crewai_event_bus._sync_handlers.get(
|
||||||
crewai_event_bus._sync_handlers.get(LLMStreamChunkEvent, frozenset())
|
LLMStreamChunkEvent, frozenset()
|
||||||
)
|
)
|
||||||
crewai_event_bus._sync_handlers[LLMStreamChunkEvent] = handlers - {handler}
|
crewai_event_bus._sync_handlers[LLMStreamChunkEvent] = handlers - {handler}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user