Skip to content

Obsidian Sync, Gemini Support & SSL Fix#4

Draft
google-labs-jules[bot] wants to merge 3 commits into
masterfrom
feature-obsidian-gemini-ssl-fix
Draft

Obsidian Sync, Gemini Support & SSL Fix#4
google-labs-jules[bot] wants to merge 3 commits into
masterfrom
feature-obsidian-gemini-ssl-fix

Conversation

@google-labs-jules

Copy link
Copy Markdown

This comprehensive PR implements three major changes requested by the user:

  1. Obsidian Integration:

    • Added a client-side script (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.
    • Updated the backend (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.
  2. Gemini Support:

    • Retrieval: Added strategy_gemini.py to support generating embeddings using Google's Gemini API, configurable via UserLLMConfig (provider_type='gemini'). It enforces the requested output dimensionality of 512.
    • Support/Expert Model: Implemented GeminiClient (lpm_kernel/common/gemini_client.py), an adapter that wraps the google-generativeai SDK to expose an OpenAI-compatible chat.completions.create interface. This allows seamless integration of Gemini as the expert/support model in ExpertLLMService, ChatService, and L2 training data generation scripts (PreferenceQAGenerator, DiversityDataGenerator, SelfQA) with minimal changes to existing logic.
  3. SSL Fix / External Communication Removal:

    • Removed all outbound calls to external "Second Me" servers (app.secondme.io) from lpm_kernel/api/domains/upload/client.py and routes to resolve reported SSL certificate verification errors. The registry client now returns local mock data or no-ops.
    • Updated MCP tool (mcp/mcp_public.py) to disable external server queries.
  4. Dependencies:

    • Added google-generativeai and langchain-text-splitters to pyproject.toml.
    • Updated imports to use langchain_text_splitters to resolve deprecation warnings/errors.

PR created automatically by Jules for task 5401678453832845914 started by @ericzhoun

- 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`).
@google-labs-jules

Copy link
Copy Markdown
Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


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 ericzhoun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the gemini handling of thinking mode.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged.

- 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.
@ericzhoun ericzhoun closed this Dec 3, 2025
@ericzhoun ericzhoun reopened this Dec 3, 2025
- 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.
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