Skip to content

Commit e44a257

Browse files
authored
Fix Oauth routes (#1968)
1 parent 17e0a9e commit e44a257

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

py/core/main/api/v3/retrieval_router.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ async def agent_app(
652652
The agent uses both vector search and knowledge graph capabilities to find and synthesize
653653
information, providing detailed, factual responses with proper attribution to source documents.
654654
"""
655-
print("in app..")
656655
if "model" not in rag_generation_config.__fields_set__:
657656
rag_generation_config.model = self.config.app.quality_llm
658657

py/core/main/api/v3/users_router.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,7 @@ async def get_user_limits(
17081708
return limits_info # type: ignore
17091709

17101710
@self.router.get("/users/oauth/google/authorize")
1711+
@self.base_endpoint
17111712
async def google_authorize() -> WrappedGenericMessageResponse:
17121713
"""
17131714
Redirect user to Google's OAuth 2.0 consent screen.
@@ -1729,6 +1730,7 @@ async def google_authorize() -> WrappedGenericMessageResponse:
17291730
return GenericMessageResponse(message=google_auth_url) # type: ignore
17301731

17311732
@self.router.get("/users/oauth/google/callback")
1733+
@self.base_endpoint
17321734
async def google_callback(
17331735
code: str = Query(...), state: str = Query(...)
17341736
) -> WrappedLoginResponse:
@@ -1780,14 +1782,14 @@ async def google_callback(
17801782
email=email,
17811783
)
17821784

1783-
# =============== GITHUB OAUTH ===============
17841785
@self.router.get("/users/oauth/github/authorize")
1786+
@self.base_endpoint
17851787
async def github_authorize() -> WrappedGenericMessageResponse:
17861788
"""
17871789
Redirect user to GitHub's OAuth consent screen.
17881790
"""
17891791
state = "some_random_string_or_csrf_token"
1790-
scope = "read:user user:email" # whatever scopes you need
1792+
scope = "read:user user:email"
17911793

17921794
params = {
17931795
"client_id": self.github_client_id,
@@ -1799,6 +1801,7 @@ async def github_authorize() -> WrappedGenericMessageResponse:
17991801
return GenericMessageResponse(message=github_auth_url) # type: ignore
18001802

18011803
@self.router.get("/users/oauth/github/callback")
1804+
@self.base_endpoint
18021805
async def github_callback(
18031806
code: str = Query(...), state: str = Query(...)
18041807
) -> WrappedLoginResponse:

py/sdk/sync_methods/retrieval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import uuid
2-
from typing import Any, AsyncGenerator, Optional, Union
2+
from typing import Any, AsyncGenerator, Optional
33

44
from shared.api.models import (
55
WrappedAgentResponse,
@@ -169,7 +169,7 @@ def agent(
169169
search_settings: Optional[dict | SearchSettings] = None,
170170
task_prompt_override: Optional[str] = None,
171171
include_title_if_available: Optional[bool] = False,
172-
conversation_id: Optional[Union[str, uuid.UUID]] = None,
172+
conversation_id: Optional[str | uuid.UUID] = None,
173173
tools: Optional[list[dict]] = None,
174174
max_tool_context_length: Optional[int] = None,
175175
use_extended_prompt: Optional[bool] = True,

py/tests/unit/test_citations.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import re
22
import uuid
3-
from copy import deepcopy
4-
5-
# Example imports (adjust paths to match your codebase)
6-
from typing import List
73

84
import pytest
95

0 commit comments

Comments
 (0)