feat: add DataFrame support as RLM context payload#134
Draft
kmad wants to merge 7 commits intoalexzhang13:mainfrom
Draft
feat: add DataFrame support as RLM context payload#134kmad wants to merge 7 commits intoalexzhang13:mainfrom
kmad wants to merge 7 commits intoalexzhang13:mainfrom
Conversation
Adds pandas DataFrame as a first-class context type for RLM. DataFrames are serialized via Parquet for type-preserving transfer to all environments (local, Docker, Modal, Prime, Daytona). Includes metadata generation for LLM prompts with shape, dtypes, nulls, and sample rows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Frames Consolidates the two identical `if cols > 20` blocks into one and applies the same column truncation to head/tail sample rows, preventing huge metadata strings for wide DataFrames. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only install pandas and pyarrow in the Docker container when a DataFrame context is actually passed, avoiding the install overhead for string/dict contexts. Uses a lazy _ensure_pandas() method called from load_context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the top-level import of dataframe_utils in core/types.py into QueryMetadata.__init__ so the module is only loaded when actually constructing query metadata, not on every import of rlm.core.types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…egen Remove the unified build_context_code() which handled strings, dicts, and DataFrames with fragile escaping. Keep only build_dataframe_context_code() for DataFrame-specific Parquet-over-base64 codegen. Restore original per-environment string/dict handling in Modal, Prime, and Daytona REPLs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary