From 96e236721919dae74bfe1b4fa96f1a46540fd435 Mon Sep 17 00:00:00 2001 From: emrgnt-cmplxty <68796651+emrgnt-cmplxty@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:07:25 -0700 Subject: [PATCH] Patch/fix import bleed (#1526) * Feature/tweak actions (#1507) * up * tweak actions * Sync JS SDK, Harmonize Python SDK KG Methods (#1511) * Feature/move logging (#1492) * move logging provider out * move logging provider to own directory, remove singleton * cleanup * fix refactoring tweak (#1496) * Fix JSON serialization and Prompt ID Bugs for Prompts (#1491) * Bug in get prompts * Add tests * Prevent verbose logging on standup * Remove kg as required key in config, await get_all_prompts * Remove reference to fragment id * comment out ingestion * complete logging port (#1499) * Feature/dev rebased (#1500) * Feature/move logging (#1493) * move logging provider out * move logging provider to own directory, remove singleton * cleanup * Update js package (#1498) * fix refactoring tweak (#1496) * Fix JSON serialization and Prompt ID Bugs for Prompts (#1491) * Bug in get prompts * Add tests * Prevent verbose logging on standup * Remove kg as required key in config, await get_all_prompts * Remove reference to fragment id * comment out ingestion * complete logging port (#1499) --------- Co-authored-by: Nolan Tremelling <34580718+NolanTrem@users.noreply.github.com> * Fix handling for R2R exceptions (#1501) * fix doc test (#1502) * Harmonize python SDK KG methods for optional params, add missing JS methods --------- Co-authored-by: emrgnt-cmplxty <68796651+emrgnt-cmplxty@users.noreply.github.com> Co-authored-by: emrgnt-cmplxty * Clean up pagination and offset around KG (#1519) * Move to R2R light for integration testing (#1521) --------- Co-authored-by: Nolan Tremelling <34580718+NolanTrem@users.noreply.github.com> --- py/cli/command_group.py | 2 +- py/cli/commands/ingestion.py | 2 +- py/core/base/providers/llm.py | 3 ++- py/pyproject.toml | 3 +-- py/sdk/async_client.py | 2 +- py/sdk/base/base_client.py | 2 +- py/sdk/mixins/ingestion.py | 2 +- py/shared/abstractions/__init__.py | 10 ++++++++++ 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/py/cli/command_group.py b/py/cli/command_group.py index efa27d936..49c560f88 100644 --- a/py/cli/command_group.py +++ b/py/cli/command_group.py @@ -2,7 +2,7 @@ from asyncclick import pass_context from asyncclick.exceptions import Exit -from r2r import R2RAsyncClient +from sdk import R2RAsyncClient @click.group() diff --git a/py/cli/commands/ingestion.py b/py/cli/commands/ingestion.py index cd4ad137b..bd28823f4 100644 --- a/py/cli/commands/ingestion.py +++ b/py/cli/commands/ingestion.py @@ -11,7 +11,7 @@ from cli.command_group import cli from cli.utils.param_types import JSON from cli.utils.timer import timer -from core.base.abstractions import IndexMeasure, IndexMethod, VectorTableName +from shared.abstractions import IndexMeasure, IndexMethod, VectorTableName async def ingest_files_from_urls(client, urls): diff --git a/py/core/base/providers/llm.py b/py/core/base/providers/llm.py index af2bb7f98..66beede8f 100644 --- a/py/core/base/providers/llm.py +++ b/py/core/base/providers/llm.py @@ -1,10 +1,11 @@ import asyncio import logging +import random import time from abc import abstractmethod from concurrent.futures import ThreadPoolExecutor from typing import Any, AsyncGenerator, Generator, Optional -import random + from litellm import AuthenticationError from core.base.abstractions import ( diff --git a/py/pyproject.toml b/py/pyproject.toml index d8d1866e0..8b29c03b9 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "r2r" readme = "README.md" -version = "3.2.35" +version = "3.2.36" description = "SciPhi R2R" authors = ["Owen Colegrove "] @@ -17,7 +17,6 @@ packages = [ { include = "shared", from = "." }, { include = "core", from = "." }, { include = "cli", from = "." }, - ] [tool.poetry.dependencies] diff --git a/py/sdk/async_client.py b/py/sdk/async_client.py index a92598be7..df48089d0 100644 --- a/py/sdk/async_client.py +++ b/py/sdk/async_client.py @@ -3,7 +3,7 @@ import httpx -from core.base.abstractions import R2RException +from shared.abstractions import R2RException from .base.base_client import BaseClient from .mixins import ( diff --git a/py/sdk/base/base_client.py b/py/sdk/base/base_client.py index 7badf13d7..096cd69aa 100644 --- a/py/sdk/base/base_client.py +++ b/py/sdk/base/base_client.py @@ -1,6 +1,6 @@ from typing import Optional -from core.base.abstractions import R2RException +from shared.abstractions import R2RException class BaseClient: diff --git a/py/sdk/mixins/ingestion.py b/py/sdk/mixins/ingestion.py index 0a4973a0d..4aa8d8d5e 100644 --- a/py/sdk/mixins/ingestion.py +++ b/py/sdk/mixins/ingestion.py @@ -4,7 +4,7 @@ from typing import Optional, Union from uuid import UUID -from core.base import IndexMeasure, IndexMethod, VectorTableName +from shared.abstractions import IndexMeasure, IndexMethod, VectorTableName class IngestionMixins: diff --git a/py/shared/abstractions/__init__.py b/py/shared/abstractions/__init__.py index 225308646..f625255d5 100644 --- a/py/shared/abstractions/__init__.py +++ b/py/shared/abstractions/__init__.py @@ -52,10 +52,15 @@ ) from .user import Token, TokenData, UserStats from .vector import ( + IndexArgsHNSW, + IndexArgsIVFFlat, + IndexMeasure, + IndexMethod, StorageResult, Vector, VectorEntry, VectorQuantizationType, + VectorTableName, VectorType, ) @@ -124,6 +129,11 @@ "Vector", "VectorEntry", "VectorType", + "IndexMethod", + "IndexMeasure", + "IndexArgsIVFFlat", + "IndexArgsHNSW", + "VectorTableName", "VectorQuantizationType", "StorageResult", ]