Add option to work directly with OpenAI (OPENAI_API_KEY)#176
Add option to work directly with OpenAI (OPENAI_API_KEY)#176galshubeli merged 4 commits intostagingfrom
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughIntroduces MCP endpoints with an env toggle, adds token management API and frontend UI, streams DB-connection progress, refactors loaders to async generators with distinct-value enrichment, adjusts auth to support API tokens and updated Google userinfo retrieval, revises config/model selection, removes legacy loaders/schemas/examples, and updates docs/build/test wiring. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant UI as Frontend UI
participant API as FastAPI /database
participant L as Loader (Postgres/MySQL)
participant G as Graph Store
U->>UI: Open "Connect Database" modal
UI->>API: POST /database {url, type}
activate API
API-->>UI: Stream reasoning_step (connecting...)
API->>API: Detect DB type
API-->>UI: Stream reasoning_step (extract tables)
API->>L: load(prefix=user_id, url)
loop Loader progress
L-->>API: yield (ok,msg)
API-->>UI: Stream reasoning_step (msg)
end
API->>G: Persist schema/relations
API-->>UI: final_result {success:true}
deactivate API
alt Error
API-->>UI: error {message}
end
sequenceDiagram
autonumber
actor U as User
participant UI as Token Modal (TS)
participant T as /tokens Router
participant Org as Organizations Graph
participant CB as app.state.callback_handler
U->>UI: Click "API Tokens"
UI->>T: GET /tokens/list (with credentials)
T->>Org: MATCH Identity{provider:'api'}-[:HAS_TOKEN]->(t:Token)
Org-->>T: Tokens list
T-->>UI: {tokens:[...]}
U->>UI: Generate New Token
UI->>T: POST /tokens/generate
T->>CB: callback(provider='api', token=secrets.token_urlsafe)
T-->>UI: {token_id, created_at}
UI->>UI: Show token once, allow copy
U->>UI: Delete Token
UI->>T: DELETE /tokens/{last4}
T->>Org: MATCH ... DELETE
T-->>UI: 200 OK
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Dependency ReviewThe following issues were found:
License IssuesPipfile
Pipfile.lock
OpenSSF ScorecardScorecard details
Scanned Files
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for using OpenAI directly as an alternative to Azure OpenAI by introducing an OPENAI_API_KEY configuration option. The system automatically detects which API to use based on the presence of the OpenAI API key.
Key changes:
- Automatic detection between Azure OpenAI and direct OpenAI based on environment variables
- Configuration updates to support both AI providers with appropriate model names
- Documentation updates explaining the new OpenAI option
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| api/config.py | Adds logic to detect OPENAI_API_KEY and switch between Azure/OpenAI models automatically |
| api/memory/graphiti_tool.py | Updates Graphiti client creation to support both Azure and default OpenAI configurations |
| README.md | Documents the new OpenAI direct integration option with configuration examples |
| .env.example | Adds comments explaining the OpenAI vs Azure OpenAI configuration choice |
| .github/wordlist.txt | Adds "LLM" and "OpenAI" to the spell-check wordlist |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary by CodeRabbit
New Features
Changes
Documentation
Chores