2023-12-13 10:22:02 +01:00
|
|
|
import { createAuth, option } from '@typebot.io/forge'
|
|
|
|
|
|
|
|
export const auth = createAuth({
|
|
|
|
type: 'encryptedCredentials',
|
|
|
|
name: 'OpenAI account',
|
|
|
|
schema: option.object({
|
|
|
|
apiKey: option.string.layout({
|
|
|
|
isRequired: true,
|
|
|
|
label: 'API key',
|
|
|
|
placeholder: 'sk-...',
|
2024-03-01 15:33:22 +01:00
|
|
|
inputType: 'password',
|
2023-12-13 10:22:02 +01:00
|
|
|
helperText:
|
|
|
|
'You can generate an API key [here](https://platform.openai.com/account/api-keys)',
|
|
|
|
withVariableButton: false,
|
2024-03-15 14:28:12 +01:00
|
|
|
isDebounceDisabled: true,
|
2023-12-13 10:22:02 +01:00
|
|
|
}),
|
2024-08-21 16:07:30 +02:00
|
|
|
baseUrl: option.string.layout({
|
|
|
|
label: 'Base URL',
|
|
|
|
defaultValue: 'https://api.openai.com/v1',
|
|
|
|
moreInfoTooltip:
|
|
|
|
'Use a different URL prefix for API calls, e.g. to use proxy servers.',
|
2024-08-22 15:31:05 +02:00
|
|
|
withVariableButton: false,
|
|
|
|
isDebounceDisabled: true,
|
2024-08-21 16:07:30 +02:00
|
|
|
}),
|
2023-12-13 10:22:02 +01:00
|
|
|
}),
|
|
|
|
})
|