Conversation
…y issues - Fix API key validation by properly handling environment variables in config.py - Add fallback support for models without JSON mode in llm_provider.py - Change default model from gpt-4 to gpt-3.5-turbo for better JSON mode support - Implement robust JSON parsing with automatic error recovery - Add model compatibility detection for response_format parameter Resolves issues with API key authentication errors and model compatibility
- Fix empty {} placeholders in pipeline templates that were causing 'Replacement index 0 out of range' error
- Escape Python dictionary literals ({} -> {{}}) in config.get() calls
- Escape Snakemake placeholders ({sample} -> {{sample}}) to preserve them for Snakemake processing
- Preserve generator placeholders ({llmomics_version}, {generated_date}) for Python .format() method
- Fixes pipeline generation in notebook 'generating a complete pipeline' session
Resolves IndexError when calling PipelineGenerator.generate() with RNA-seq and ChIP-seq templates
- Fix TypeError in 'Complete end-to-end example' session - Correct parameter mapping between ParsedQuery and PipelineGenerator.generate() - Fix LLM analyze_query method call signature - Add proper data structure conversion for dataset_ids and tools - Implement fallback logic for LLM analysis results Resolves TypeError: generate() got an unexpected keyword argument 'dataset_ids'
- Format src/llmomics/core/config.py with Black - Format src/llmomics/core/llm_provider.py with Black - Resolves 'Format check with black' CI failure
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.
Major Bug Fixes and Notebook Improvements
Overview
This PR resolves critical issues in the LLMomics notebook and core functionality, making the library fully functional for end-users.
Issues Fixed
1. OpenAI API Authentication Issues
Error code: 401 - Incorrect API key provideddue to quoted API keys2. JSON Mode Compatibility Issues
Error code: 400 - 'response_format' of type 'json_object' is not supported with this model3. Pipeline Template Formatting Errors
IndexError: Replacement index 0 out of range for positional args tuple{}placeholders in Snakemake templates by proper escaping4. End-to-End Function Parameter Mismatch
TypeError: generate() got an unexpected keyword argument 'dataset_ids'Files Changed
Core Functionality
src/llmomics/core/llm_provider.py- Enhanced JSON mode compatibility and error handlingsrc/llmomics/core/config.py- Fixed environment variable handlingsrc/llmomics/pipeline/templates.py- Fixed template placeholder escapingDocumentation & Examples
examples/getting_started.ipynb- Updated with corrected functions and working examplesTesting
All notebook sessions now work correctly:
Impact
Before
After
🔧 Technical Details
API Key Handling
JSON Mode Compatibility
Template Escaping
Ready for Production
This PR makes LLMomics fully functional for:
All critical user-facing issues have been resolved with comprehensive testing.