Skip to content

Commit 4fb9d4a

Browse files
committed
Make import top-level
1 parent 76a18cc commit 4fb9d4a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

dash/mcp/primitives/tools/results/result_plotly_figure.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
from typing import Any
88

9+
import plotly.graph_objects as go
910
from mcp.types import ImageContent, TextContent
1011

1112
from dash.mcp.types import MCPOutput
@@ -52,11 +53,6 @@ def format(
5253
if not isinstance(returned_output_value, dict):
5354
return []
5455

55-
try:
56-
import plotly.graph_objects as go
57-
except ImportError:
58-
return []
59-
6056
fig = go.Figure(returned_output_value)
6157
image = _render_image(fig)
6258
return [image] if image is not None else []

0 commit comments

Comments
 (0)