fix: make chart iframes responsive and extract iframe helper
Nolan Zandi+1: Claude Sonnet 4.6
b9b70e3
Replace 10 copies of hardcoded pio.write_html + 1000px iframe string
with a single _write_chart(fig, path, url) helper that writes the file
with config={'responsive':True} and returns width:100% / min-width:400px
iframe HTML. Charts now fill the available chat width on any screen size
and redraw when the container resizes instead of overflowing at 1000px.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add rolling stats, K-Means clustering, and hypothesis testing
Nolan Zandi+1: Claude Sonnet 4.6
7afc8ec
- Add rolling_stats_func: overlays rolling mean/std/min/max on a time
series using plotly.graph_objects; supports optional category grouping
- Add kmeans_clustering_func: StandardScaler + KMeans (sklearn), scatter
plot coloured by cluster, centroid summary table
- Add hypothesis_test_func: independent/one-sample t-test (scipy) and
chi-square test of independence; returns styled HTML results table
- Register all three in tool schemas, __init__.py, available_functions,
and system message; add scipy and scikit-learn to requirements.txt
- Refactor chart_tools.py: extract _LAYOUT_PARAM and _TRACE_STYLE_PARAM
constants to eliminate ~8x copy-paste; remove layout from required
arrays on line/bar/pie; fix hardcoded 'SQLite' references; standardise
all tool descriptions to consistent what/when/returns format
- Refactor stats_tools.py: same description standardisation
- Shorten tools_desc in system message from 13 lines to 2 sentences
(LLM already receives full schema descriptions…
feat: add box plot, correlation heatmap, and descriptive statistics
Nolan Zandi+1: Claude Sonnet 4.6
c007902
New analysis functions:
- box_chart_generation_func: distribution and outlier visualisation,
optional x-axis grouping and colour category (px.box)
- correlation_heatmap_func: pairwise Pearson correlation heatmap for
numeric columns using RdBu_r scale (px.imshow); defaults to all
numeric columns if none specified
- descriptive_stats_func: inline summary statistics table (count, mean,
std, min, 25/50/75%, max) styled to match the app theme
Supporting changes:
- Tool schemas added to chart_tools.py and stats_tools.py
- All three functions exported from functions/__init__.py
- All three wired into available_functions in chatbot_func
- system_message refactored: removed repetition across 4 data-source
variants via shared tools_desc string; fixed longstanding bug where
bar_chart_generation_func was referred to as line_chart_generation_func
in the doc_db and graphql system prompts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: replace LFS-tracked CSV with a plain 100K-row sample
Nolan Zandi+1: Claude Sonnet 4.6
ad72587
LFS was silently serving the pointer file to HF Spaces instead of the
actual data, leaving the online_retail_data.csv unqueryable. Root cause:
HF Spaces does not reliably pull LFS objects for Space repos.
Changes:
- Replace 541K-row 45MB CSV with a random 100K-row 8.56MB sample;
retains full column set and date range, sufficient for all demos
- Remove samples/online_retail_data.csv from LFS tracking in .gitattributes
- Clean up historical-file-specific LFS entries from .gitattributes added
by the earlier lfs migrate (data_file.zip, data_source.db, etc.) since
those files no longer exist in the tree
- Also includes: table_generation_func now renders inline HTML in the
chat message instead of an iframe, adapting naturally to any screen width
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: user-supplied API keys, model selector, and Anthropic support
Nolan Zandi+1: Claude Sonnet 4.6
4ac9bc4
- Replace hardwired OpenAI key with a per-session API key form at the top
of the UI; key is stored in memory only and cleared on page unload
- Add model dropdown that dynamically switches between OpenAI and Anthropic
model lists based on detected key prefix (sk-ant- vs sk-)
- Add anthropic-haystack dependency for AnthropicChatGenerator support
- Refactor tools/chart_tools.py, tools/stats_tools.py, and tools/tools.py
to use Haystack's provider-agnostic Tool class instead of raw OpenAI-format
dicts, enabling tool calling to work with both OpenAI and Anthropic models
- Fix invalid JSON Schema (items field on non-array properties) in tool
parameter definitions for stricter Anthropic compatibility
- Pass tools via tools= parameter to chat_generator.run() rather than
generation_kwargs so both generators handle format conversion natively
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
updates to queries and tools for fewer errors
Nolan Zandi
0fe0734
fix logging issue
Nolan Zandi
d41f4b9
condense query functions
Nolan Zandi
9dfb507
add column names to csv query
Nolan Zandi
0dae19c
enhance llm understanding of query.csv
Nolan Zandi
88af3ed
refactor example question generator
Nolan Zandi
4ad19e8
refactor chat functions
Nolan Zandi
b1d71ae
add secondary query function
Nolan Zandi
be3a88a
first version of graphql integration
Nolan Zandi
f907f2a
add fields to file upload
Nolan Zandi
d4e0ede
integration mongodb
Nolan Zandi
18b1006
update accurancy and bugfixes from refactor
Nolan Zandi
5eccb65
review updates
Nolan Zandi
35107b6
first draft of sql integration
Nolan Zandi
8310dd0
more refactor updates
Nolan Zandi
8a82b49
refactor and visual updates
Nolan Zandi
a7f0a50
fixes for generation
Nolan Zandi
72e02e3
increase the query limit
Nolan Zandi
0308ade
add bubble chart
Nolan Zandi
c82c5cb
bugfixes and layout updates
Nolan Zandi
2640847
new functions for charts
Nolan Zandi
21b2bc8
remove type from chart generation
Nolan Zandi
9da1136
upload error messaging
Nolan Zandi
a970f6c
update table function to use query.csv
Nolan Zandi
6892ba8
updates for refactor
Nolan Zandi
9d1e82a
fix bug when no options
Nolan Zandi
b09c5bc
update prompt fixes
Nolan Zandi
2107b3d
refactoring functions for large queries
Nolan Zandi
eb04348
first version of regressions
Nolan Zandi
d263b50
update prompt
Nolan Zandi
1ea8959
fix for data lists
Nolan Zandi
7fa0309
updates to chart generation
Nolan Zandi
4865a6a
remove pipeline functions from chat
Nolan Zandi
8d7dccc
refactoring our code and adding updates to functions to make them more accurate
Nolan Zandi
a0b8cd8
adjustments to linking system
Nolan Zandi
8b3aed5
target blank on csv generation
Nolan Zandi
794f088
updates for link generation
Nolan Zandi
12f707e
add table generation and download
Nolan Zandi
fd47936
fix issue with mixing conversations between sessions