Obsidian Sync, Gemini Support & SSL Fix#4
Conversation
- Added `integrate/obsidian_sync.py` for client-side syncing. - Updated `lpm_kernel/api/domains/memories/routes.py` to support listing and image uploads. - Implemented `GeminiClient` adapter for OpenAI-compatible interface. - Added `strategy_gemini.py` for retrieval embeddings (dim=512). - Updated `ExpertLLMService`, `ChatService`, and L2 data generators to support Gemini. - Disabled external calls in `RegistryClient` and `mcp_public.py` to fix SSL errors. - Updated dependencies (`google-generativeai`, `langchain-text-splitters`).
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
ericzhoun
left a comment
There was a problem hiding this comment.
Please add the handling of the thinking mode on/off switch for Gemini client.
| self.client = openai.OpenAI(api_key=self.api_key, base_url=self.base_url) | ||
| elif user_llm_config.provider_type == 'gemini': | ||
| # Similar handling for Gemini thinking models if applicable | ||
| pass |
There was a problem hiding this comment.
Please add the gemini handling of thinking mode.
There was a problem hiding this comment.
Thank you for the feedback. I will add the logic to handle Gemini thinking mode when is_cot is True and provider_type is 'gemini' in both diversity_data_generator.py and selfqa_generator.py, similar to how it was done in preference_QA_generate.py.
- Updated `diversity_data_generator.py` and `selfqa_generator.py` to handle Gemini thinking mode configuration (when `is_cot` is True). - Verified `UserLLMConfig` schema and `delete_file` route.
- Imported `Union` from `typing` in `lpm_kernel/api/services/expert_llm_service.py` to fix a runtime error when using type hints. - This commit finalizes the Gemini and Obsidian integration feature set.
This comprehensive PR implements three major changes requested by the user:
Obsidian Integration:
integrate/obsidian_sync.py) to synchronize a local Obsidian vault with the LPM backend. It handles file uploads (including images), updates, and deletions based on file hash and metadata.lpm_kernel/api/domains/memories/routes.py) to expose a list endpoint (GET /api/memories/list) for sync state reconciliation and expanded allowed file types to include common image formats.Gemini Support:
strategy_gemini.pyto support generating embeddings using Google's Gemini API, configurable viaUserLLMConfig(provider_type='gemini'). It enforces the requested output dimensionality of 512.GeminiClient(lpm_kernel/common/gemini_client.py), an adapter that wraps thegoogle-generativeaiSDK to expose an OpenAI-compatiblechat.completions.createinterface. This allows seamless integration of Gemini as the expert/support model inExpertLLMService,ChatService, and L2 training data generation scripts (PreferenceQAGenerator,DiversityDataGenerator,SelfQA) with minimal changes to existing logic.SSL Fix / External Communication Removal:
app.secondme.io) fromlpm_kernel/api/domains/upload/client.pyand routes to resolve reported SSL certificate verification errors. The registry client now returns local mock data or no-ops.mcp/mcp_public.py) to disable external server queries.Dependencies:
google-generativeaiandlangchain-text-splitterstopyproject.toml.langchain_text_splittersto resolve deprecation warnings/errors.PR created automatically by Jules for task 5401678453832845914 started by @ericzhoun