Skip to content

Conversation

@yilinxia
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings September 11, 2025 21:45
@yilinxia yilinxia merged commit 3efa203 into main Sep 11, 2025
1 check passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses deployment issues by consolidating API endpoint configuration and fixing provider selection logic. The changes centralize hardcoded API URLs into a configuration system and resolve duplicate condition handling for the Gemini AI provider.

  • Replaces hardcoded API URLs with centralized endpoint configuration
  • Adds fallback logic for API base URL configuration using environment variables or window origin
  • Fixes duplicate Gemini provider handling in backend endpoints

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/views/GraphRAGPanel.tsx Replaces hardcoded API URLs with centralized endpoint constants
src/lib/config.ts Adds GraphRAG endpoint definitions and improves API base URL configuration with fallback logic
backend/app/main.py Adds duplicate condition handling for "gemini" provider selection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +757 to +760
elif provider == "gemini":
# Support direct "gemini" provider selection from frontend
api_key = api_keys.get("geminiKey") or config_manager.get("ai_providers.google_genai.api_key", "")
graphrag_api_keys = {"geminiKey": api_key}
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

This condition is identical to the existing 'google_genai' condition above it (lines 754-756). Consider consolidating these conditions using 'elif provider in ["google_genai", "gemini"]:' to avoid code duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +888 to +891
elif provider == "gemini":
# Support direct "gemini" provider selection from frontend
api_key = api_keys.get("geminiKey") or config_manager.get("ai_providers.google_genai.api_key", "")
graphrag_api_keys = {"geminiKey": api_key}
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

This condition is identical to the existing 'google_genai' condition above it (lines 885-887). Consider consolidating these conditions using 'elif provider in ["google_genai", "gemini"]:' to avoid code duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +1136 to +1139
elif provider == "gemini":
# Support direct "gemini" provider selection from frontend
api_key = api_keys.get("geminiKey") or config_manager.get("ai_providers.google_genai.api_key", "")
graphrag_api_keys = {"geminiKey": api_key}
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

This condition is identical to the existing 'google_genai' condition above it (lines 1133-1135). Consider consolidating these conditions using 'elif provider in ["google_genai", "gemini"]:' to avoid code duplication.

Copilot uses AI. Check for mistakes.
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.

2 participants