Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(ui): fix create new model label (#1005)

Richard Krümmel23bc448088b0
diff --git a/src/features/models/components/NewModelForm.tsx b/src/features/models/components/NewModelForm.tsx
index c200743840..d173cb0a51 100644
--- a/src/features/models/components/NewModelForm.tsx
+++ b/src/features/models/components/NewModelForm.tsx
@@ -171,6 +171,7 @@ export const NewModelForm = (props: {
onValueChange={(option) => field.onChange(option.value)}
value={{ value: field.value, label: field.value }}
disabled={false}
+ createLabel="Create a new model name"
/>
</FormControl>
<FormDescription>
diff --git a/src/features/prompts/components/auto-complete.tsx b/src/features/prompts/components/auto-complete.tsx
index 9555942a5d..267890bf13 100644
--- a/src/features/prompts/components/auto-complete.tsx
+++ b/src/features/prompts/components/auto-complete.tsx
@@ -23,6 +23,7 @@ type AutoCompleteProps = {
onValueChange?: (value: AutoCompleteOption) => void;
disabled?: boolean;
placeholder?: string;
+ createLabel: string;
};
export const AutoComplete = ({
@@ -31,6 +32,7 @@ export const AutoComplete = ({
value,
onValueChange,
disabled,
+ createLabel,
}: AutoCompleteProps) => {
const inputRef = useRef<HTMLInputElement>(null);
const [isOpen, setOpen] = useState(false);
@@ -138,6 +140,7 @@ export const AutoComplete = ({
onSelect={() =>
handleSelectOption({ value: inputValue, label: inputValue })
}
+ createLabel={createLabel}
{...{ inputValue, options }}
/>
</CommandList>
@@ -151,11 +154,13 @@ export const AutoComplete = ({
const CommandItemCreate = ({
inputValue,
options,
+ createLabel,
onSelect,
onMouseDown,
}: {
inputValue: string;
options: AutoCompleteOption[];
+ createLabel: string;
onSelect: () => void;
onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
}) => {
@@ -176,7 +181,7 @@ const CommandItemCreate = ({
onMouseDown={onMouseDown}
>
<div className={cn("m-2 h-4 w-4")} />
- Create new prompt name: &quot;{inputValue}&quot;
+ {createLabel}: &quot;{inputValue}&quot;
</CommandItem>
);
};
diff --git a/src/features/prompts/components/new-prompt-button.tsx b/src/features/prompts/components/new-prompt-button.tsx
index 1a960e8bc0..1a865a4ae2 100644
--- a/src/features/prompts/components/new-prompt-button.tsx
+++ b/src/features/prompts/components/new-prompt-button.tsx
@@ -191,6 +191,7 @@ export const NewPromptForm = (props: {
onValueChange={setNameValue}
value={{ value: field.value, label: field.value }}
disabled={false}
+ createLabel="Create a new prompt name"
/>
</FormControl>
<FormMessage />