MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / plot_results

Function plot_results

AskAgent/python/benchmark/run_speed_benchmark.py:223–240  ·  view source on GitHub ↗

Plot results and save to file.

(results, title, filename)

Source from the content-addressed store, hash-verified

221 return multiturn_results
222
223def plot_results(results, title, filename):
224 """Plot results and save to file."""
225 df = pd.DataFrame(results)
226 df = df[df['elapsed'].notnull()]
227 if df.empty:
228 print(f"No successful results to plot for {title}.")
229 return
230 plt.figure(figsize=(10, 6))
231 ax = plt.gca()
232 df.boxplot(column='elapsed', by=['provider'], ax=ax)
233 plt.title(title)
234 plt.suptitle("")
235 plt.ylabel('Elapsed Time (s)')
236 plt.xlabel('Provider')
237 plt.xticks(rotation=45, ha='right')
238 plt.tight_layout()
239 plt.savefig(filename)
240 plt.show()
241
242def plot_total_conversation_time(results, title, filename):
243 """Plot total conversation time per provider and save to file."""

Callers 1

run_benchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected