Skip to content

Commit

Permalink
Merge branch 'main' into feat/UN-1451-pdm-lock-automation
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtimanmishrazipstack authored Jul 30, 2024
2 parents 3c81df4 + 4c97569 commit e9617d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
5 changes: 4 additions & 1 deletion docker/scripts/merge_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
#
import sys

PREFERRED_BASE_ENV_KEYS = []
PREFERRED_BASE_ENV_KEYS = [
"STRUCTURE_TOOL_IMAGE_URL",
"STRUCTURE_TOOL_IMAGE_TAG",
]
DEFAULT_AUTH_KEY = "unstract"
DEFAULT_ADMIN_KEY = "admin"
SET_DEFAULT_KEYS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function OutputForDocModal({
}, [open, singlePassExtractMode, isSinglePassExtractLoading]);

useEffect(() => {
updatePromptOutput();
updatePromptOutput(docOutputs);
}, [docOutputs]);

useEffect(() => {
Expand Down Expand Up @@ -118,7 +118,7 @@ function OutputForDocModal({

const updatePromptOutput = (data) => {
setPromptOutputs((prev) => {
const updatedPromptOutput = getUpdatedPromptOutput(data, prev);
const updatedPromptOutput = data || [...prev];
const keys = Object.keys(docOutputs);

keys.forEach((key) => {
Expand All @@ -130,10 +130,6 @@ function OutputForDocModal({
});
};

const getUpdatedPromptOutput = (data, prev) => {
return data || [...prev];
};

const updatePromptOutputInstance = (updatedPromptOutput, docId, key) => {
const index = findPromptOutputIndex(updatedPromptOutput, docId);
const promptOutputInstance = createOrUpdatePromptOutputInstance(
Expand Down Expand Up @@ -221,10 +217,17 @@ function OutputForDocModal({
const rowsData = [];
const docs = moveSelectedDocToTop();
docs.forEach((item) => {
const output = data.find(
(outputValue) => outputValue?.document_manager === item?.document_id
);
const key = `${output?.prompt_id}__${output?.document_manager}__${output?.profile_manager}`;
const output = data.find((outputValue) => {
const docId =
outputValue?.document_manager ||
(outputValue?.key && getDocIdFromKey(outputValue?.key)) ||
null;
return docId === item?.document_id;
});
const key = `${promptId}__${item?.document_id}__${
selectedProfile || profileManagerId
}`;

let status = outputStatus.fail;
let message = displayPromptResult(output?.output, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function PromptCard({

if (runAllLLM) {
let selectedProfiles = llmProfiles;
if (!coverAllDoc && selectedLlmProfiles?.length > 0) {
if (selectedLlmProfiles?.length) {
selectedProfiles = llmProfiles.filter((profile) =>
selectedLlmProfiles.includes(profile?.profile_id)
);
Expand Down

0 comments on commit e9617d0

Please sign in to comment.