You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.debug(f"Prompt execution successful for '{name}'")
1788
1800
exceptExceptionasex:
1801
+
error_message=str(ex)
1789
1802
logger.error(f"Could not retrieve prompt {name}: {ex}")
1790
1803
ifisinstance(ex, (ValueError, PromptError)):
1791
-
returnJSONResponse(content={"message": "Prompt execution arguments contains HTML tags that may cause security issues"}, status_code=422)
1792
-
ifisinstance(ex, PluginViolationError):
1793
-
returnJSONResponse(content={"message": "Prompt execution arguments contains HTML tags that may cause security issues", "details": ex.message}, status_code=422)
1804
+
result=JSONResponse(content={"message": "Prompt execution arguments contains HTML tags that may cause security issues"}, status_code=422)
1805
+
elifisinstance(ex, PluginViolationError):
1806
+
result=JSONResponse(content={"message": "Prompt execution arguments contains HTML tags that may cause security issues", "details": ex.message}, status_code=422)
1807
+
else:
1808
+
raise
1809
+
1810
+
# Record metrics (moved outside try/except/finally to ensure it runs)
raiseValueError("Cannot manually create MCP tools. Add MCP servers via the Gateways interface - ""tools will be auto-discovered and registered with integration_type='MCP'.")
593
+
raiseValueError("Cannot manually create MCP tools. Add MCP servers via the Gateways interface - tools will be auto-discovered and registered with integration_type='MCP'.")
594
594
returnvalues
595
595
596
596
@@ -2936,3 +2936,26 @@ class TagInfo(BaseModelWithConfigDict):
2936
2936
name: str=Field(..., description="The tag name")
2937
2937
stats: TagStats=Field(..., description="Statistics for this tag")
2938
2938
entities: Optional[List[TaggedEntity]] =Field(default_factory=list, description="Entities that have this tag")
2939
+
2940
+
2941
+
classTopPerformer(BaseModelWithConfigDict):
2942
+
"""Schema for representing top-performing entities with performance metrics.
2943
+
2944
+
Used to encapsulate metrics for entities such as prompts, resources, servers, or tools,
2945
+
including execution count, average response time, success rate, and last execution timestamp.
2946
+
2947
+
Attributes:
2948
+
id (Union[str, int]): Unique identifier for the entity.
2949
+
name (str): Name of the entity (e.g., prompt name, resource URI, server name, or tool name).
2950
+
execution_count (int): Total number of executions for the entity.
2951
+
avg_response_time (Optional[float]): Average response time in seconds, or None if no metrics.
2952
+
success_rate (Optional[float]): Success rate percentage, or None if no metrics.
2953
+
last_execution (Optional[datetime]): Timestamp of the last execution, or None if no metrics.
0 commit comments