mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
feat: fix type checking issues
This commit is contained in:
@@ -752,7 +752,10 @@ class Flow(Generic[T], metaclass=FlowMeta):
|
|||||||
if inputs is not None and "id" not in inputs:
|
if inputs is not None and "id" not in inputs:
|
||||||
self._initialize_state(inputs)
|
self._initialize_state(inputs)
|
||||||
|
|
||||||
return asyncio.run(self.kickoff_async())
|
async def run_flow():
|
||||||
|
return await self.kickoff_async()
|
||||||
|
|
||||||
|
return asyncio.run(run_flow())
|
||||||
|
|
||||||
@init_flow_main_trace
|
@init_flow_main_trace
|
||||||
async def kickoff_async(self, inputs: Optional[Dict[str, Any]] = None) -> Any:
|
async def kickoff_async(self, inputs: Optional[Dict[str, Any]] = None) -> Any:
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ class LLM:
|
|||||||
self.context_window_size = 0
|
self.context_window_size = 0
|
||||||
self.reasoning_effort = reasoning_effort
|
self.reasoning_effort = reasoning_effort
|
||||||
self.additional_params = kwargs
|
self.additional_params = kwargs
|
||||||
self._message_history = []
|
self._message_history: List[Dict[str, str]] = []
|
||||||
self.is_anthropic = self._is_anthropic_model(model)
|
self.is_anthropic = self._is_anthropic_model(model)
|
||||||
|
|
||||||
litellm.drop_params = True
|
litellm.drop_params = True
|
||||||
@@ -575,7 +575,7 @@ class LLM:
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
if not hasattr(self, "_tool_results_history"):
|
if not hasattr(self, "_tool_results_history"):
|
||||||
self._tool_results_history = []
|
self._tool_results_history: List[Dict] = []
|
||||||
|
|
||||||
new_tool_results = []
|
new_tool_results = []
|
||||||
|
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ class ToolUsage:
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
isinstance(tool, CrewStructuredTool)
|
isinstance(tool, CrewStructuredTool)
|
||||||
and tool.name == self._i18n.tools("add_image")["name"]
|
and tool.name == self._i18n.tools("add_image")["name"] # type: ignore
|
||||||
): # type: ignore
|
):
|
||||||
try:
|
try:
|
||||||
result = self._use(tool_string=tool_string, tool=tool, calling=calling)
|
result = self._use(tool_string=tool_string, tool=tool, calling=calling)
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class UnifiedTraceController:
|
|||||||
and recording of results for various types of operations (LLM calls, tool calls, flow steps).
|
and recording of results for various types of operations (LLM calls, tool calls, flow steps).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
_task_traces: Dict[str, List["UnifiedTraceController"]] = {}
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
trace_type: TraceType,
|
trace_type: TraceType,
|
||||||
@@ -88,8 +90,6 @@ class UnifiedTraceController:
|
|||||||
Returns:
|
Returns:
|
||||||
List of traces associated with the task
|
List of traces associated with the task
|
||||||
"""
|
"""
|
||||||
if not hasattr(cls, "_task_traces"):
|
|
||||||
cls._task_traces = {}
|
|
||||||
return cls._task_traces.get(task_id, [])
|
return cls._task_traces.get(task_id, [])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user