Skip to content

Conversation

@Zeesky-code
Copy link

Summary

This PR adds two new examples demonstrating how to perform agentic data analysis using Google Gemini models (specifically tested with gemini-3.0-flash-preview and gemini-2.0) and the E2B Code Interpreter SDK (resolving #72 ).

Added Examples

  1. Python (examples/gemini-data-analysis-python): A Jupyter Notebook implementation using the google-genai SDK, showcasing how to handle multimodal reasoning (plots + text) in a cell-by-cell notebook format.
  2. TypeScript (examples/gemini-data-analysis-js): A Node.js application using the latest @google/genai SDK (v1.37.0).

Technical Highlights

  • Agentic Data Loop: Implements a complete "Plan-Execute-Reason" cycle where the model writes code, the E2B sandbox executes it, and the resulting visualizations are fed back into the model's vision context.
  • Thought Signature Management: Gemini 3.0 introduces a mandatory reasoning state. Both examples are architected to preserve and return thought_signature parts, preventing common 400 INVALID_ARGUMENT errors in multi-turn tool calling. Gemini API Thought Signatures
  • Multimodal Feedback: Specifically handles the decoding of E2B's Base64 PNG outputs and passes them back to Gemini via PIL (Python) or Buffer (JS) to enable the model to "see" its own visualizations.

Verification

  • Tested with Gemini 3.0 Flash Preview and Gemini 2.0.
  • Verified that datasets are uploaded, code is executed in the isolated sandbox, and visualizations are correctly generated and saved.
  • Verified that E2B sandboxes are correctly closed/killed after analysis completion.
  • Updated the main README.md to include these new examples in the LLM Providers table.

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