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

Feat/mrq filter by low confidence #850

Merged
merged 18 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c87d8ad
added place holder utils for mrq db rules functionality and frontend …
vishnuszipstack Nov 19, 2024
b08b74f
added urls and view to get prompt tools details
vishnuszipstack Nov 19, 2024
f5e5917
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Nov 21, 2024
7356118
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Nov 22, 2024
d23d996
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Nov 26, 2024
f1df5ff
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Dec 2, 2024
266f351
renamed db rules function to avoid confusion
vishnuszipstack Dec 3, 2024
f7b9b81
Merge remote-tracking branch 'origin' into feat/mrq-filter-by-low-con…
vishnuszipstack Dec 3, 2024
f541dd3
Merge remote-tracking branch 'origin/feat/mrq-filter-by-low-confidenc…
vishnuszipstack Dec 3, 2024
37c3db4
Update frontend/src/components/agency/configure-connector-modal/Confi…
vishnuszipstack Dec 3, 2024
8b04878
Pr comment fixes
vishnuszipstack Dec 3, 2024
9a2d4d5
added enum
vishnuszipstack Dec 3, 2024
f0715ad
added constants
vishnuszipstack Dec 3, 2024
e56104d
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Dec 4, 2024
b5aedcf
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Dec 10, 2024
dae294e
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Dec 11, 2024
b8bd85a
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Dec 16, 2024
b65f7df
Merge branch 'main' into feat/mrq-filter-by-low-confidence
vishnuszipstack Dec 17, 2024
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
14 changes: 13 additions & 1 deletion backend/prompt_studio/prompt_studio_registry_v2/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns

urlpatterns = format_suffix_patterns([])
from .views import PromptStudioRegistryView

urlpatterns = [
path(
"registry/",
PromptStudioRegistryView.as_view({"get": "list"}),
name="prompt_studio_registry_list",
),
]

# Optional: Apply format suffix patterns
urlpatterns = format_suffix_patterns(urlpatterns)
8 changes: 4 additions & 4 deletions backend/workflow_manager/endpoint_v2/destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from workflow_manager.workflow_v2.file_history_helper import FileHistoryHelper
from workflow_manager.workflow_v2.models.file_history import FileHistory
from workflow_manager.workflow_v2.models.workflow import Workflow
from workflow_manager.workflow_v2.utils import WorkflowUtil

from backend.constants import FeatureFlag
from backend.exceptions import UnstractFSException
Expand Down Expand Up @@ -182,10 +183,8 @@ def handle_output(
if connection_type == WorkflowEndpoint.ConnectionType.FILESYSTEM:
self.copy_output_to_output_directory()
elif connection_type == WorkflowEndpoint.ConnectionType.DATABASE:
if (
file_hash.file_destination
== WorkflowEndpoint.ConnectionType.MANUALREVIEW
):
result = self.get_result(file_history)
if WorkflowUtil.db_rule_check(result, workflow, file_hash.file_destination):
vishnuszipstack marked this conversation as resolved.
Show resolved Hide resolved
self._push_data_to_queue(file_name, workflow, input_file_path)
else:
self.insert_into_db(input_file_path=input_file_path)
Expand Down Expand Up @@ -287,6 +286,7 @@ def insert_into_db(self, input_file_path: str) -> None:
# If data is None, don't execute CREATE or INSERT query
if not data:
return

# Remove metadata from result
# Tool text-extractor returns data in the form of string.
# Don't pop out metadata in this case.
Expand Down
23 changes: 22 additions & 1 deletion backend/workflow_manager/workflow_v2/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Optional

from workflow_manager.endpoint_v2.dto import FileHash
from workflow_manager.workflow_v2.models.workflow import Workflow
Expand Down Expand Up @@ -59,3 +59,24 @@ def add_file_destination_filehash(
destination modified.
"""
return file_hash

@staticmethod
def db_rule_check(
result: Optional[Any],
workflow_id: Workflow,
file_destination: Optional[tuple[str, str]],
) -> bool:
"""Placeholder method to check the db rules - MRQ

Args:
result (Optional[Any]): The result dictionary containing
confidence_data.
workflow_id (str): The ID of the workflow to retrieve the rules.
file_destination (Optional[tuple[str, str]]): The destination of
the file (e.g., MANUALREVIEW or other).

Returns:
bool: True if the field_key conditions are met based on rule logic
and file destination.
"""
return False
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function ConfigureConnectorModal({
connType,
selectedItemName,
setSelectedItemName,
workflowDetails,
}) {
const [activeKey, setActiveKey] = useState("1");
useEffect(() => {
Expand Down Expand Up @@ -191,7 +192,10 @@ function ConfigureConnectorModal({
<ManageFiles selectedItem={connectorId} />
)}
{activeKey === "MANUALREVIEW" && (
<DBRules connDetails={connDetails} />
<DBRules
connDetails={connDetails}
workflowDetails={workflowDetails}
/>
vishnuszipstack marked this conversation as resolved.
Show resolved Hide resolved
)}
</Col>
</Row>
Expand All @@ -218,6 +222,7 @@ ConfigureConnectorModal.propTypes = {
connType: PropTypes.string.isRequired,
selectedItemName: PropTypes.string,
setSelectedItemName: PropTypes.func.isRequired,
workflowDetails: PropTypes.object,
};

export { ConfigureConnectorModal };
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const needToRemove = {

function DsSettingsCard({ type, endpointDetails, message }) {
const workflowStore = useWorkflowStore();
const { source, destination, allowChangeEndpoint } = workflowStore;
const { source, destination, allowChangeEndpoint, details } = workflowStore;
const [options, setOptions] = useState({});
const [openModal, setOpenModal] = useState(false);

Expand Down Expand Up @@ -490,6 +490,7 @@ function DsSettingsCard({ type, endpointDetails, message }) {
connType={connType}
selectedItemName={selectedItemName}
setSelectedItemName={setSelectedItemName}
workflowDetails={details}
/>
</>
);
Expand Down