2
0

(openai) Show textarea instead of text input for message content

This commit is contained in:
Baptiste Arnaud
2023-03-29 10:58:26 +02:00
parent 84cdf4e934
commit 50db9985c4
3 changed files with 9 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ type Props = {
moreInfoTooltip?: string
withVariableButton?: boolean
isRequired?: boolean
placeholder?: string
onChange: (value: string) => void
} & Pick<TextareaProps, 'minH'>
@@ -32,8 +33,10 @@ export const Textarea = ({
debounceTimeout = 1000,
label,
moreInfoTooltip,
placeholder,
withVariableButton = true,
isRequired,
minH,
}: Props) => {
const inputRef = useRef<HTMLTextAreaElement | null>(null)
const [isTouched, setIsTouched] = useState(false)
@@ -89,6 +92,8 @@ export const Textarea = ({
value={localValue}
onBlur={updateCarretPosition}
onChange={(e) => changeValue(e.target.value)}
placeholder={placeholder}
minH={minH}
/>
)

View File

@@ -1,5 +1,5 @@
import { DropdownList } from '@/components/DropdownList'
import { TextInput } from '@/components/inputs'
import { Textarea } from '@/components/inputs'
import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
import { TableListItemProps } from '@/components/TableList'
import { Stack } from '@chakra-ui/react'
@@ -77,10 +77,11 @@ export const ChatCompletionMessageItem = ({ item, onItemChange }: Props) => {
/>
</>
) : (
<TextInput
<Textarea
defaultValue={item.content}
onChange={changeSingleMessageContent}
placeholder="Content"
minH="150px"
/>
)}
</Stack>

View File

@@ -79,7 +79,7 @@ export const OpenAIChatCompletionSettings = ({
items={chatCompletionModels}
onItemSelect={updateModel}
/>
<Accordion allowToggle allowMultiple>
<Accordion allowMultiple>
<AccordionItem>
<AccordionButton>
<Text w="full" textAlign="left">