From bc74bcae3a6e74a468319bcac303274adefdbf13 Mon Sep 17 00:00:00 2001 From: rkuo-danswer Date: Thu, 10 Apr 2025 20:53:36 -0700 Subject: [PATCH] updating more packages (#4502) * updating more packages * mypy fixes --------- Co-authored-by: Richard Kuo (Onyx) --- .../orchestration/nodes/use_tool_response.py | 4 +++- backend/onyx/auth/users.py | 7 ++++++- backend/requirements/dev.txt | 4 ++-- backend/requirements/model_server.txt | 9 +++++---- .../tests/index_attempt/test_index_attempt_pagination.py | 1 + 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/backend/onyx/agents/agent_search/orchestration/nodes/use_tool_response.py b/backend/onyx/agents/agent_search/orchestration/nodes/use_tool_response.py index 36a31a39f09..12f0445e1d5 100644 --- a/backend/onyx/agents/agent_search/orchestration/nodes/use_tool_response.py +++ b/backend/onyx/agents/agent_search/orchestration/nodes/use_tool_response.py @@ -50,13 +50,15 @@ def basic_use_tool_response( final_search_results = [] initial_search_results = [] + initial_search_document_ids: set[str] = set() for yield_item in tool_call_responses: if yield_item.id == FINAL_CONTEXT_DOCUMENTS_ID: final_search_results = cast(list[LlmDoc], yield_item.response) elif yield_item.id == SEARCH_RESPONSE_SUMMARY_ID: search_response_summary = cast(SearchResponseSummary, yield_item.response) for section in search_response_summary.top_sections: - if section.center_chunk.document_id not in initial_search_results: + if section.center_chunk.document_id not in initial_search_document_ids: + initial_search_document_ids.add(section.center_chunk.document_id) initial_search_results.append(section_to_llm_doc(section)) new_tool_call_chunk = AIMessageChunk(content="") diff --git a/backend/onyx/auth/users.py b/backend/onyx/auth/users.py index aff5da9d46d..2024ca72e34 100644 --- a/backend/onyx/auth/users.py +++ b/backend/onyx/auth/users.py @@ -321,7 +321,12 @@ class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]): except exceptions.UserAlreadyExists: user = await self.get_by_email(user_create.email) # Handle case where user has used product outside of web and is now creating an account through web - if not user.role.is_web_login() and user_create.role.is_web_login(): + + if ( + not user.role.is_web_login() + and isinstance(user_create, UserCreate) + and user_create.role.is_web_login() + ): user_update = UserUpdateWithRole( password=user_create.password, is_verified=user_create.is_verified, diff --git a/backend/requirements/dev.txt b/backend/requirements/dev.txt index 58814689946..0302358d6b6 100644 --- a/backend/requirements/dev.txt +++ b/backend/requirements/dev.txt @@ -5,7 +5,7 @@ cohere==5.6.1 lxml==5.3.0 lxml_html_clean==0.2.2 mypy-extensions==1.0.0 -mypy==1.8.0 +mypy==1.15.0 pandas-stubs==2.2.3.241009 pandas==2.2.3 posthog==3.7.4 @@ -14,7 +14,7 @@ pytest-asyncio==0.22.0 pytest==8.3.5 reorder-python-imports-black==3.14.0 ruff==0.0.286 -sentence-transformers==3.4.1 +sentence-transformers==4.0.2 trafilatura==1.12.2 types-beautifulsoup4==4.12.0.3 types-html5lib==1.1.11.13 diff --git a/backend/requirements/model_server.txt b/backend/requirements/model_server.txt index 367b71876cb..dec5b8e5348 100644 --- a/backend/requirements/model_server.txt +++ b/backend/requirements/model_server.txt @@ -1,4 +1,5 @@ -einops==0.8.0 +accelerate==1.6.0 +einops==0.8.1 cohere==5.6.1 fastapi==0.115.12 google-cloud-aiplatform==1.58.0 @@ -6,10 +7,10 @@ numpy==1.26.4 openai==1.66.3 pydantic==2.8.2 retry==0.9.2 -safetensors==0.4.2 -sentence-transformers==3.4.1 +safetensors==0.5.3 +sentence-transformers==4.0.2 setfit==1.1.1 -torch==2.2.0 +torch==2.6.0 transformers==4.49.0 uvicorn==0.21.1 voyageai==0.2.3 diff --git a/backend/tests/integration/tests/index_attempt/test_index_attempt_pagination.py b/backend/tests/integration/tests/index_attempt/test_index_attempt_pagination.py index 85ca64c18d4..c3ca5c20e9b 100644 --- a/backend/tests/integration/tests/index_attempt/test_index_attempt_pagination.py +++ b/backend/tests/integration/tests/index_attempt/test_index_attempt_pagination.py @@ -33,6 +33,7 @@ def _verify_index_attempt_pagination( # Verify time ordering within the page (descending order) for attempt in paginated_result.items: if last_time_started is not None: + assert attempt.time_started is not None assert ( attempt.time_started <= last_time_started ), "Index attempts not in descending time order"