mirror of
https://github.com/QuivrHQ/quivr.git
synced 2025-01-07 08:07:44 +03:00
feat: api definition in brain creation modal (#1613)
# Description https://github.com/StanGirard/quivr/issues/1569 ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --------- Co-authored-by: mamadoudicko <mamadoudicko100@gmail.com>
This commit is contained in:
parent
46af5b7a1b
commit
12903c4bb4
@ -1,5 +1,5 @@
|
|||||||
import { BrainRoleType } from "@/lib/components/BrainUsers/types";
|
import { BrainRoleType } from "@/lib/components/BrainUsers/types";
|
||||||
import { BrainStatus } from "@/lib/types/brainConfig";
|
import { BrainStatus, BrainType } from "@/lib/types/brainConfig";
|
||||||
|
|
||||||
export type SubscriptionUpdatableProperties = {
|
export type SubscriptionUpdatableProperties = {
|
||||||
role: BrainRoleType | null;
|
role: BrainRoleType | null;
|
||||||
@ -14,6 +14,7 @@ export type CreateBrainInput = {
|
|||||||
max_tokens?: number;
|
max_tokens?: number;
|
||||||
openai_api_key?: string;
|
openai_api_key?: string;
|
||||||
prompt_id?: string | null;
|
prompt_id?: string | null;
|
||||||
|
brain_type?: BrainType;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdateBrainInput = Partial<CreateBrainInput>;
|
export type UpdateBrainInput = Partial<CreateBrainInput>;
|
||||||
|
@ -1,21 +1,9 @@
|
|||||||
/* eslint-disable max-lines */
|
import { FormProvider, useForm } from "react-hook-form";
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { defaultBrainConfig } from "@/lib/config/defaultBrainConfig";
|
||||||
import { MdAdd } from "react-icons/md";
|
import { BrainConfig } from "@/lib/types/brainConfig";
|
||||||
|
|
||||||
import { PublicPrompts } from "@/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/PublicPrompts";
|
import { AddBrainConfig } from "./components/AddBrainConfig/AddBrainConfig";
|
||||||
import Button from "@/lib/components/ui/Button";
|
|
||||||
import Field from "@/lib/components/ui/Field";
|
|
||||||
import { Modal } from "@/lib/components/ui/Modal";
|
|
||||||
import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens";
|
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
|
|
||||||
import { PublicAccessConfirmationModal } from "./components/PublicAccessConfirmationModal";
|
|
||||||
import { useAddBrainModal } from "./hooks/useAddBrainModal";
|
|
||||||
import { Divider } from "../ui/Divider";
|
|
||||||
import { Radio } from "../ui/Radio";
|
|
||||||
import { TextArea } from "../ui/TextArea";
|
|
||||||
|
|
||||||
type AddBrainModalProps = {
|
type AddBrainModalProps = {
|
||||||
triggerClassName?: string;
|
triggerClassName?: string;
|
||||||
@ -24,176 +12,13 @@ type AddBrainModalProps = {
|
|||||||
export const AddBrainModal = ({
|
export const AddBrainModal = ({
|
||||||
triggerClassName,
|
triggerClassName,
|
||||||
}: AddBrainModalProps): JSX.Element => {
|
}: AddBrainModalProps): JSX.Element => {
|
||||||
const { t } = useTranslation(["translation", "brain", "config"]);
|
const methods = useForm<BrainConfig>({
|
||||||
const {
|
defaultValues: defaultBrainConfig,
|
||||||
handleSubmit,
|
});
|
||||||
isShareModalOpen,
|
|
||||||
setIsShareModalOpen,
|
|
||||||
register,
|
|
||||||
temperature,
|
|
||||||
maxTokens,
|
|
||||||
model,
|
|
||||||
isPending,
|
|
||||||
pickPublicPrompt,
|
|
||||||
accessibleModels,
|
|
||||||
brainStatusOptions,
|
|
||||||
status,
|
|
||||||
isPublicAccessConfirmationModalOpened,
|
|
||||||
onCancelPublicAccess,
|
|
||||||
onConfirmPublicAccess,
|
|
||||||
} = useAddBrainModal();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<FormProvider {...methods}>
|
||||||
<Modal
|
<AddBrainConfig triggerClassName={triggerClassName} />
|
||||||
Trigger={
|
</FormProvider>
|
||||||
<Button
|
|
||||||
onClick={() => void 0}
|
|
||||||
variant={"tertiary"}
|
|
||||||
className={cn("border-0", triggerClassName)}
|
|
||||||
data-testid="add-brain-button"
|
|
||||||
>
|
|
||||||
{t("newBrain", { ns: "brain" })}
|
|
||||||
<MdAdd className="text-xl" />
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
title={t("newBrainTitle", { ns: "brain" })}
|
|
||||||
desc={t("newBrainSubtitle", { ns: "brain" })}
|
|
||||||
isOpen={isShareModalOpen}
|
|
||||||
setOpen={setIsShareModalOpen}
|
|
||||||
CloseTrigger={<div />}
|
|
||||||
>
|
|
||||||
<form
|
|
||||||
onSubmit={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
void handleSubmit();
|
|
||||||
}}
|
|
||||||
className="my-10 flex flex-col items-center gap-2"
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
label={t("brainName", { ns: "brain" })}
|
|
||||||
autoFocus
|
|
||||||
placeholder={t("brainNamePlaceholder", { ns: "brain" })}
|
|
||||||
autoComplete="off"
|
|
||||||
className="flex-1"
|
|
||||||
required
|
|
||||||
data-testid="brain-name"
|
|
||||||
{...register("name")}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextArea
|
|
||||||
label={t("brainDescription", { ns: "brain" })}
|
|
||||||
placeholder={t("brainDescriptionPlaceholder", { ns: "brain" })}
|
|
||||||
autoComplete="off"
|
|
||||||
className="flex-1 m-3"
|
|
||||||
{...register("description")}
|
|
||||||
/>
|
|
||||||
<fieldset className="w-full flex flex-col">
|
|
||||||
<Radio
|
|
||||||
items={brainStatusOptions}
|
|
||||||
label={t("brain_status_label", { ns: "brain" })}
|
|
||||||
value={status}
|
|
||||||
className="flex-1 justify-between w-[50%]"
|
|
||||||
{...register("status")}
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<Field
|
|
||||||
label={t("openAiKeyLabel", { ns: "config" })}
|
|
||||||
placeholder={t("openAiKeyPlaceholder", { ns: "config" })}
|
|
||||||
autoComplete="off"
|
|
||||||
className="flex-1"
|
|
||||||
{...register("openAiKey")}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<fieldset className="w-full flex flex-col">
|
|
||||||
<label className="flex-1 text-sm" htmlFor="model">
|
|
||||||
{t("modelLabel", { ns: "config" })}
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
id="model"
|
|
||||||
{...register("model")}
|
|
||||||
className="px-5 py-2 dark:bg-gray-700 bg-gray-200 rounded-md"
|
|
||||||
>
|
|
||||||
{accessibleModels.map((availableModel) => (
|
|
||||||
<option value={availableModel} key={availableModel}>
|
|
||||||
{availableModel}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset className="w-full flex mt-4">
|
|
||||||
<label className="flex-1" htmlFor="temp">
|
|
||||||
{t("temperature", { ns: "config" })}: {temperature}
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
id="temp"
|
|
||||||
type="range"
|
|
||||||
min="0"
|
|
||||||
max="1"
|
|
||||||
step="0.01"
|
|
||||||
value={temperature}
|
|
||||||
{...register("temperature")}
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset className="w-full flex mt-4">
|
|
||||||
<label className="flex-1" htmlFor="tokens">
|
|
||||||
{t("maxTokens", { ns: "config" })}: {maxTokens}
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="range"
|
|
||||||
min="10"
|
|
||||||
max={defineMaxTokens(model)}
|
|
||||||
value={maxTokens}
|
|
||||||
{...register("maxTokens")}
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<Divider text={t("customPromptSection", { ns: "config" })} />
|
|
||||||
<PublicPrompts onSelect={pickPublicPrompt} />
|
|
||||||
<Field
|
|
||||||
label={t("promptName", { ns: "config" })}
|
|
||||||
placeholder={t("promptNamePlaceholder", { ns: "config" })}
|
|
||||||
autoComplete="off"
|
|
||||||
className="flex-1"
|
|
||||||
{...register("prompt.title")}
|
|
||||||
/>
|
|
||||||
<TextArea
|
|
||||||
label={t("promptContent", { ns: "config" })}
|
|
||||||
placeholder={t("promptContentPlaceholder", { ns: "config" })}
|
|
||||||
autoComplete="off"
|
|
||||||
className="flex-1"
|
|
||||||
{...register("prompt.content")}
|
|
||||||
/>
|
|
||||||
<div className="flex flex-row justify-start w-full mt-4">
|
|
||||||
<label className="flex items-center">
|
|
||||||
<span className="mr-2 text-gray-700">
|
|
||||||
{t("setDefaultBrain", { ns: "brain" })}
|
|
||||||
</span>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
{...register("setDefault")}
|
|
||||||
className="form-checkbox h-5 w-5 text-indigo-600 rounded focus:ring-2 focus:ring-indigo-400"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
isLoading={isPending}
|
|
||||||
className="mt-12 self-end"
|
|
||||||
type="submit"
|
|
||||||
data-testid="create-brain-submit-button"
|
|
||||||
>
|
|
||||||
{t("createButton")}
|
|
||||||
<MdAdd className="text-xl" />
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
</Modal>
|
|
||||||
<PublicAccessConfirmationModal
|
|
||||||
opened={isPublicAccessConfirmationModalOpened}
|
|
||||||
onClose={onCancelPublicAccess}
|
|
||||||
onCancel={onCancelPublicAccess}
|
|
||||||
onConfirm={onConfirmPublicAccess}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,217 @@
|
|||||||
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
|
import { useFeatureIsOn } from "@growthbook/growthbook-react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { MdAdd } from "react-icons/md";
|
||||||
|
|
||||||
|
import { PublicPrompts } from "@/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/PublicPrompts";
|
||||||
|
import Button from "@/lib/components/ui/Button";
|
||||||
|
import Field from "@/lib/components/ui/Field";
|
||||||
|
import { Modal } from "@/lib/components/ui/Modal";
|
||||||
|
import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
import { PublicAccessConfirmationModal } from "./components/PublicAccessConfirmationModal";
|
||||||
|
import { useAddBrainConfig } from "./hooks/useAddBrainConfig";
|
||||||
|
import { useAddBrainConfigLabels } from "./hooks/useAddBrainConfigLabels";
|
||||||
|
import { Divider } from "../../../ui/Divider";
|
||||||
|
import { Radio } from "../../../ui/Radio";
|
||||||
|
import { TextArea } from "../../../ui/TextArea";
|
||||||
|
|
||||||
|
type AddBrainConfigProps = {
|
||||||
|
triggerClassName?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const AddBrainConfig = ({
|
||||||
|
triggerClassName,
|
||||||
|
}: AddBrainConfigProps): JSX.Element => {
|
||||||
|
const { t } = useTranslation(["translation", "brain", "config"]);
|
||||||
|
|
||||||
|
const brainApiIsOn = useFeatureIsOn("brain-api");
|
||||||
|
|
||||||
|
const {
|
||||||
|
isShareModalOpen,
|
||||||
|
setIsShareModalOpen,
|
||||||
|
temperature,
|
||||||
|
maxTokens,
|
||||||
|
model,
|
||||||
|
isPending,
|
||||||
|
pickPublicPrompt,
|
||||||
|
accessibleModels,
|
||||||
|
status,
|
||||||
|
isPublicAccessConfirmationModalOpened,
|
||||||
|
onCancelPublicAccess,
|
||||||
|
onConfirmPublicAccess,
|
||||||
|
brainType,
|
||||||
|
register,
|
||||||
|
handleSubmit,
|
||||||
|
} = useAddBrainConfig();
|
||||||
|
|
||||||
|
const { brainStatusOptions, knowledgeSourceOptions } =
|
||||||
|
useAddBrainConfigLabels();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Modal
|
||||||
|
Trigger={
|
||||||
|
<Button
|
||||||
|
onClick={() => void 0}
|
||||||
|
variant={"tertiary"}
|
||||||
|
className={cn("border-0", triggerClassName)}
|
||||||
|
data-testid="add-brain-button"
|
||||||
|
>
|
||||||
|
{t("newBrain", { ns: "brain" })}
|
||||||
|
<MdAdd className="text-xl" />
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
title={t("newBrainTitle", { ns: "brain" })}
|
||||||
|
desc={t("newBrainSubtitle", { ns: "brain" })}
|
||||||
|
isOpen={isShareModalOpen}
|
||||||
|
setOpen={setIsShareModalOpen}
|
||||||
|
CloseTrigger={<div />}
|
||||||
|
>
|
||||||
|
<form
|
||||||
|
onSubmit={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
void handleSubmit();
|
||||||
|
}}
|
||||||
|
className="my-10 flex flex-col items-center gap-2"
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
label={t("brainName", { ns: "brain" })}
|
||||||
|
autoFocus
|
||||||
|
placeholder={t("brainNamePlaceholder", { ns: "brain" })}
|
||||||
|
autoComplete="off"
|
||||||
|
className="flex-1"
|
||||||
|
required
|
||||||
|
data-testid="brain-name"
|
||||||
|
{...register("name")}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextArea
|
||||||
|
label={t("brainDescription", { ns: "brain" })}
|
||||||
|
placeholder={t("brainDescriptionPlaceholder", { ns: "brain" })}
|
||||||
|
autoComplete="off"
|
||||||
|
className="flex-1 m-3"
|
||||||
|
{...register("description")}
|
||||||
|
/>
|
||||||
|
<fieldset className="w-full flex flex-col">
|
||||||
|
<Radio
|
||||||
|
items={brainStatusOptions}
|
||||||
|
label={t("brain_status_label", { ns: "brain" })}
|
||||||
|
value={status}
|
||||||
|
className="flex-1 justify-between w-[50%]"
|
||||||
|
{...register("status")}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
{brainApiIsOn && (
|
||||||
|
<fieldset className="w-full flex flex-col">
|
||||||
|
<Radio
|
||||||
|
items={knowledgeSourceOptions}
|
||||||
|
label={t("knowledge_source_label", { ns: "brain" })}
|
||||||
|
value={brainType}
|
||||||
|
className="flex-1 justify-between w-[50%]"
|
||||||
|
{...register("brainType")}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
)}
|
||||||
|
<Field
|
||||||
|
label={t("openAiKeyLabel", { ns: "config" })}
|
||||||
|
placeholder={t("openAiKeyPlaceholder", { ns: "config" })}
|
||||||
|
autoComplete="off"
|
||||||
|
className="flex-1"
|
||||||
|
{...register("openAiKey")}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<fieldset className="w-full flex flex-col">
|
||||||
|
<label className="flex-1 text-sm" htmlFor="model">
|
||||||
|
{t("modelLabel", { ns: "config" })}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="model"
|
||||||
|
{...register("model")}
|
||||||
|
className="px-5 py-2 dark:bg-gray-700 bg-gray-200 rounded-md"
|
||||||
|
>
|
||||||
|
{accessibleModels.map((availableModel) => (
|
||||||
|
<option value={availableModel} key={availableModel}>
|
||||||
|
{availableModel}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset className="w-full flex mt-4">
|
||||||
|
<label className="flex-1" htmlFor="temp">
|
||||||
|
{t("temperature", { ns: "config" })}: {temperature}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
id="temp"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="1"
|
||||||
|
step="0.01"
|
||||||
|
value={temperature}
|
||||||
|
{...register("temperature")}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset className="w-full flex mt-4">
|
||||||
|
<label className="flex-1" htmlFor="tokens">
|
||||||
|
{t("maxTokens", { ns: "config" })}: {maxTokens}
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="range"
|
||||||
|
min="10"
|
||||||
|
max={defineMaxTokens(model)}
|
||||||
|
value={maxTokens}
|
||||||
|
{...register("maxTokens")}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
<Divider text={t("customPromptSection", { ns: "config" })} />
|
||||||
|
<PublicPrompts onSelect={pickPublicPrompt} />
|
||||||
|
<Field
|
||||||
|
label={t("promptName", { ns: "config" })}
|
||||||
|
placeholder={t("promptNamePlaceholder", { ns: "config" })}
|
||||||
|
autoComplete="off"
|
||||||
|
className="flex-1"
|
||||||
|
{...register("prompt.title")}
|
||||||
|
/>
|
||||||
|
<TextArea
|
||||||
|
label={t("promptContent", { ns: "config" })}
|
||||||
|
placeholder={t("promptContentPlaceholder", { ns: "config" })}
|
||||||
|
autoComplete="off"
|
||||||
|
className="flex-1"
|
||||||
|
{...register("prompt.content")}
|
||||||
|
/>
|
||||||
|
<div className="flex flex-row justify-start w-full mt-4">
|
||||||
|
<label className="flex items-center">
|
||||||
|
<span className="mr-2 text-gray-700">
|
||||||
|
{t("setDefaultBrain", { ns: "brain" })}
|
||||||
|
</span>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
{...register("setDefault")}
|
||||||
|
className="form-checkbox h-5 w-5 text-indigo-600 rounded focus:ring-2 focus:ring-indigo-400"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
isLoading={isPending}
|
||||||
|
className="mt-12 self-end"
|
||||||
|
type="submit"
|
||||||
|
data-testid="create-brain-submit-button"
|
||||||
|
>
|
||||||
|
{t("createButton")}
|
||||||
|
<MdAdd className="text-xl" />
|
||||||
|
</Button>
|
||||||
|
</form>
|
||||||
|
</Modal>
|
||||||
|
<PublicAccessConfirmationModal
|
||||||
|
opened={isPublicAccessConfirmationModalOpened}
|
||||||
|
onClose={onCancelPublicAccess}
|
||||||
|
onCancel={onCancelPublicAccess}
|
||||||
|
onConfirm={onConfirmPublicAccess}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
@ -0,0 +1,53 @@
|
|||||||
|
import { Content, Root } from "@radix-ui/react-tabs";
|
||||||
|
|
||||||
|
import { BrainType } from "@/lib/types/brainConfig";
|
||||||
|
|
||||||
|
import { useApiDefinitionTabs } from "./hooks/useApiDefinitionTabs";
|
||||||
|
import { HeadersDefinition } from "./tabs/HeadersDefinition";
|
||||||
|
import { ParamsDefinition } from "./tabs/ParamsDefinition";
|
||||||
|
import { SearchParamsDefinition } from "./tabs/SearchParamsDefinition";
|
||||||
|
export const ApiRequestDefinition = (brainType: {
|
||||||
|
brainType: BrainType;
|
||||||
|
}): JSX.Element => {
|
||||||
|
const { selectedTab, setSelectedTab } = useApiDefinitionTabs();
|
||||||
|
console.log(brainType);
|
||||||
|
|
||||||
|
setSelectedTab("searchParams");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Root
|
||||||
|
className="flex flex-col w-full h-full overflow-scroll bg-white dark:bg-black p-4 md:p-10 max-w-5xl"
|
||||||
|
value={selectedTab}
|
||||||
|
>
|
||||||
|
<div className="flex gap-2 p-4">
|
||||||
|
<select
|
||||||
|
className="block w-32 px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
|
||||||
|
defaultValue="GET"
|
||||||
|
// {...register("api.method")}
|
||||||
|
>
|
||||||
|
<option value="GET">GET</option>
|
||||||
|
<option value="POST">POST</option>
|
||||||
|
<option value="PUT">PUT</option>
|
||||||
|
<option value="DELETE">DELETE</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<input
|
||||||
|
className="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
|
||||||
|
placeholder="https://api.example.com/resource"
|
||||||
|
// {...register("api.url", { required: true })}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex-1 md:pt-0 pb-0">
|
||||||
|
<Content value="people">
|
||||||
|
<SearchParamsDefinition />
|
||||||
|
</Content>
|
||||||
|
<Content value="settings">
|
||||||
|
<HeadersDefinition />
|
||||||
|
</Content>
|
||||||
|
<Content value="knowledge">
|
||||||
|
<ParamsDefinition />
|
||||||
|
</Content>
|
||||||
|
</div>
|
||||||
|
</Root>
|
||||||
|
);
|
||||||
|
};
|
@ -0,0 +1,13 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { ApiTab } from "../types";
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||||
|
export const useApiDefinitionTabs = () => {
|
||||||
|
const [selectedTab, setSelectedTab] = useState<ApiTab>("searchParams");
|
||||||
|
|
||||||
|
return {
|
||||||
|
selectedTab,
|
||||||
|
setSelectedTab,
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
export * from "./ApiRequestDefinition";
|
@ -0,0 +1,3 @@
|
|||||||
|
export const HeadersDefinition = (): JSX.Element => {
|
||||||
|
return <></>;
|
||||||
|
};
|
@ -0,0 +1,3 @@
|
|||||||
|
export const ParamsDefinition = (): JSX.Element => {
|
||||||
|
return <></>;
|
||||||
|
};
|
@ -0,0 +1,3 @@
|
|||||||
|
export const SearchParamsDefinition = (): JSX.Element => {
|
||||||
|
return <></>;
|
||||||
|
};
|
@ -0,0 +1,3 @@
|
|||||||
|
export const apiTabs = ["searchParams", "headers", "params"] as const;
|
||||||
|
|
||||||
|
export type ApiTab = (typeof apiTabs)[number];
|
@ -1,7 +1,7 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import Button from "../../ui/Button";
|
import Button from "../../../../ui/Button";
|
||||||
import { Modal } from "../../ui/Modal";
|
import { Modal } from "../../../../ui/Modal";
|
||||||
|
|
||||||
type PublicAccessConfirmationModalProps = {
|
type PublicAccessConfirmationModalProps = {
|
||||||
opened: boolean;
|
opened: boolean;
|
@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable max-lines */
|
||||||
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useFormContext } from "react-hook-form";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { PUBLIC_BRAINS_KEY } from "@/lib/api/brain/config";
|
import { PUBLIC_BRAINS_KEY } from "@/lib/api/brain/config";
|
||||||
@ -14,12 +15,11 @@ import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainConte
|
|||||||
import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens";
|
import { defineMaxTokens } from "@/lib/helpers/defineMaxTokens";
|
||||||
import { getAccessibleModels } from "@/lib/helpers/getAccessibleModels";
|
import { getAccessibleModels } from "@/lib/helpers/getAccessibleModels";
|
||||||
import { useToast } from "@/lib/hooks";
|
import { useToast } from "@/lib/hooks";
|
||||||
import { BrainStatus } from "@/lib/types/brainConfig";
|
import { BrainConfig } from "@/lib/types/brainConfig";
|
||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||||
export const useAddBrainModal = () => {
|
export const useAddBrainConfig = () => {
|
||||||
const { t } = useTranslation(["translation", "brain", "config"]);
|
const { t } = useTranslation(["brain", "config"]);
|
||||||
const [isPending, setIsPending] = useState(false);
|
const [isPending, setIsPending] = useState(false);
|
||||||
const { publish } = useToast();
|
const { publish } = useToast();
|
||||||
const { createBrain, setCurrentBrainId } = useBrainContext();
|
const { createBrain, setCurrentBrainId } = useBrainContext();
|
||||||
@ -33,20 +33,6 @@ export const useAddBrainModal = () => {
|
|||||||
const { getUser } = useUserApi();
|
const { getUser } = useUserApi();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const brainStatusOptions: {
|
|
||||||
label: string;
|
|
||||||
value: BrainStatus;
|
|
||||||
}[] = [
|
|
||||||
{
|
|
||||||
label: t("private_brain_label", { ns: "brain" }),
|
|
||||||
value: "private",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t("public_brain_label", { ns: "brain" }),
|
|
||||||
value: "public",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const { data: userData } = useQuery({
|
const { data: userData } = useQuery({
|
||||||
queryKey: [USER_DATA_KEY],
|
queryKey: [USER_DATA_KEY],
|
||||||
queryFn: getUser,
|
queryFn: getUser,
|
||||||
@ -70,15 +56,14 @@ export const useAddBrainModal = () => {
|
|||||||
watch,
|
watch,
|
||||||
setValue,
|
setValue,
|
||||||
formState: { dirtyFields },
|
formState: { dirtyFields },
|
||||||
} = useForm({
|
} = useFormContext<BrainConfig>();
|
||||||
defaultValues,
|
|
||||||
});
|
|
||||||
|
|
||||||
const openAiKey = watch("openAiKey");
|
const openAiKey = watch("openAiKey");
|
||||||
const model = watch("model");
|
const model = watch("model");
|
||||||
const temperature = watch("temperature");
|
const temperature = watch("temperature");
|
||||||
const maxTokens = watch("maxTokens");
|
const maxTokens = watch("maxTokens");
|
||||||
const status = watch("status");
|
const status = watch("status");
|
||||||
|
const brainType = watch("brainType");
|
||||||
|
|
||||||
const accessibleModels = getAccessibleModels({
|
const accessibleModels = getAccessibleModels({
|
||||||
openAiKey,
|
openAiKey,
|
||||||
@ -86,10 +71,10 @@ export const useAddBrainModal = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (status === "public" && dirtyFields.status) {
|
if (status === "public" && dirtyFields.status === true) {
|
||||||
setIsPublicAccessConfirmationModalOpened(true);
|
setIsPublicAccessConfirmationModalOpened(true);
|
||||||
}
|
}
|
||||||
}, [status]);
|
}, [dirtyFields.status, status]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setValue("maxTokens", Math.min(maxTokens, defineMaxTokens(model)));
|
setValue("maxTokens", Math.min(maxTokens, defineMaxTokens(model)));
|
||||||
@ -131,6 +116,7 @@ export const useAddBrainModal = () => {
|
|||||||
temperature,
|
temperature,
|
||||||
prompt_id,
|
prompt_id,
|
||||||
status,
|
status,
|
||||||
|
brain_type: brainType,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (createdBrainId === undefined) {
|
if (createdBrainId === undefined) {
|
||||||
@ -211,17 +197,17 @@ export const useAddBrainModal = () => {
|
|||||||
isShareModalOpen,
|
isShareModalOpen,
|
||||||
setIsShareModalOpen,
|
setIsShareModalOpen,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
register,
|
|
||||||
model,
|
model,
|
||||||
temperature,
|
temperature,
|
||||||
maxTokens,
|
maxTokens,
|
||||||
isPending,
|
isPending,
|
||||||
accessibleModels,
|
accessibleModels,
|
||||||
pickPublicPrompt,
|
pickPublicPrompt,
|
||||||
brainStatusOptions,
|
|
||||||
status,
|
status,
|
||||||
isPublicAccessConfirmationModalOpened,
|
isPublicAccessConfirmationModalOpened,
|
||||||
onConfirmPublicAccess,
|
onConfirmPublicAccess,
|
||||||
onCancelPublicAccess,
|
onCancelPublicAccess,
|
||||||
|
brainType,
|
||||||
|
register,
|
||||||
};
|
};
|
||||||
};
|
};
|
@ -0,0 +1,40 @@
|
|||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
import { BrainStatus, BrainType } from "@/lib/types/brainConfig";
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||||
|
export const useAddBrainConfigLabels = () => {
|
||||||
|
const { t } = useTranslation(["translation", "brain", "config"]);
|
||||||
|
|
||||||
|
const brainStatusOptions: {
|
||||||
|
label: string;
|
||||||
|
value: BrainStatus;
|
||||||
|
}[] = [
|
||||||
|
{
|
||||||
|
label: t("private_brain_label", { ns: "brain" }),
|
||||||
|
value: "private",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t("public_brain_label", { ns: "brain" }),
|
||||||
|
value: "public",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const knowledgeSourceOptions: {
|
||||||
|
label: string;
|
||||||
|
value: BrainType;
|
||||||
|
}[] = [
|
||||||
|
{
|
||||||
|
label: t("knowledge_source_doc", { ns: "brain" }),
|
||||||
|
value: "doc",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t("knowledge_source_api", { ns: "brain" }),
|
||||||
|
value: "api",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
brainStatusOptions,
|
||||||
|
knowledgeSourceOptions,
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
export * from "./AddBrainConfig";
|
@ -0,0 +1 @@
|
|||||||
|
export * from "./AddBrainConfig";
|
@ -1,3 +0,0 @@
|
|||||||
.foo {
|
|
||||||
white-space: 'pre-wrap';
|
|
||||||
}
|
|
@ -6,6 +6,7 @@ import config_en from "../../../public/locales/en/config.json";
|
|||||||
import contact_en from "../../../public/locales/en/contact.json";
|
import contact_en from "../../../public/locales/en/contact.json";
|
||||||
import delete_brain_en from "../../../public/locales/en/deleteOrUnsubscribeFromBrain.json";
|
import delete_brain_en from "../../../public/locales/en/deleteOrUnsubscribeFromBrain.json";
|
||||||
import explore_en from "../../../public/locales/en/explore.json";
|
import explore_en from "../../../public/locales/en/explore.json";
|
||||||
|
import external_api_definition_en from "../../../public/locales/en/external_api_definition.json";
|
||||||
import home_en from "../../../public/locales/en/home.json";
|
import home_en from "../../../public/locales/en/home.json";
|
||||||
import invitation_en from "../../../public/locales/en/invitation.json";
|
import invitation_en from "../../../public/locales/en/invitation.json";
|
||||||
import knowlegde_en from "../../../public/locales/en/knowledge.json";
|
import knowlegde_en from "../../../public/locales/en/knowledge.json";
|
||||||
@ -22,6 +23,7 @@ import config_es from "../../../public/locales/es/config.json";
|
|||||||
import contact_es from "../../../public/locales/es/contact.json";
|
import contact_es from "../../../public/locales/es/contact.json";
|
||||||
import delete_brain_es from "../../../public/locales/es/deleteOrUnsubscribeFromBrain.json";
|
import delete_brain_es from "../../../public/locales/es/deleteOrUnsubscribeFromBrain.json";
|
||||||
import explore_es from "../../../public/locales/es/explore.json";
|
import explore_es from "../../../public/locales/es/explore.json";
|
||||||
|
import external_api_definition_es from "../../../public/locales/es/external_api_definition.json";
|
||||||
import home_es from "../../../public/locales/es/home.json";
|
import home_es from "../../../public/locales/es/home.json";
|
||||||
import invitation_es from "../../../public/locales/es/invitation.json";
|
import invitation_es from "../../../public/locales/es/invitation.json";
|
||||||
import knowlegde_es from "../../../public/locales/es/knowledge.json";
|
import knowlegde_es from "../../../public/locales/es/knowledge.json";
|
||||||
@ -38,6 +40,7 @@ import config_fr from "../../../public/locales/fr/config.json";
|
|||||||
import contact_fr from "../../../public/locales/fr/contact.json";
|
import contact_fr from "../../../public/locales/fr/contact.json";
|
||||||
import delete_brain_fr from "../../../public/locales/fr/deleteOrUnsubscribeFromBrain.json";
|
import delete_brain_fr from "../../../public/locales/fr/deleteOrUnsubscribeFromBrain.json";
|
||||||
import explore_fr from "../../../public/locales/fr/explore.json";
|
import explore_fr from "../../../public/locales/fr/explore.json";
|
||||||
|
import external_api_definition_fr from "../../../public/locales/fr/external_api_definition.json";
|
||||||
import home_fr from "../../../public/locales/fr/home.json";
|
import home_fr from "../../../public/locales/fr/home.json";
|
||||||
import invitation_fr from "../../../public/locales/fr/invitation.json";
|
import invitation_fr from "../../../public/locales/fr/invitation.json";
|
||||||
import knowlegde_fr from "../../../public/locales/fr/knowledge.json";
|
import knowlegde_fr from "../../../public/locales/fr/knowledge.json";
|
||||||
@ -54,6 +57,7 @@ import config_ptbr from "../../../public/locales/pt-br/config.json";
|
|||||||
import contact_ptbr from "../../../public/locales/pt-br/contact.json";
|
import contact_ptbr from "../../../public/locales/pt-br/contact.json";
|
||||||
import delete_brain_ptbr from "../../../public/locales/pt-br/deleteOrUnsubscribeFromBrain.json";
|
import delete_brain_ptbr from "../../../public/locales/pt-br/deleteOrUnsubscribeFromBrain.json";
|
||||||
import explore_ptbr from "../../../public/locales/pt-br/explore.json";
|
import explore_ptbr from "../../../public/locales/pt-br/explore.json";
|
||||||
|
import external_api_definition_ptbr from "../../../public/locales/pt-br/external_api_definition.json";
|
||||||
import home_ptbr from "../../../public/locales/pt-br/home.json";
|
import home_ptbr from "../../../public/locales/pt-br/home.json";
|
||||||
import invitation_ptbr from "../../../public/locales/pt-br/invitation.json";
|
import invitation_ptbr from "../../../public/locales/pt-br/invitation.json";
|
||||||
import knowlegde_ptbr from "../../../public/locales/pt-br/knowledge.json";
|
import knowlegde_ptbr from "../../../public/locales/pt-br/knowledge.json";
|
||||||
@ -70,6 +74,7 @@ import config_ru from "../../../public/locales/ru/config.json";
|
|||||||
import contact_ru from "../../../public/locales/ru/contact.json";
|
import contact_ru from "../../../public/locales/ru/contact.json";
|
||||||
import delete_brain_ru from "../../../public/locales/ru/deleteOrUnsubscribeFromBrain.json";
|
import delete_brain_ru from "../../../public/locales/ru/deleteOrUnsubscribeFromBrain.json";
|
||||||
import explore_ru from "../../../public/locales/ru/explore.json";
|
import explore_ru from "../../../public/locales/ru/explore.json";
|
||||||
|
import external_api_definition_ru from "../../../public/locales/ru/external_api_definition.json";
|
||||||
import home_ru from "../../../public/locales/ru/home.json";
|
import home_ru from "../../../public/locales/ru/home.json";
|
||||||
import invitation_ru from "../../../public/locales/ru/invitation.json";
|
import invitation_ru from "../../../public/locales/ru/invitation.json";
|
||||||
import knowlegde_ru from "../../../public/locales/ru/knowledge.json";
|
import knowlegde_ru from "../../../public/locales/ru/knowledge.json";
|
||||||
@ -86,6 +91,7 @@ import config_zh_cn from "../../../public/locales/zh-cn/config.json";
|
|||||||
import contact_zh_cn from "../../../public/locales/zh-cn/contact.json";
|
import contact_zh_cn from "../../../public/locales/zh-cn/contact.json";
|
||||||
import delete_brain_zh_cn from "../../../public/locales/zh-cn/deleteOrUnsubscribeFromBrain.json";
|
import delete_brain_zh_cn from "../../../public/locales/zh-cn/deleteOrUnsubscribeFromBrain.json";
|
||||||
import explore_zh_cn from "../../../public/locales/zh-cn/explore.json";
|
import explore_zh_cn from "../../../public/locales/zh-cn/explore.json";
|
||||||
|
import external_api_definition_zh_cn from "../../../public/locales/zh-cn/external_api_definition.json";
|
||||||
import home_zh_cn from "../../../public/locales/zh-cn/home.json";
|
import home_zh_cn from "../../../public/locales/zh-cn/home.json";
|
||||||
import invitation_zh_cn from "../../../public/locales/zh-cn/invitation.json";
|
import invitation_zh_cn from "../../../public/locales/zh-cn/invitation.json";
|
||||||
import knowlegde_zh_cn from "../../../public/locales/zh-cn/knowledge.json";
|
import knowlegde_zh_cn from "../../../public/locales/zh-cn/knowledge.json";
|
||||||
@ -113,6 +119,7 @@ export type Translations = {
|
|||||||
upload: typeof import("../../../public/locales/en/upload.json");
|
upload: typeof import("../../../public/locales/en/upload.json");
|
||||||
user: typeof import("../../../public/locales/en/user.json");
|
user: typeof import("../../../public/locales/en/user.json");
|
||||||
knowledge: typeof import("../../../public/locales/en/knowledge.json");
|
knowledge: typeof import("../../../public/locales/en/knowledge.json");
|
||||||
|
external_api_definition: typeof import("../../../public/locales/en/external_api_definition.json");
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SupportedLanguages {
|
enum SupportedLanguages {
|
||||||
@ -142,6 +149,7 @@ export const resources: Record<SupportedLanguages, Translations> = {
|
|||||||
user: user_en,
|
user: user_en,
|
||||||
delete_or_unsubscribe_from_brain: delete_brain_en,
|
delete_or_unsubscribe_from_brain: delete_brain_en,
|
||||||
knowledge: knowlegde_en,
|
knowledge: knowlegde_en,
|
||||||
|
external_api_definition: external_api_definition_en,
|
||||||
},
|
},
|
||||||
es: {
|
es: {
|
||||||
brain: brain_es,
|
brain: brain_es,
|
||||||
@ -159,6 +167,7 @@ export const resources: Record<SupportedLanguages, Translations> = {
|
|||||||
user: user_es,
|
user: user_es,
|
||||||
delete_or_unsubscribe_from_brain: delete_brain_es,
|
delete_or_unsubscribe_from_brain: delete_brain_es,
|
||||||
knowledge: knowlegde_es,
|
knowledge: knowlegde_es,
|
||||||
|
external_api_definition: external_api_definition_es,
|
||||||
},
|
},
|
||||||
fr: {
|
fr: {
|
||||||
brain: brain_fr,
|
brain: brain_fr,
|
||||||
@ -176,6 +185,7 @@ export const resources: Record<SupportedLanguages, Translations> = {
|
|||||||
user: user_fr,
|
user: user_fr,
|
||||||
delete_or_unsubscribe_from_brain: delete_brain_fr,
|
delete_or_unsubscribe_from_brain: delete_brain_fr,
|
||||||
knowledge: knowlegde_fr,
|
knowledge: knowlegde_fr,
|
||||||
|
external_api_definition: external_api_definition_fr,
|
||||||
},
|
},
|
||||||
ptbr: {
|
ptbr: {
|
||||||
brain: brain_ptbr,
|
brain: brain_ptbr,
|
||||||
@ -193,6 +203,7 @@ export const resources: Record<SupportedLanguages, Translations> = {
|
|||||||
user: user_ptbr,
|
user: user_ptbr,
|
||||||
delete_or_unsubscribe_from_brain: delete_brain_ptbr,
|
delete_or_unsubscribe_from_brain: delete_brain_ptbr,
|
||||||
knowledge: knowlegde_ptbr,
|
knowledge: knowlegde_ptbr,
|
||||||
|
external_api_definition: external_api_definition_ptbr,
|
||||||
},
|
},
|
||||||
ru: {
|
ru: {
|
||||||
brain: brain_ru,
|
brain: brain_ru,
|
||||||
@ -210,6 +221,7 @@ export const resources: Record<SupportedLanguages, Translations> = {
|
|||||||
user: user_ru,
|
user: user_ru,
|
||||||
delete_or_unsubscribe_from_brain: delete_brain_ru,
|
delete_or_unsubscribe_from_brain: delete_brain_ru,
|
||||||
knowledge: knowlegde_ru,
|
knowledge: knowlegde_ru,
|
||||||
|
external_api_definition: external_api_definition_ru,
|
||||||
},
|
},
|
||||||
zh_cn: {
|
zh_cn: {
|
||||||
brain: brain_zh_cn,
|
brain: brain_zh_cn,
|
||||||
@ -227,5 +239,6 @@ export const resources: Record<SupportedLanguages, Translations> = {
|
|||||||
user: user_zh_cn,
|
user: user_zh_cn,
|
||||||
delete_or_unsubscribe_from_brain: delete_brain_zh_cn,
|
delete_or_unsubscribe_from_brain: delete_brain_zh_cn,
|
||||||
knowledge: knowlegde_zh_cn,
|
knowledge: knowlegde_zh_cn,
|
||||||
|
external_api_definition: external_api_definition_zh_cn,
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -19,4 +19,5 @@ export const defaultBrainConfig: BrainConfig = {
|
|||||||
name: "",
|
name: "",
|
||||||
description: "",
|
description: "",
|
||||||
setDefault: false,
|
setDefault: false,
|
||||||
|
brainType: "doc",
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,10 @@ export const brainStatuses = ["private", "public"] as const;
|
|||||||
|
|
||||||
export type BrainStatus = (typeof brainStatuses)[number];
|
export type BrainStatus = (typeof brainStatuses)[number];
|
||||||
|
|
||||||
|
export const brainTypes = ["doc", "api"] as const;
|
||||||
|
|
||||||
|
export type BrainType = (typeof brainTypes)[number];
|
||||||
|
|
||||||
export type BrainConfig = {
|
export type BrainConfig = {
|
||||||
model: Model;
|
model: Model;
|
||||||
temperature: number;
|
temperature: number;
|
||||||
@ -14,6 +18,7 @@ export type BrainConfig = {
|
|||||||
supabaseKey?: string;
|
supabaseKey?: string;
|
||||||
prompt_id?: string;
|
prompt_id?: string;
|
||||||
status: BrainStatus;
|
status: BrainStatus;
|
||||||
|
brainType: BrainType;
|
||||||
prompt: {
|
prompt: {
|
||||||
title: string;
|
title: string;
|
||||||
content: string;
|
content: string;
|
||||||
|
@ -46,5 +46,8 @@
|
|||||||
"confirm_set_brain_status_to_private": "Yes, set as private",
|
"confirm_set_brain_status_to_private": "Yes, set as private",
|
||||||
"cancel_set_brain_status_to_private": "No, keep it public",
|
"cancel_set_brain_status_to_private": "No, keep it public",
|
||||||
"empty_brain_description": "No description",
|
"empty_brain_description": "No description",
|
||||||
"myBrains":"My Brains"
|
"myBrains": "My Brains",
|
||||||
|
"knowledge_source_doc": "Documents",
|
||||||
|
"knowledge_source_api": "API",
|
||||||
|
"knowledge_source_label": "Knowledge source"
|
||||||
}
|
}
|
10
frontend/public/locales/en/external_api_definition.json
Normal file
10
frontend/public/locales/en/external_api_definition.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"method_label": "Method",
|
||||||
|
"url_placeholder": "URL",
|
||||||
|
"searchParams": "Search Params",
|
||||||
|
"headers": "Headers",
|
||||||
|
"params": "Params",
|
||||||
|
"key": "Key",
|
||||||
|
"type": "Type (string or number)",
|
||||||
|
"description": "Description"
|
||||||
|
}
|
@ -46,5 +46,8 @@
|
|||||||
"cancel_set_brain_status_to_private": "No, mantenerlo público",
|
"cancel_set_brain_status_to_private": "No, mantenerlo público",
|
||||||
"brain_management_button_label": "Gestionar cerebro",
|
"brain_management_button_label": "Gestionar cerebro",
|
||||||
"empty_brain_description": "Sin descripción",
|
"empty_brain_description": "Sin descripción",
|
||||||
"myBrains": "Mis cerebros"
|
"myBrains": "Mis cerebros",
|
||||||
|
"knowledge_source_doc": "Documentos",
|
||||||
|
"knowledge_source_api": "API",
|
||||||
|
"knowledge_source_label": "Fuente de conocimiento"
|
||||||
}
|
}
|
10
frontend/public/locales/es/external_api_definition.json
Normal file
10
frontend/public/locales/es/external_api_definition.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"method_label": "Method",
|
||||||
|
"url_placeholder": "URL",
|
||||||
|
"searchParams": "Search Params",
|
||||||
|
"headers": "Headers",
|
||||||
|
"params": "Params",
|
||||||
|
"key": "Key",
|
||||||
|
"type": "Type (string or number)",
|
||||||
|
"description": "Description"
|
||||||
|
}
|
@ -46,5 +46,8 @@
|
|||||||
"cancel_set_brain_status_to_private": "Non, le laisser public",
|
"cancel_set_brain_status_to_private": "Non, le laisser public",
|
||||||
"brain_management_button_label": "Gestion des cerveaux",
|
"brain_management_button_label": "Gestion des cerveaux",
|
||||||
"empty_brain_description": "Pas de description",
|
"empty_brain_description": "Pas de description",
|
||||||
"myBrains": "Mes cerveaux"
|
"myBrains": "Mes cerveaux",
|
||||||
|
"knowledge_source_doc": "Documents",
|
||||||
|
"knowledge_source_api": "API",
|
||||||
|
"knowledge_source_label": "Source de connaissance"
|
||||||
}
|
}
|
10
frontend/public/locales/fr/external_api_definition.json
Normal file
10
frontend/public/locales/fr/external_api_definition.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"method_label": "Method",
|
||||||
|
"url_placeholder": "URL",
|
||||||
|
"searchParams": "Search Params",
|
||||||
|
"headers": "Headers",
|
||||||
|
"params": "Params",
|
||||||
|
"key": "Key",
|
||||||
|
"type": "Type (string or number)",
|
||||||
|
"description": "Description"
|
||||||
|
}
|
@ -46,5 +46,8 @@
|
|||||||
"cancel_set_brain_status_to_private": "Não, mantê-lo público",
|
"cancel_set_brain_status_to_private": "Não, mantê-lo público",
|
||||||
"brain_management_button_label": "Gerenciamento de cérebros",
|
"brain_management_button_label": "Gerenciamento de cérebros",
|
||||||
"empty_brain_description": "Sem descrição",
|
"empty_brain_description": "Sem descrição",
|
||||||
"myBrains": "Meus cérebros"
|
"myBrains": "Meus cérebros",
|
||||||
|
"knowledge_source_doc": "Documentos",
|
||||||
|
"knowledge_source_api": "API",
|
||||||
|
"knowledge_source_label": "Fonte de conhecimento"
|
||||||
}
|
}
|
10
frontend/public/locales/pt-br/external_api_definition.json
Normal file
10
frontend/public/locales/pt-br/external_api_definition.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"method_label": "Method",
|
||||||
|
"url_placeholder": "URL",
|
||||||
|
"searchParams": "Search Params",
|
||||||
|
"headers": "Headers",
|
||||||
|
"params": "Params",
|
||||||
|
"key": "Key",
|
||||||
|
"type": "Type (string or number)",
|
||||||
|
"description": "Description"
|
||||||
|
}
|
@ -46,5 +46,8 @@
|
|||||||
"cancel_set_brain_status_to_private": "Нет, оставить общедоступным",
|
"cancel_set_brain_status_to_private": "Нет, оставить общедоступным",
|
||||||
"brain_management_button_label": "Управление мозгом",
|
"brain_management_button_label": "Управление мозгом",
|
||||||
"empty_brain_description": "Нет описания",
|
"empty_brain_description": "Нет описания",
|
||||||
"myBrains": "Мои мозги"
|
"myBrains": "Мои мозги",
|
||||||
|
"knowledge_source_doc": "Документы",
|
||||||
|
"knowledge_source_api": "API",
|
||||||
|
"knowledge_source_label": "Источник знаний"
|
||||||
}
|
}
|
10
frontend/public/locales/ru/external_api_definition.json
Normal file
10
frontend/public/locales/ru/external_api_definition.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"method_label": "Method",
|
||||||
|
"url_placeholder": "URL",
|
||||||
|
"searchParams": "Search Params",
|
||||||
|
"headers": "Headers",
|
||||||
|
"params": "Params",
|
||||||
|
"key": "Key",
|
||||||
|
"type": "Type (string or number)",
|
||||||
|
"description": "Description"
|
||||||
|
}
|
@ -46,5 +46,8 @@
|
|||||||
"cancel_set_brain_status_to_private": "不,保持公开",
|
"cancel_set_brain_status_to_private": "不,保持公开",
|
||||||
"brain_management_button_label": "管理",
|
"brain_management_button_label": "管理",
|
||||||
"empty_brain_description": "无描述",
|
"empty_brain_description": "无描述",
|
||||||
"myBrains": "我的大脑"
|
"myBrains": "我的大脑",
|
||||||
|
"knowledge_source_doc": "文档",
|
||||||
|
"knowledge_source_api": "API",
|
||||||
|
"knowledge_source_label": "知识来源"
|
||||||
}
|
}
|
10
frontend/public/locales/zh-cn/external_api_definition.json
Normal file
10
frontend/public/locales/zh-cn/external_api_definition.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"method_label": "Method",
|
||||||
|
"url_placeholder": "URL",
|
||||||
|
"searchParams": "Search Params",
|
||||||
|
"headers": "Headers",
|
||||||
|
"params": "Params",
|
||||||
|
"key": "Key",
|
||||||
|
"type": "Type (string or number)",
|
||||||
|
"description": "Description"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user