Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Fix/prompt studio bug fixes (#49)

Tahier Hussain2e043d9634cb
diff --git a/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx b/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx
index 3e60a6788..d4c312fda 100644
--- a/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx
+++ b/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx
@@ -234,6 +234,7 @@ function AddLlmProfileModal({
{
key: "1",
label: "Advanced Settings",
+ style: panelStyle,
children: (
<div>
<Form.Item
@@ -270,16 +271,19 @@ function AddLlmProfileModal({
>
<Select options={[{ value: "Default" }]} />
</Form.Item>
- <Row className="add-llm-profile-row">
- <Col span={5}>
- <Form.Item label="Re-Index">
- <Checkbox />
- </Form.Item>
- </Col>
- </Row>
+ <Form.Item
+ label="Re-Index"
+ valuePropName="checked"
+ name="reindex"
+ validateStatus={
+ getBackendErrorDetail("reindex", backendErrors) ? "error" : ""
+ }
+ help={getBackendErrorDetail("reindex", backendErrors)}
+ >
+ <Checkbox />
+ </Form.Item>
</div>
),
- style: panelStyle,
},
];
diff --git a/frontend/src/components/custom-tools/notes-card/NotesCard.jsx b/frontend/src/components/custom-tools/notes-card/NotesCard.jsx
index 3e9b7abe5..8f1a1e9b1 100644
--- a/frontend/src/components/custom-tools/notes-card/NotesCard.jsx
+++ b/frontend/src/components/custom-tools/notes-card/NotesCard.jsx
@@ -14,6 +14,8 @@ import { ConfirmModal } from "../../widgets/confirm-modal/ConfirmModal";
import { promptStudioUpdateStatus } from "../../../helpers/GetStaticData";
function NotesCard({ details, handleChange, handleDelete, updateStatus }) {
+ const [promptKey, setPromptKey] = useState("");
+ const [promptText, setPromptText] = useState("");
const [isEditingTitle, setIsEditingTitle] = useState(false);
const [isEditingNote, setIsEditingNote] = useState(false);
@@ -31,6 +33,8 @@ function NotesCard({ details, handleChange, handleDelete, updateStatus }) {
<EditableText
isEditing={isEditingTitle}
setIsEditing={setIsEditingTitle}
+ text={promptKey}
+ setText={setPromptKey}
promptId={details?.prompt_id}
defaultText={details?.prompt_key}
handleChange={handleChange}
@@ -85,6 +89,8 @@ function NotesCard({ details, handleChange, handleDelete, updateStatus }) {
<EditableText
isEditing={isEditingNote}
setIsEditing={setIsEditingNote}
+ text={promptText}
+ setText={setPromptText}
promptId={details?.prompt_id}
defaultText={details?.prompt}
handleChange={handleChange}
diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
index b647072e4..e07eaddf2 100644
--- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
+++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
@@ -1,19 +1,9 @@
-import {
- Alert,
- Button,
- Col,
- Dropdown,
- Image,
- Row,
- Switch,
- Typography,
-} from "antd";
+import { Alert, Button, Col, Dropdown, Image, Row, Typography } from "antd";
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
-import { MoonIcon, SunIcon, UnstractLogo } from "../../../assets/index.js";
+import { UnstractLogo } from "../../../assets/index.js";
import {
- THEME,
getBaseUrl,
onboardCompleted,
} from "../../../helpers/GetStaticData.js";
@@ -23,15 +13,10 @@ import "../../../layouts/page-layout/PageLayout.css";
import { useSessionStore } from "../../../store/session-store.js";
import "./TopNavBar.css";
-// const PREFERS_DARK_THEME = window.matchMedia("(prefers-color-scheme: dark)");
-
function TopNavBar() {
const navigate = useNavigate();
const { sessionDetails } = useSessionStore();
const { orgName } = sessionDetails;
- const updateSessionDetails = useSessionStore(
- (state) => state.updateSessionDetails
- );
const baseUrl = getBaseUrl();
const onBoardUrl = baseUrl + `/${orgName}/onboard`;
const logout = useLogout();
@@ -85,26 +70,6 @@ function TopNavBar() {
},
];
- useEffect(() => {
- // if (PREFERS_DARK_THEME.matches) {
- // document.body.classList.add(THEME.DARK);
- // updateTheme(THEME.DARK);
- // }
- updateTheme(THEME.LIGHT);
- }, []);
-
- function updateTheme(theme = THEME.LIGHT) {
- updateSessionDetails({ currentTheme: theme });
- }
-
- function changeTheme(checked) {
- if (checked) {
- document.body.classList.add(THEME.DARK);
- } else {
- document.body.classList.remove(THEME.DARK);
- }
- updateTheme(checked ? THEME.DARK : THEME.LIGHT);
- }
// Function to get the initials from the user name
const getInitials = (name) => {
const names = name.split(" ");
@@ -145,35 +110,23 @@ function TopNavBar() {
</Col>
<Col span={4}>
<Row justify="end" align="middle">
- <Col>
- <Switch
- onClick={changeTheme}
- // checked={currentTheme === THEME.LIGHT}
- checked={false}
- checkedChildren={<MoonIcon />}
- unCheckedChildren={<SunIcon />}
- disabled
- />
- </Col>
- <Col style={{ marginLeft: "15px" }}>
- <Dropdown menu={{ items }} placement="bottomLeft" arrow>
- <div className="top-navbar-dp">
- {sessionDetails?.picture ? (
- <Image
- className="navbar-img"
- height="100%"
- width="100%"
- preview={false}
- src={sessionDetails?.picture}
- />
- ) : (
- <Typography.Text className="initials">
- {getInitials(sessionDetails?.name)}
- </Typography.Text>
- )}
- </div>
- </Dropdown>
- </Col>
+ <Dropdown menu={{ items }} placement="bottomLeft" arrow>
+ <div className="top-navbar-dp">
+ {sessionDetails?.picture ? (
+ <Image
+ className="navbar-img"
+ height="100%"
+ width="100%"
+ preview={false}
+ src={sessionDetails?.picture}
+ />
+ ) : (
+ <Typography.Text className="initials">
+ {getInitials(sessionDetails?.name)}
+ </Typography.Text>
+ )}
+ </div>
+ </Dropdown>
</Row>
</Col>
</Row>