Skip to content

feat: sweet AI assistant in the Tools drawer#4

Merged
rich-iannone merged 20 commits intomainfrom
faet-llm-transform
Aug 10, 2025
Merged

feat: sweet AI assistant in the Tools drawer#4
rich-iannone merged 20 commits intomainfrom
faet-llm-transform

Conversation

@rich-iannone
Copy link
Copy Markdown
Owner

This PR adds the Sweet AI Assistant, which allows you to discuss and transform your data interactively. The conversational AI capabilities complement Sweet's data manipulation workflow, integrating LLM-powered assistance directly into the terminal interface (in the Tools drawer). It's built on the chatlas library with automatic provider fallback (Anthropic Claude preferred, OpenAI GPT secondary), the assistant intelligently distinguishes between conversational data exploration queries and transformation requests using advanced code detection logic.

When users ask exploratory questions like "describe this data" or "what patterns do you see?", the assistant provides immediate conversational insights without requiring approval. However, when users request actual data transformations like "add a calculated column" or "filter these rows", the assistant generates precise Polars code. We provide a fairly comprehensive API reference covering 200+ operations from Polars 1.32.0+ so that it won't have problems with delivery to the transformation approval workflow.

The system requires only a simple .env file with an API key (ANTHROPIC_API_KEY or OPENAI_API_KEY) and automatically generates dataset context including column types, sample values, and statistics to provide the LLM with complete understanding of the user's current data. This creates a pretty good chat experience for data exploration while maintaining Sweet's preview-before-execute approach for all data modifications.

@rich-iannone rich-iannone merged commit 9d8c6c0 into main Aug 10, 2025
4 checks passed
@rich-iannone rich-iannone deleted the faet-llm-transform branch August 10, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant