Skip to content

Commit 3ee4b5f

Browse files
committed
test(live): add live_test_explanations for real API-based explainer run with Groq and OpenAI models
1 parent 8d6dc8e commit 3ee4b5f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from plotsense.explanations.explanations import explainer
2+
from matplotlib import pyplot as plt
3+
4+
# Example: generate a simple plot
5+
fig, ax = plt.subplots()
6+
ax.plot([1, 2, 3], [4, 5, 6])
7+
8+
# Replace with your actual API keys
9+
api_keys = {
10+
"groq": "gsk_xyz",
11+
"openai": "sk-proj-xyz-abc"
12+
}
13+
14+
# Run explainer
15+
result = explainer(
16+
fig,
17+
prompt="Explain this simple line plot",
18+
api_keys=api_keys,
19+
selected_models=[("openai", "gpt-4.1")],
20+
)
21+
print(result)
22+

0 commit comments

Comments
 (0)