Skip to content

Conversation

@adrian-badea
Copy link
Collaborator

@adrian-badea adrian-badea commented Oct 28, 2025

Summary

Refactored the ContextGroundingVectorStore implementation to improve type safety, structure, and maintainability while keeping functional parity with the previous version.

Key Changes

Refactored class for clarity and modern typing
• Added precise type annotations using | unions and Self return types.
• Replaced Optional[...] with more concise modern Python 3.10+ syntax.
• Added @OverRide decorators for all methods implementing the VectorStore interface.

🧩 Introduced _convert_results_to_documents() helper
• Centralized logic for converting ContextGroundingQueryResponse objects to Document instances.
• Improved metadata safety (handles missing or None fields gracefully).

🔐 Reinforced read-only behavior
• add_texts(), delete(), and from_texts() explicitly raise NotImplementedError with clearer messages.

@adrian-badea adrian-badea force-pushed the feature/update_context_grounding_vectorstore branch from ced5c6f to 189c162 Compare October 28, 2025 10:46
execution_context = ExecutionContext()

# Create a temporary UiPath SDK instance to get the required services
sdk = UiPath(base_url=self.uipath_url, secret=access_token)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can t we just initialize UiPath() with the desired base_url and secret and then pass it to the ContextGroundingVectorStore ctor?
why is all this refactor needed?

@adrian-badea adrian-badea force-pushed the feature/update_context_grounding_vectorstore branch 5 times, most recently from a7fc34b to 6ab1882 Compare October 28, 2025 12:10
@adrian-badea adrian-badea force-pushed the feature/update_context_grounding_vectorstore branch 2 times, most recently from f3d168d to 365c57e Compare October 28, 2025 15:55
uipath_sdk: Optional UiPath SDK instance.
folder_path: Optional folder path for folder-scoped operations
"""
self.index_name = index_name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated

folder_path: Optional folder path for folder-scoped operations
"""
self.index_name = index_name
self.folder_path = folder_path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@adrian-badea adrian-badea force-pushed the feature/update_context_grounding_vectorstore branch 4 times, most recently from b79e226 to 3ea9bf4 Compare October 29, 2025 09:02
Copy link
Collaborator

@radu-mocanu radu-mocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a short PR description with the changes made please

@adrian-badea adrian-badea changed the title Update context grounding vector store to be compatible with gym Update ContextGroundingVectorStore to be compatible with gym Oct 29, 2025
@adrian-badea adrian-badea changed the title Update ContextGroundingVectorStore to be compatible with gym Refactored ContextGroundingVectorStore to improve type safety, structure, and maintainability Oct 29, 2025
@adrian-badea adrian-badea changed the title Refactored ContextGroundingVectorStore to improve type safety, structure, and maintainability feat : refactored ContextGroundingVectorStore to improve type safety Oct 29, 2025
@adrian-badea adrian-badea force-pushed the feature/update_context_grounding_vectorstore branch from 3ea9bf4 to 34e1ed2 Compare October 29, 2025 14:58
@radu-mocanu
Copy link
Collaborator

commit message should follow conventional commit structure

@adrian-badea adrian-badea changed the title feat : refactored ContextGroundingVectorStore to improve type safety feat: refactored ContextGroundingVectorStore to improve type safety Oct 29, 2025
@adrian-badea adrian-badea force-pushed the feature/update_context_grounding_vectorstore branch from 34e1ed2 to 95e0385 Compare October 29, 2025 15:10
@adrian-badea adrian-badea merged commit 24b8b8c into main Oct 29, 2025
36 checks passed
@adrian-badea adrian-badea deleted the feature/update_context_grounding_vectorstore branch October 29, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants