Skip to content

Commit

Permalink
AMinor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak <[email protected]>
  • Loading branch information
Deepak-Kesavan committed Oct 1, 2024
1 parent 0a27853 commit fbcfa2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 11 additions & 0 deletions frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Space,
Tooltip,
Typography,
Modal,
} from "antd";
import PropTypes from "prop-types";
import { useEffect, useState } from "react";
Expand Down Expand Up @@ -320,6 +321,16 @@ function DsSettingsCard({ type, endpointDetails, message }) {
} else {
updatedData["destination"] = data;
}
if (
type === "output" &&
updatedData?.destination?.connection_type === "MANUALREVIEW"
) {
Modal.warning({
title: "Warning",
content:
"Please ensure that the tool in use is has highlight enabled in the tool settings.",
});
}
updateWorkflow(updatedData);
if (showSuccess) {
setAlertDetails({
Expand Down
8 changes: 2 additions & 6 deletions tools/structure/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def run(
single_pass_extraction_mode: bool = settings[
SettingsKeys.SINGLE_PASS_EXTRACTION_MODE
]
enable_highlight: bool = settings.get(SettingsKeys.ENABLE_HIGHLIGHT, False)
responder: PromptTool = PromptTool(
tool=self,
prompt_port=self.get_env_or_die(SettingsKeys.PROMPT_PORT),
Expand All @@ -57,13 +58,13 @@ def run(
tool_id = tool_metadata[SettingsKeys.TOOL_ID]
tool_settings = tool_metadata[SettingsKeys.TOOL_SETTINGS]
outputs = tool_metadata[SettingsKeys.OUTPUTS]
enable_highlight: bool = tool_settings.get(SettingsKeys.ENABLE_HIGHLIGHT, False)
tool_settings[SettingsKeys.CHALLENGE_LLM] = challenge_llm
tool_settings[SettingsKeys.ENABLE_CHALLENGE] = enable_challenge
tool_settings[SettingsKeys.ENABLE_SINGLE_PASS_EXTRACTION] = (
single_pass_extraction_mode
)
tool_settings[SettingsKeys.SUMMARIZE_AS_SOURCE] = summarize_as_source
tool_settings[SettingsKeys.ENABLE_HIGHLIGHT] = enable_highlight
prompt_service_resp = None
_, file_name = os.path.split(input_file)
if summarize_as_source:
Expand Down Expand Up @@ -110,7 +111,6 @@ def run(
output_file_path=tool_data_dir / SettingsKeys.EXTRACT,
reindex=True,
usage_kwargs=usage_kwargs,
enable_highlight=enable_highlight,
process_text=process_text,
)
if summarize_as_source:
Expand All @@ -122,7 +122,6 @@ def run(
outputs=outputs,
index=index,
usage_kwargs=usage_kwargs,
enable_highlight=enable_highlight,
)
payload[SettingsKeys.FILE_HASH] = summarize_file_hash
self.stream_log("Fetching response for single pass extraction")
Expand All @@ -148,7 +147,6 @@ def run(
output_file_path=tool_data_dir / SettingsKeys.EXTRACT,
reindex=reindex,
usage_kwargs=usage_kwargs,
enable_highlight=enable_highlight,
process_text=process_text,
)

Expand Down Expand Up @@ -247,7 +245,6 @@ def _summarize_and_index(
outputs: dict[str, Any],
index: Index,
usage_kwargs: dict[Any, Any] = {},
enable_highlight: bool = False,
) -> str:
"""Summarizes the context of the file and indexes the summarized
content.
Expand Down Expand Up @@ -321,7 +318,6 @@ def _summarize_and_index(
chunk_size=0,
chunk_overlap=0,
usage_kwargs=usage_kwargs,
enable_highlight=enable_highlight,
)
return summarize_file_hash

Expand Down

0 comments on commit fbcfa2b

Please sign in to comment.