Skip to content
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

Update CLI auth error message, move backoff down to 3 retries #1759

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion py/cli/command_group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from .main import load_config
import json
import types
from functools import wraps
Expand Down
4 changes: 1 addition & 3 deletions py/cli/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ async def reset():
Config._config = configparser.ConfigParser() # Reset the config in memory

# Set default values
Config.set_credentials(
"Base URL", {"base_url": "https://api.cloud.sciphi.ai"}
)
Config.set_credentials("Base URL", {"base_url": "http://localhost:7272"})

console.print(
"[green]Successfully reset configuration to defaults[/green]"
Expand Down
2 changes: 2 additions & 0 deletions py/compose.full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ services:
condition: service_completed_successfully
unstructured:
condition: service_healthy
graph_clustering:
condition: service_healthy

r2r-dashboard:
image: emrgntcmplxty/r2r-dashboard:latest
Expand Down
2 changes: 1 addition & 1 deletion py/core/base/providers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def _auth_wrapper(
return await self._get_default_admin_user()
if not auth and not api_key:
raise R2RException(
message="No credentials provided",
message="No credentials provided. Create an account at https://app.sciphi.ai and set your API key using `r2r configure key` OR change your base URL to a custom deployment.",
status_code=401,
)
if auth and api_key:
Expand Down
2 changes: 1 addition & 1 deletion py/core/base/providers/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EmbeddingConfig(ProviderConfig):
prefixes: Optional[dict[str, str]] = None
add_title_as_prefix: bool = True
concurrent_request_limit: int = 256
max_retries: int = 8
max_retries: int = 3
initial_backoff: float = 1
max_backoff: float = 64.0
quantization_settings: VectorQuantizationSettings = (
Expand Down
2 changes: 1 addition & 1 deletion py/core/base/providers/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CompletionConfig(ProviderConfig):
provider: Optional[str] = None
generation_config: GenerationConfig = GenerationConfig()
concurrent_request_limit: int = 256
max_retries: int = 8
max_retries: int = 3
initial_backoff: float = 1.0
max_backoff: float = 64.0

Expand Down
2 changes: 1 addition & 1 deletion py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "r2r"
readme = "README.md"
version = "3.3.19"
version = "3.3.20"

description = "SciPhi R2R"
authors = ["Owen Colegrove <owen@sciphi.ai>"]
Expand Down
6 changes: 3 additions & 3 deletions py/sdk/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class R2RAsyncClient(BaseClient):
def __init__(
self,
base_url: str = "https://api.cloud.sciphi.ai",
prefix: str = "/v2",
prefix: str = "/v3",
custom_client=None,
timeout: float = 300.0,
):
Expand All @@ -47,7 +47,7 @@ def __init__(
self.users = UsersSDK(self)

async def _make_request(
self, method: str, endpoint: str, version: str = "v2", **kwargs
self, method: str, endpoint: str, version: str = "v3", **kwargs
):
url = self._get_full_url(endpoint, version)
request_args = self._prepare_request_args(endpoint, **kwargs)
Expand All @@ -70,7 +70,7 @@ async def _make_request(
) from e

async def _make_streaming_request(
self, method: str, endpoint: str, version: str = "v2", **kwargs
self, method: str, endpoint: str, version: str = "v3", **kwargs
) -> AsyncGenerator[Any, None]:
url = self._get_full_url(endpoint, version)
request_args = self._prepare_request_args(endpoint, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions py/sdk/base/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BaseClient:
def __init__(
self,
base_url: str = "https://api.cloud.sciphi.ai",
prefix: str = "/v2",
prefix: str = "/v3",
timeout: float = 300.0,
):
self.base_url = base_url
Expand Down Expand Up @@ -66,7 +66,7 @@ def _ensure_authenticated(self):
message="Not authenticated. Please login first.",
)

def _get_full_url(self, endpoint: str, version: str = "v2") -> str:
def _get_full_url(self, endpoint: str, version: str = "v3") -> str:
return f"{self.base_url}/{version}/{endpoint}"

def _prepare_request_args(self, endpoint: str, **kwargs) -> dict:
Expand Down
Loading