mirror of
https://github.com/zebrajr/Reactive-Resume.git
synced 2025-12-06 12:20:18 +01:00
Allow usage of openai compatible apis
Changed front-end fields verification to allow the user to enter any openai compatible endpoint and api key. to do: make a verify connection button and edit paragraphs to reflect the change
This commit is contained in:
parent
e795ec64d6
commit
c8edcd3dad
|
|
@ -22,12 +22,12 @@ const formSchema = z.object({
|
||||||
apiKey: z
|
apiKey: z
|
||||||
.string()
|
.string()
|
||||||
// eslint-disable-next-line lingui/no-unlocalized-strings
|
// eslint-disable-next-line lingui/no-unlocalized-strings
|
||||||
.regex(/^sk-.+$/, "That doesn't look like a valid OpenAI API key.")
|
.min(1, "API key cannot be empty.") //allow api keys like hf-.. and gsk_..
|
||||||
.default(""),
|
.default(""),
|
||||||
baseURL: z
|
baseURL: z
|
||||||
.string()
|
.string()
|
||||||
// eslint-disable-next-line lingui/no-unlocalized-strings
|
// eslint-disable-next-line lingui/no-unlocalized-strings
|
||||||
.regex(/^https?:\/\/[^/]+\/?$/, "That doesn't look like a valid URL")
|
.regex(/^https?:\/\/[^\s]+$/, "That doesn't look like a valid URL") //allow different openai compatible endpoints like https://api.groq.com/openai/v1 and https://api-inference.huggingface.co/v1/
|
||||||
.or(z.literal(""))
|
.or(z.literal(""))
|
||||||
.default(""),
|
.default(""),
|
||||||
model: z.string().default(DEFAULT_MODEL),
|
model: z.string().default(DEFAULT_MODEL),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user