feat(plotting): add data plotting capabilities with Plotly.js#25
feat(plotting): add data plotting capabilities with Plotly.js#25
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request implements visualization generation functionality for plotting data from natural language queries while also addressing an HTML index slicing issue and updating styling guidelines.
- Added new request and response models for visualization in both query_router and llm_engine.
- Created new endpoints to process visualization generation using LLM APIs.
- Updated styling guidelines embedded in the prompt for visualization generation.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| query_router/src/main.rs | Added visualization request/response models and a new endpoint to generate visualizations. |
| llm_engine/src/main.rs | Implemented visualization generation logic including prompt construction and LLM API integration. |
| struct VisualizationRequest { | ||
| natural_query: String, | ||
| results: Value, | ||
| #[serde(default = "default_model")] |
There was a problem hiding this comment.
The default model value returned by default_model ('gpt-3.5-turbo') is inconsistent with the default ('gpt-4') used in the llm_engine endpoint. Consider harmonizing these defaults to prevent unexpected behavior.
llm_engine/src/main.rs
Outdated
| info!("Generating visualization for query: {}", request.query); | ||
|
|
||
| // Get the model name from the request or use a default | ||
| let model = request.model.unwrap_or_else(|| "gpt-4".to_string()); |
There was a problem hiding this comment.
The default model ('gpt-4') differs from the default used in the query_router module. Aligning the default model values across endpoints would improve consistency.
This PR adds data visualization capabilities to the project, allowing users to generate interactive Plotly.js visualizations from query results.
Features Added
/generateendpoint in the LLM engine to create visualizations from data and queries/visualizeendpoint in the query router to handle visualization requestsTechnical Details
Testing
Manual testing has been performed to verify the visualization generation workflow.