mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
fix fingerprinting issues
This commit is contained in:
@@ -445,3 +445,6 @@ class Agent(BaseAgent):
|
|||||||
Fingerprint: The agent's fingerprint
|
Fingerprint: The agent's fingerprint
|
||||||
"""
|
"""
|
||||||
return self.security_config.fingerprint
|
return self.security_config.fingerprint
|
||||||
|
|
||||||
|
def set_fingerprint(self, fingerprint: Fingerprint):
|
||||||
|
self.security_config.fingerprint = fingerprint
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
from crewai.agents.parser import AgentAction
|
from crewai.agents.parser import AgentAction
|
||||||
|
from crewai.security import Fingerprint
|
||||||
from crewai.tools.structured_tool import CrewStructuredTool
|
from crewai.tools.structured_tool import CrewStructuredTool
|
||||||
from crewai.tools.tool_types import ToolResult
|
from crewai.tools.tool_types import ToolResult
|
||||||
from crewai.tools.tool_usage import ToolUsage, ToolUsageErrorException
|
from crewai.tools.tool_usage import ToolUsage, ToolUsageErrorException
|
||||||
@@ -48,7 +49,15 @@ def execute_tool_and_check_finality(
|
|||||||
if agent_key and agent_role and agent:
|
if agent_key and agent_role and agent:
|
||||||
fingerprint_context = fingerprint_context or {}
|
fingerprint_context = fingerprint_context or {}
|
||||||
if agent:
|
if agent:
|
||||||
agent.fingerprint = fingerprint_context
|
if hasattr(agent, "set_fingerprint") and callable(
|
||||||
|
agent.set_fingerprint
|
||||||
|
):
|
||||||
|
if isinstance(fingerprint_context, dict):
|
||||||
|
try:
|
||||||
|
fingerprint_obj = Fingerprint.from_dict(fingerprint_context)
|
||||||
|
agent.set_fingerprint(fingerprint_obj)
|
||||||
|
except Exception as e:
|
||||||
|
raise ValueError(f"Failed to set fingerprint: {e}")
|
||||||
|
|
||||||
event_data = {
|
event_data = {
|
||||||
"agent_key": agent_key,
|
"agent_key": agent_key,
|
||||||
|
|||||||
Reference in New Issue
Block a user