Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
545 commits
Select commit Hold shift + click to select a range
5af72ce
feat: add range, domain for channels & color scheme selection (#171)
islxyqwe Sep 27, 2023
40cb4ee
feat: optimize map color scheme
ObservedObserver Sep 28, 2023
ba11b8e
Feat delete chart (#172)
islxyqwe Sep 28, 2023
79c0f94
fix: analytic type transform bug (#175)
ObservedObserver Sep 29, 2023
85eb2c3
Feat fold new (#174)
islxyqwe Sep 29, 2023
12089ea
release: 0.4.7
ObservedObserver Sep 29, 2023
40d8459
fix: remove initial primary color (#178)
islxyqwe Oct 6, 2023
43c0ae3
fix: themeConfig type & form re-design
ObservedObserver Oct 7, 2023
11348ab
design: fix form design in light
ObservedObserver Oct 7, 2023
9f0ff2d
Fix: pure renderer props (#182)
islxyqwe Oct 8, 2023
947824c
feat: change temporal range (#183)
islxyqwe Oct 8, 2023
0a0f613
feat: export function to mod filter (#184)
islxyqwe Oct 9, 2023
282a84a
release: 0.4.20
ObservedObserver Oct 9, 2023
80224fe
Refactor: split dataSource from graphic walker (#149)
islxyqwe Oct 10, 2023
477786f
fix: make eaiser to import old format data (#185)
islxyqwe Oct 10, 2023
c0fb197
fix: make map center effective (#188)
islxyqwe Oct 13, 2023
a663e91
fix: facet issue (#187)
islxyqwe Oct 18, 2023
150e492
feat: pivot sorting (#191)
islxyqwe Oct 18, 2023
90fccd9
fix: computed field with filter (#192)
islxyqwe Oct 19, 2023
33181bf
release: 0.4.21 (#194)
ObservedObserver Oct 21, 2023
7725826
feat: add gog lint (#195)
ObservedObserver Oct 21, 2023
6b596a2
feat: add new dataset (#197)
ObservedObserver Oct 21, 2023
307033b
fix: timeout img not working (#200)
islxyqwe Oct 27, 2023
87bba87
release: 0.4.22 (#202)
ObservedObserver Oct 27, 2023
74ce5b9
fix: add report compuation error (#199)
islxyqwe Oct 27, 2023
17108d2
fix: pure renderer pivot table (#204)
islxyqwe Oct 30, 2023
a5eae83
fix: map mark with color, size, opacity scales (#203)
islxyqwe Oct 30, 2023
72f7f8a
chore: control VizEmbedMenu in GLBOAL_CONFIG (#205)
islxyqwe Oct 30, 2023
dcbbe5c
Feat export filter mod (#198)
islxyqwe Oct 31, 2023
adda99a
doc: fix typo (#206)
bilalmirza74 Oct 31, 2023
9d6b368
doc: typo fix (#207)
sudhanshu-77 Oct 31, 2023
0cc3aa6
feat: add pagination for table (#208)
ObservedObserver Nov 1, 2023
1f4e714
release: 0.4.23 (#209)
ObservedObserver Nov 1, 2023
2e65da2
feat: add Sorting & Filter for DataTable (#212)
islxyqwe Nov 3, 2023
ebde187
release: 0.4.24 (#214)
ObservedObserver Nov 3, 2023
b35c266
chore: make sidebar resizeable (#217)
islxyqwe Nov 3, 2023
b6bdb48
feat: field hover full name (#215)
ObservedObserver Nov 3, 2023
d5f9447
Feat: export table as Component (#211)
islxyqwe Nov 3, 2023
e0e3c6c
feat: add Geom View (#216)
islxyqwe Nov 3, 2023
0a9ab4b
release: 0.4.25 (#218)
ObservedObserver Nov 3, 2023
d75da14
optimize: dataTable optimize (#223)
islxyqwe Nov 8, 2023
b55a0de
fix: pure-renderer size (#221)
islxyqwe Nov 8, 2023
82fd46f
fix: fix date picker with timezone (#220)
islxyqwe Nov 8, 2023
605e526
fix: dnd issue in containing block (#225)
islxyqwe Nov 10, 2023
c2c7f1e
feat: filter Edit dialog optimize (#224)
islxyqwe Nov 10, 2023
320e9a7
feat: filter with agg (#219)
islxyqwe Nov 10, 2023
19ba04b
fix: not in with aggeration filter (#226)
islxyqwe Nov 10, 2023
75a9666
release: 0.4.27 (#227)
ObservedObserver Nov 10, 2023
545233d
fix: dragging count field to left side is broken (#230)
islxyqwe Nov 13, 2023
fa794e1
chore: add dark mode support for map (#229)
islxyqwe Nov 13, 2023
900c277
fix: graphic walker chart scroll (#228)
islxyqwe Nov 13, 2023
7e392eb
fix: remove duplication aggerations in workflow (#231)
islxyqwe Nov 13, 2023
dfbc316
release: 0.4.28 (#233)
ObservedObserver Nov 13, 2023
7f0698d
feat: add feedback for askviz (#234)
islxyqwe Nov 14, 2023
1ccff83
release: 0.4.29 (#235)
ObservedObserver Nov 14, 2023
f3d8973
chore: change distinct count logic (#236)
islxyqwe Nov 15, 2023
d51ff51
release: 0.4.30 (#237)
ObservedObserver Nov 15, 2023
85f1968
fix: fix tick color with color field (#239)
islxyqwe Nov 16, 2023
4e62a53
chore: add gpt code review (#241)
ObservedObserver Nov 18, 2023
9b0ab21
feat: enhance font style for `Tooltip` and `Callout` (#242)
unimu-cic Nov 23, 2023
53aa4df
feat: improve interaction of Public Datasets selector (#244)
unimu-cic Nov 23, 2023
290d408
fix: missing dep build (#247)
ObservedObserver Nov 23, 2023
798f652
feat: Changes about temporal fields (#232)
islxyqwe Nov 23, 2023
6d9d697
release: 0.4.31 (#248)
ObservedObserver Nov 23, 2023
e85a4a2
feat: export function chart_to_workflow (#252)
islxyqwe Nov 28, 2023
4bca2c3
fix: menu position in modal (#253)
islxyqwe Nov 28, 2023
417fb90
fix: error panel close button (#254)
islxyqwe Nov 29, 2023
fd35242
feat: customing map tile (#255)
islxyqwe Nov 30, 2023
bbf0d0a
chore: add release workflow (#256)
ObservedObserver Nov 30, 2023
f99113f
Chore fix release (#257)
ObservedObserver Nov 30, 2023
0f9b787
chore: bump-version workflow (#258)
ObservedObserver Nov 30, 2023
25b4d83
chore: fix workdir
ObservedObserver Nov 30, 2023
4264739
release: Update graphic-walker to 0.4.33 (#259)
github-actions[bot] Nov 30, 2023
f41dde2
feat: add import and export vega-lite spec (#262)
islxyqwe Dec 5, 2023
55f9417
fix: encode all chars (#264)
islxyqwe Dec 6, 2023
eecb367
feat: add examples in playground (#261)
islxyqwe Dec 6, 2023
c7ae974
release: Update graphic-walker to 0.4.34 (#266)
github-actions[bot] Dec 6, 2023
35d0590
fix: geoconfig panel in darkmode (#267)
islxyqwe Dec 12, 2023
959916a
feat: omit redundant separators (#260)
Leko Dec 12, 2023
2550bb2
feat: export the dataSourceSegment component (#250)
islxyqwe Dec 13, 2023
47c8622
feat: fold fields optimize (#269)
islxyqwe Dec 15, 2023
4e42c23
feat: add data-painter feature (#238)
islxyqwe Dec 19, 2023
e4cdd92
release: Update graphic-walker to 0.4.35 (#271)
github-actions[bot] Dec 19, 2023
5ca21d5
fix: dependecy (#272)
islxyqwe Dec 19, 2023
a3b4595
feat: auto add filter field when erasing (#273)
islxyqwe Dec 20, 2023
087bb90
fix: filter drag issue (#274)
islxyqwe Dec 20, 2023
b2d2b29
release: Update graphic-walker to 0.4.36 (#275)
github-actions[bot] Dec 20, 2023
b86d736
fix: painter dark mode (#276)
islxyqwe Dec 20, 2023
b3bbbd8
release: Update graphic-walker to 0.4.37 (#277)
github-actions[bot] Dec 20, 2023
1888dbc
chore: change default fold value (#278)
islxyqwe Dec 22, 2023
0fd77f5
release: Update graphic-walker to 0.4.38 (#279)
github-actions[bot] Dec 22, 2023
c839128
fix: block empty view workflow (#270)
islxyqwe Dec 29, 2023
fb364cd
fix: add error panel for table (#282)
islxyqwe Dec 29, 2023
d9006ed
release: Update graphic-walker to 0.4.39 (#283)
github-actions[bot] Dec 29, 2023
87e6095
Feat: Add new size mode `container` (#284)
islxyqwe Jan 5, 2024
c5e55ee
feat: add computed field (#280)
islxyqwe Jan 9, 2024
42252c0
release: Update graphic-walker to 0.4.40 (#285)
github-actions[bot] Jan 9, 2024
784b3ac
feat: add nominal support for data painter (#288)
islxyqwe Jan 14, 2024
0c312ed
release: Update graphic-walker to 0.4.41 (#290)
github-actions[bot] Jan 14, 2024
551a14f
chore: fix typo (#287)
Gehbt Jan 17, 2024
e10c34c
fix: aggergation computed field with fold (#292)
islxyqwe Jan 17, 2024
953d07b
feat: painter support multi facets (#291)
islxyqwe Jan 17, 2024
f0eb24e
feat: change component type to override (#293)
islxyqwe Jan 17, 2024
5976b3c
release: Update graphic-walker to 0.4.42 (#294)
github-actions[bot] Jan 17, 2024
17bbc54
fix: fold function (#295)
islxyqwe Jan 17, 2024
8907d35
release: Update graphic-walker to 0.4.43 (#296)
github-actions[bot] Jan 17, 2024
aa94ebb
fix: more semantic icon
ObservedObserver Jan 17, 2024
bc3fc84
feat: Add config to set timezone to displaying chart (#297)
islxyqwe Jan 19, 2024
c27590f
release: Update graphic-walker to 0.4.44 (#298)
github-actions[bot] Jan 19, 2024
af46376
feat: add default config for configuing timezone offset (#301)
islxyqwe Jan 23, 2024
0e9e69f
feat: add search for nominal filter (#300)
islxyqwe Jan 23, 2024
d05701f
release: Update graphic-walker to 0.4.45 (#303)
github-actions[bot] Jan 23, 2024
d9c3fc7
feat: use multi encode editor for detail (#305)
islxyqwe Jan 24, 2024
0d655bb
fix: size issue when pixel ratio is 1(#304) (#306)
islxyqwe Jan 24, 2024
b63aa4b
feat: add component Graphic Renderer (#302)
islxyqwe Jan 24, 2024
59938cc
release: Update graphic-walker to 0.4.46 (#307)
github-actions[bot] Jan 24, 2024
e64748a
Added code for layout formatting in table (#286)
BassCoder2808 Jan 25, 2024
5c3e542
fix: darksource segment darkmode (#308)
islxyqwe Jan 25, 2024
3352e31
fix: renderSpec issue (#310)
islxyqwe Jan 26, 2024
cd0f32e
release: Update graphic-walker to 0.4.47 (#311)
github-actions[bot] Jan 26, 2024
f1183f2
feat: data profiling (#312)
islxyqwe Jan 29, 2024
4d3a79a
release: Update graphic-walker to 0.4.48 (#313)
github-actions[bot] Jan 29, 2024
d6ce381
fix: react vega unnessery renders (#314)
islxyqwe Jan 30, 2024
86022d1
release: Update graphic-walker to 0.4.49 (#315)
github-actions[bot] Jan 30, 2024
86c7231
optimize: resize chart immediately (#316)
islxyqwe Jan 30, 2024
6b32996
fix: limit setting (#317)
islxyqwe Jan 31, 2024
0c01902
release: Update graphic-walker to 0.4.50 (#318)
github-actions[bot] Jan 31, 2024
9c2f00a
fix: boxplot line color in darkmode (#319)
islxyqwe Feb 2, 2024
9eca961
feat: add streamlit theme (#321)
islxyqwe Feb 2, 2024
608104d
fix: leaflet use canvas (#320)
islxyqwe Feb 2, 2024
54da180
release: Update graphic-walker to 0.4.51 (#322)
github-actions[bot] Feb 2, 2024
1a6e87b
feat: Styling change (#323)
islxyqwe Feb 7, 2024
04cdf90
fix: optimize painter (#324)
islxyqwe Feb 7, 2024
c12ac39
release: Update graphic-walker to 0.4.52 (#325)
github-actions[bot] Feb 7, 2024
d769405
fix: painter webgl renderer background color (#326)
islxyqwe Feb 8, 2024
4298f43
fix: lighten OBPill's border color (#327)
islxyqwe Feb 8, 2024
d51ed9c
release: Update graphic-walker to 0.4.53 (#328)
github-actions[bot] Feb 8, 2024
b2ffa8d
doc: update color sample
ObservedObserver Feb 19, 2024
b3cc841
chore: loading style (#331)
islxyqwe Feb 27, 2024
c746574
chore: add examples for tablewalker component (#332)
islxyqwe Feb 27, 2024
abbfd2e
doc: update to latest screenshot
ObservedObserver Feb 27, 2024
6565ce6
fix: facet view container size (#333)
islxyqwe Feb 28, 2024
7caf409
fix: color legend issue with multi view (#334)
islxyqwe Feb 28, 2024
b9cb0ba
fix: sql field highlight replace order (#335)
islxyqwe Mar 1, 2024
6e9d8cf
fix: add filter in data board (#336)
islxyqwe Mar 1, 2024
9e9cb9e
feat: theme builder (#337)
islxyqwe Mar 1, 2024
6aaf7d3
chore: change emit contents (#338)
islxyqwe Mar 4, 2024
ea52b06
release: Update graphic-walker to 0.4.54 (#340)
github-actions[bot] Mar 4, 2024
07c2703
chore: change bin (#339)
islxyqwe Mar 6, 2024
34949be
feat: generate json schema for IChart DSL. (#341)
islxyqwe Mar 6, 2024
6e8898f
release: Update graphic-walker to 0.4.55 (#342)
github-actions[bot] Mar 6, 2024
0892048
feat: clarity for playground
ObservedObserver Mar 11, 2024
c096573
fix: pivot table var number limit (#345)
ObservedObserver Mar 13, 2024
5150f02
feat: chat enhance (#343)
islxyqwe Mar 15, 2024
8d0e869
fix: chart bugs of timeoffset, react-color, background (#346)
islxyqwe Mar 18, 2024
0ace045
release: Update graphic-walker to 0.4.56 (#347)
github-actions[bot] Mar 18, 2024
246fc79
Remove dragId from specs (#348)
islxyqwe Mar 27, 2024
5bfaa78
feat: rename panel (#350)
islxyqwe Mar 27, 2024
509d9b9
feat: add option to show all geoshapes (#349)
islxyqwe Mar 27, 2024
3c88f8a
fix: drag issues and tab issues (#352)
islxyqwe Mar 29, 2024
46468da
refactor: rename props (#353)
islxyqwe Mar 29, 2024
918d324
release: Update graphic-walker to 0.4.57 (#354)
github-actions[bot] Mar 29, 2024
fd3e083
fix: auto facet layout (#355)
islxyqwe Apr 2, 2024
66f5302
chore: format bin with d3format (#356)
islxyqwe Apr 2, 2024
405cdab
fix: file of package.json (#357)
islxyqwe Apr 2, 2024
c2b4ed2
release: Update graphic-walker to 0.4.58 (#358)
github-actions[bot] Apr 2, 2024
bf651f4
fix: scroll issue (#359)
islxyqwe Apr 3, 2024
ce0fd16
release: Update graphic-walker to 0.4.59 (#360)
github-actions[bot] Apr 3, 2024
118fdbe
Fix drag issue when contains same field (#364)
islxyqwe Apr 8, 2024
0391774
feat: add hide-nav config for web use (#365)
islxyqwe Apr 8, 2024
bf43f15
release: Update graphic-walker to 0.4.60 (#366)
github-actions[bot] Apr 8, 2024
48bbb6c
feat: add meta change feature for tableWalker (#368)
islxyqwe Apr 8, 2024
2041c3d
fix: fold menu (#367)
islxyqwe Apr 8, 2024
4642df9
chore: add embed function for bundled cdn dispatch (#369)
islxyqwe Apr 10, 2024
1c7296e
release: Update graphic-walker to 0.4.61 (#370)
github-actions[bot] Apr 10, 2024
1addb5e
chore: ability to change facet chart fixed size (#372)
islxyqwe Apr 12, 2024
44d2823
fix: repeat with null (#371)
islxyqwe Apr 12, 2024
55e38b9
release: Update graphic-walker to 0.4.62 (#373)
github-actions[bot] Apr 12, 2024
33a9ced
fix: width issue when using color and repeat (#375)
islxyqwe Apr 28, 2024
5347f34
feat: new filter context (#374)
islxyqwe Apr 28, 2024
f35ed87
release: Update graphic-walker to 0.4.63 (#376)
github-actions[bot] Apr 28, 2024
8aed8b4
feat: paint with agg (#377)
islxyqwe May 6, 2024
c1bd1ba
fix: cannot edit single facet with agg (#378)
islxyqwe May 7, 2024
55d6412
release: Update graphic-walker to 0.4.64 (#380)
github-actions[bot] May 7, 2024
13a936f
fix: bin paint (#381)
islxyqwe May 8, 2024
2a9f652
fix: pivot table date format (#383)
islxyqwe May 9, 2024
473e40a
release: Update graphic-walker to 0.4.65 (#384)
github-actions[bot] May 9, 2024
83290b3
chore: change toggle color of toolbar to improve visibility (#385)
islxyqwe May 21, 2024
322571c
feat: publish duckdb module (#362)
islxyqwe May 21, 2024
2ee4342
feat: add max width for table cells (#387)
islxyqwe May 26, 2024
a9946e3
fix: show table summary is not reactive in pivot table (#388)
islxyqwe May 26, 2024
35a3d34
feat: add iso year and week feature (#386)
islxyqwe May 26, 2024
1003f4d
release: Update graphic-walker to 0.4.66 (#389)
github-actions[bot] May 27, 2024
25bbd28
feat: modify ui of limit tool (#392)
longxiaofei Jun 19, 2024
b8445a4
fix: error when pureRenderer displaying pivot table (#390)
islxyqwe Jun 19, 2024
d3ea783
chore: add workflow tab in export (#393)
islxyqwe Jun 19, 2024
4db5bc8
release: Update graphic-walker to 0.4.67 (#395)
github-actions[bot] Jun 19, 2024
192979c
feat: add tag flag in profiling computation (#396)
longxiaofei Jun 26, 2024
8677ad6
chore: imporove dataTable when embed (#402)
islxyqwe Jul 5, 2024
a2a5ea1
release: Update graphic-walker to 0.4.68 (#403)
github-actions[bot] Jul 5, 2024
f48ca24
feat: add gallery in playground (#401)
BHznJNs Jul 5, 2024
7d95d70
feat: add table filter ref and example (#407)
islxyqwe Aug 9, 2024
8693ca4
release: Update graphic-walker to 0.4.69 (#408)
github-actions[bot] Aug 9, 2024
02a5190
fix: let the toolbar wrap in lg screen (#409)
islxyqwe Aug 22, 2024
5b5550b
release: Update graphic-walker to 0.4.70 (#410)
github-actions[bot] Aug 23, 2024
15a92cb
fix: geo panel issue (#411)
islxyqwe Aug 26, 2024
774dcaf
fix: fixed size change (#412)
islxyqwe Aug 28, 2024
6e423b2
Update README.zh-CN.md (#406)
mattholy Aug 28, 2024
5693b69
fix: dataTable pagination (#397)
islxyqwe Aug 28, 2024
f3f2512
release: Update graphic-walker to 0.4.71 (#413)
github-actions[bot] Aug 28, 2024
c088f49
Feat setting scale (#416)
islxyqwe Sep 30, 2024
2972123
feat: input enter with ime (#414)
islxyqwe Sep 30, 2024
cbddf29
feat: update charset options (#415)
islxyqwe Sep 30, 2024
2c30918
release: Update graphic-walker to 0.4.72 (#417)
github-actions[bot] Oct 10, 2024
b2466e4
feat: rename spec to workflow (#424)
islxyqwe Nov 6, 2024
93665c6
release: Update graphic-walker to 0.4.73 (#425)
github-actions[bot] Nov 6, 2024
0b1cd94
fix: add missing optional computationTimeout to IRemoteComputationPro…
islxyqwe Mar 6, 2025
d1115d9
release: Update graphic-walker to 0.4.74 (#432)
github-actions[bot] Mar 6, 2025
754288d
chore: background picker input (#434)
islxyqwe Mar 26, 2025
1c7c643
fix: null value of temporal (#437)
islxyqwe May 16, 2025
7982477
release: Update graphic-walker to 0.4.75 (#438)
github-actions[bot] May 16, 2025
7fc03d2
fix: absolute ele cause page hight wrong (#440)
ObservedObserver May 17, 2025
d29a3ea
feat: auto detect uploaded file type (#441)
ObservedObserver May 17, 2025
090ab07
optimize misc config ui (#443)
ObservedObserver May 20, 2025
d6a2c28
Add disabling options for TableWalker (#445)
ObservedObserver May 20, 2025
9b8daf8
Add export chart example (#447)
ObservedObserver May 20, 2025
91063eb
feat: add theme selection (#449)
ObservedObserver May 22, 2025
ce4d687
Fix newOffsetDate handling of zero timestamp (#451)
ObservedObserver May 24, 2025
74d0db0
chore:improve height style (#457)
islxyqwe May 26, 2025
3af37a0
chore: report edited (#454)
islxyqwe May 26, 2025
6eb3170
fix: paint info (#455)
islxyqwe May 26, 2025
cc64c53
fix(theme): ensure text mark visible in dark mode (#459)
ObservedObserver May 29, 2025
f5a2628
chore: hide tab nav (#456)
islxyqwe May 30, 2025
94e5140
fix: use sparse array (#453)
islxyqwe May 30, 2025
6f15b0f
release: Update graphic-walker to 0.4.76 (#458)
github-actions[bot] May 30, 2025
353eeb5
fix: drag issue when dragging into color field cause of scroll contex…
islxyqwe May 30, 2025
d45abb2
feat: select all when have keyword (#461)
islxyqwe May 30, 2025
7e40151
feat: New Chart ObservabkePlot Supported (#463)
ObservedObserver Jun 9, 2025
c14c9ce
fix: warning in boxplot (#473)
islxyqwe Jul 2, 2025
75f4c5f
doc: add runcell
ObservedObserver Jul 3, 2025
1aeb5f3
chore: upgrade node engine
ObservedObserver Aug 27, 2025
9d391f4
chore: add props of hide profiling in the main component (#484)
islxyqwe Sep 10, 2025
d291683
fix: github actions (#485)
islxyqwe Sep 10, 2025
e19d2f9
release: Update graphic-walker to 0.4.77 (#486)
github-actions[bot] Sep 10, 2025
db7d20c
fix: import and export with vega-lite (#489)
islxyqwe Nov 27, 2025
709214f
feat: upgrade to react-19 (#487)
islxyqwe Nov 27, 2025
a4467ca
release: Update graphic-walker to 0.5.0 (#490)
github-actions[bot] Nov 27, 2025
f9c2bd4
Add local Ollama NLP backend for natural-language to SQL computed fields
kkhatke Nov 29, 2025
3d25908
Added Compressed Demo Video
kkhatke Nov 29, 2025
78b38c5
Merge branch 'main' into feature/nlp-custom-field
kkhatke Nov 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ app-dist
.vercel
chartinfo.json
stoinfo_v2.json

__pycache__/
325 changes: 325 additions & 0 deletions PR_DESCRIPTION_FULL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
# Ollama NLP Backend for Custom Computed Fields - Full PR Description

## Overview
This PR adds a complete local LLM-powered backend service for generating SQL expressions for custom computed fields in Graphic Walker using Ollama. The service runs entirely on-premises with no external API dependencies, ensuring privacy, cost-efficiency, and offline capability.

**πŸ“Ή Includes demonstration video: [NLP-Based Compute Field](./packages/nlp-backend/NLP-Based-Compute-Field.mp4)**

## Purpose
Enable users to generate SQL computed field expressions from natural language descriptions using their local Ollama installation, providing a seamless integration between Graphic Walker's UI and local language models.

## Key Features Implemented

### 1. **Natural Language to SQL Conversion**
- Local LLM processing via Ollama integration
- Intelligent prompt engineering for proper SQL generation
- Support for conditional logic (CASE WHEN...THEN...ELSE...END)
- Field-aware SQL expression generation
- Mathematical and arithmetic operations support

### 2. **Advanced SQL Processing**
- **Comprehensive SQL processor** (`sql_processor.py`):
- Markdown and code block removal
- Ollama-specific response pattern cleaning
- Model hallucination detection and filtering
- SQL validation and syntax checking
- Complex expression extraction from mixed content
- Configurable regex patterns for maximum flexibility

### 3. **Robust Service Architecture**
- **Ollama client** (`ollama_client.py`):
- Async/await support for non-blocking operations
- Model availability validation and fallback logic
- Graceful error handling with specific error categorization
- Health checking with timeout protection

- **Service layer** (`ollama_service.py`):
- Request processing with comprehensive logging
- Error categorization (timeout, connection, model, validation errors)
- Detailed request tracking and monitoring

- **Model management** (`model_manager.py`):
- Dynamic model selection and validation
- Fallback model support
- Model availability caching
- Recommended models identification

### 4. **Health Monitoring & Observability**
- **Health monitoring** (`health_monitor.py`):
- Comprehensive startup validation
- Multi-level health checks (connectivity, model availability, performance, resources)
- Health status tracking and history
- Degraded state detection

- **Metrics collection** (`metrics_collector.py`):
- Request metrics tracking (response times, success rates, error types)
- Performance time series data collection
- Request history with filtering
- Detailed performance reports and trend analysis
- Thread-safe metrics collection

- **Monitoring dashboard** (`monitoring_dashboard.py`):
- Real-time metrics aggregation
- Performance trend analysis
- Health status formatting
- Report generation (hourly, daily, weekly)
- Alert system for anomalies

### 5. **Enterprise-Grade Logging**
- **Structured logging** (`logging_config.py`):
- JSON-formatted logs for log aggregation
- Contextual logging with request tracing
- Error categorization and detailed error logging
- Multiple output handlers (console, file)
- Configurable log levels and formats

### 6. **FastAPI Integration**
- **Complete REST API** (`app.py`):
- Text-to-SQL endpoint with model override support
- Detailed SQL generation endpoint with processing info
- Raw SQL response processing endpoint
- Comprehensive health check endpoints
- Service information and model listing endpoints
- Full monitoring dashboard endpoints
- Metrics export endpoints (JSON, Prometheus formats)

## Technical Implementation Details

### API Endpoints

#### Primary Endpoints
- `POST /api/ollama-text2sql` - Basic SQL generation from natural language
- `POST /api/ollama-text2sql/detailed` - SQL generation with detailed processing information
- `POST /api/sql/process` - Process raw SQL responses for testing/debugging

#### Health & Monitoring Endpoints
- `GET /api/health` - Basic health check
- `GET /api/health/detailed` - Comprehensive health status
- `GET /api/health/metrics` - Health metrics and statistics
- `GET /api/health/history` - Recent health check history
- `GET /api/service-info` - Service configuration and status
- `GET /api/models` - Available models from Ollama

#### Monitoring & Analytics Endpoints
- `GET /api/monitoring/dashboard` - Full monitoring dashboard data
- `GET /api/monitoring/real-time` - Real-time metrics
- `GET /api/monitoring/health-status` - Health status for monitoring systems
- `GET /api/monitoring/performance-trends` - Performance trends (configurable period)
- `GET /api/monitoring/report/{report_type}` - Comprehensive reports
- `GET /api/metrics/summary` - Metrics summary
- `GET /api/metrics/export?format=json|prometheus` - Metrics export
- `GET /api/metrics/time-series/{metric_name}` - Time series data
- `GET /api/metrics/requests` - Request history

### Configuration
Environment variables for flexibility:
- `OLLAMA_BASE_URL` - Ollama server URL (default: http://localhost:11434)
- `OLLAMA_MODEL` - Primary model (default: codellama:7b-instruct)
- `OLLAMA_FALLBACK_MODEL` - Fallback model (default: llama3.2:latest)
- `OLLAMA_TIMEOUT` - Request timeout in seconds (default: 90)
- `LOG_LEVEL` - Logging level (default: INFO)
- `LOG_FORMAT` - Log format: json or text (default: json)
- `LOG_FILE` - Optional log file path
- `METRICS_RETENTION_HOURS` - Metrics retention period (default: 24)
- `MAX_POINTS_PER_METRIC` - Maximum metrics data points (default: 10000)

### SQL Processing Pipeline

1. **Input Processing**: Validate and prepare raw response
2. **Markdown Removal**: Strip code blocks and formatting
3. **Ollama Pattern Cleaning**: Remove model-specific response patterns
4. **Whitespace Cleanup**: Normalize formatting and spacing
5. **Validation & Extraction**: Validate SQL keywords and extract core expression
6. **Metadata Generation**: Create processing metadata and complexity estimation

### Error Handling Strategy

**Error Categories:**
- `TIMEOUT_ERROR` - Request exceeded timeout
- `CONNECTION_ERROR` - Cannot connect to Ollama
- `MODEL_ERROR` - Model unavailable or generation failed
- `VALIDATION_ERROR` - Invalid input
- `CONFIGURATION_ERROR` - Configuration issues
- `UNKNOWN_ERROR` - Other errors

**Fallback Mechanism:**
1. Try primary model
2. On failure, automatically attempt fallback model
3. Return error only if both fail

## Files Added

### Core Service Files
- `app.py` - FastAPI application with all endpoints
- `config.py` - Configuration management
- `ollama_client.py` - Ollama integration client
- `ollama_service.py` - Service layer

### Processing & Validation
- `sql_processor.py` - Advanced SQL processing and cleaning
- `model_manager.py` - Model selection and validation

### Monitoring & Observability
- `health_monitor.py` - Health checking and monitoring
- `metrics_collector.py` - Metrics collection and analytics
- `monitoring_dashboard.py` - Dashboard data aggregation
- `logging_config.py` - Structured logging configuration

### Documentation & Configuration
- `requirements.txt` - Python dependencies
- `README.md` - Quick start guide
- `OLLAMA_NLP_BACKEND_GUIDE.md` - Comprehensive guide
- `.env.example` - Environment configuration template

## Dependencies

```
fastapi - Web framework
uvicorn - ASGI server
python-dotenv - Environment configuration
ollama - Ollama Python client
psutil - System resource monitoring
pytest - Testing framework
pytest-asyncio - Async testing
pytest-cov - Coverage reporting
```

## Testing

The implementation includes comprehensive testing capabilities:
- Async operation support with pytest-asyncio
- Mock health checks and model availability
- Edge case handling (empty prompts, malformed responses)
- Error categorization and fallback testing
- Metrics collection validation
- Performance benchmarking support

## Deployment Considerations

### Prerequisites
1. Ollama server running (default: localhost:11434)
2. At least one model pulled (recommended: codellama:7b-instruct)
3. Python 3.8+

### Quick Start
```bash
cd packages/nlp-backend
pip install -r requirements.txt
uvicorn app:app --reload --port 3002
```

### Production Deployment
- Use production ASGI server (Gunicorn + Uvicorn)
- Configure logging to file
- Set up monitoring/alerting
- Use environment variables for configuration
- Implement load balancing if needed

## Performance Characteristics

- **Typical Response Time**: 3-15 seconds (model-dependent)
- **Fallback Logic**: <1 second additional delay
- **Health Check Overhead**: <10ms
- **Metrics Collection**: Lock-based thread-safe implementation
- **Memory Usage**: ~50-200MB base + model size

## Security Considerations

1. **SQL Injection Prevention**:
- Basic pattern detection for dangerous keywords
- User disclaimer for custom expressions
- SQL validation before output

2. **Local Processing**:
- No external API calls
- Data remains on user's infrastructure
- No cloud dependencies

3. **Input Validation**:
- Prompt length checking
- Empty input rejection
- Response validation

## Backward Compatibility
- Service is new, no breaking changes to existing code
- Can be optionally enabled/disabled in UI
- Falls back to manual SQL entry if service unavailable

## Documentation Provided
- Comprehensive setup guide with platform-specific instructions
- API documentation for all endpoints
- Configuration reference
- Usage examples
- Troubleshooting section

## Demonstration

### Video Walkthrough
A comprehensive demonstration of the Ollama NLP Backend for Custom Computed Fields:

<video width="100%" controls>
<source src="./packages/nlp-backend/NLP-Based-Compute-Field.mp4" type="video/mp4">
Your browser does not support the video tag. <a href="./packages/nlp-backend/NLP-Based-Compute-Field.mp4">Download video</a>
</video>

**[πŸ“Ή Download: NLP-Based Compute Field](./packages/nlp-backend/NLP-Based-Compute-Field.mp4)** *(Right-click β†’ Save link as... to download)*

The video covers:
- βœ… Service startup and initialization
- βœ… Health check system in action
- βœ… Natural language to SQL conversion examples
- βœ… Fallback model mechanism
- βœ… Error handling and recovery
- βœ… Monitoring dashboard overview
- βœ… Metrics collection and analysis
- βœ… Real-world usage scenarios

### Example Conversions

**Example 1: Conditional Logic**
```
Prompt: "If revenue > 1000 then High else Low"
Generated SQL: CASE WHEN revenue > 1000 THEN 'High' ELSE 'Low' END
```

**Example 2: Mathematical Operation**
```
Prompt: "Calculate 10% of price"
Generated SQL: price * 0.1
```

**Example 3: Complex Condition**
```
Prompt: "If status is active then Premium else Basic"
Generated SQL: CASE WHEN status = 'active' THEN 'Premium' ELSE 'Basic' END
```

**Example 4: Multi-field Logic**
```
Prompt: "If revenue > cost then profit else loss"
Generated SQL: CASE WHEN revenue > cost THEN 'profit' ELSE 'loss' END
```

## Related Issues
- Enables custom computed fields feature in Graphic Walker
- Provides foundation for AI-powered UI enhancements

## Testing Checklist
- βœ… Service startup and initialization
- βœ… Health check endpoints
- βœ… Basic SQL generation
- βœ… Model fallback on failure
- βœ… Error categorization
- βœ… Metrics collection
- βœ… Request history tracking
- βœ… Monitoring dashboard data
- βœ… Different model types
- βœ… Edge cases (empty input, timeouts, etc.)

## Notes for Reviewers

1. **SQL Processing**: The regex-based cleaning pipeline is designed to handle various Ollama model output formats
2. **Async Implementation**: Uses thread pool for sync Ollama client operations
3. **Health Monitoring**: Comprehensive but can be extended for specific infrastructure needs
4. **Metrics**: Thread-safe collection with configurable retention
5. **Logging**: Structured JSON format for easy log aggregation
Loading