-
-
Notifications
You must be signed in to change notification settings - Fork 144
Introduce runtime modes with feature-gated initialization #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tani-dubey
wants to merge
14
commits into
AOSSIE-Org:main
Choose a base branch
from
tani-dubey:feature/runtime-modes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6383651
Divided Devrai in 3 modes
tani-dubey fbd04f3
Removed dead code
tani-dubey 95983d3
Removed comments
tani-dubey b890e67
seperated discord msg handler and queuemanager
tani-dubey ffaae72
Divided discord and fullmode query handling
tani-dubey 36bd888
Fixed minor issues
tani-dubey 266b475
Address CodeRabbit feedback
tani-dubey 47d44b5
Address review: guard discord_bot
tani-dubey 72a4986
Address review: guard discord_bot
tani-dubey 8838e18
Address review
tani-dubey e5f6e5c
Updated .env.example accordingly
tani-dubey cba5fdc
Adress Review: Put dummy values
tani-dubey 081ef3a
Adress Review
tani-dubey f224c04
Remove trailing whitespace
tani-dubey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,31 @@ | ||
| from fastapi import APIRouter | ||
| from .v1.auth import router as auth_router | ||
| from .v1.health import router as health_router | ||
| from .v1.integrations import router as integrations_router | ||
|
|
||
| api_router = APIRouter() | ||
|
|
||
| api_router.include_router( | ||
| auth_router, | ||
| prefix="/v1/auth", | ||
| tags=["Authentication"] | ||
| ) | ||
|
|
||
| api_router.include_router( | ||
| core_router = APIRouter() | ||
| # -------- Core Router --------------- | ||
| core_router.include_router( | ||
| health_router, | ||
| prefix="/v1", | ||
| tags=["Health"] | ||
| ) | ||
|
|
||
| api_router.include_router( | ||
| integrations_router, | ||
| prefix="/v1/integrations", | ||
| tags=["Integrations"] | ||
| ) | ||
| # -------- Auth router -------- | ||
| def get_auth_router() -> APIRouter: | ||
| router= APIRouter() | ||
| from .v1.auth import router as auth_router | ||
| from .v1.integrations import router as integrations_router | ||
| router.include_router( | ||
| auth_router, | ||
| prefix="/v1/auth", | ||
| tags=["Authentication"] | ||
| ) | ||
|
|
||
| router.include_router( | ||
| integrations_router, | ||
| prefix="/v1/integrations", | ||
| tags=["Integrations"] | ||
| ) | ||
|
|
||
| return router | ||
|
|
||
| __all__ = ["api_router"] | ||
| __all__ = ["core_router", "get_auth_router"] |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,25 @@ | ||
| from app.core.config import settings | ||
| from supabase._async.client import AsyncClient | ||
|
|
||
| supabase_client: AsyncClient = AsyncClient( | ||
| settings.supabase_url, | ||
| settings.supabase_key | ||
| ) | ||
| _client: AsyncClient | None = None | ||
|
|
||
| def get_supabase_client() -> AsyncClient: | ||
| global _client | ||
| """ | ||
| Returns a shared asynchronous Supabase client instance. | ||
| """ | ||
| return supabase_client | ||
| if _client is None: | ||
| if not settings.supabase_url or not settings.supabase_key: | ||
| missing = [] | ||
| if not settings.supabase_url: | ||
| missing.append("SUPABASE_URL") | ||
| if not settings.supabase_key: | ||
| missing.append("SUPABASE_KEY") | ||
| raise RuntimeError( | ||
| f"Supabase misconfigured. Missing: {', '.join(missing)}" | ||
| ) | ||
| _client = AsyncClient( | ||
| settings.supabase_url, | ||
| settings.supabase_key, | ||
| ) | ||
| return _client |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| from langchain_google_genai import ChatGoogleGenerativeAI | ||
| from langchain_core.messages import HumanMessage | ||
| from app.core.config import settings | ||
|
|
||
| async def chat_completion(prompt: str, context: dict | None = None) -> str: | ||
| """ | ||
| Stateless LLM chat used in discord-only mode. | ||
| No agents, no memory, no queue. | ||
| """ | ||
| # if not settings.llm_enabled: | ||
| # return "LLM responses are currently disabled." | ||
|
|
||
| llm = ChatGoogleGenerativeAI( | ||
| model=settings.classification_agent_model, | ||
| temperature=0.7, | ||
| google_api_key=settings.gemini_api_key, | ||
| ) | ||
|
|
||
| response = await llm.ainvoke( | ||
| [HumanMessage(content=prompt)] | ||
| ) | ||
| return response.content | ||
tani-dubey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.