Skip to content

Commit 94c04b4

Browse files
authored
Merge pull request #2194 from Creative-Geek/patch-1
Allow Usage of OpenAI Compatible APIs
2 parents 54ed067 + c8edcd3 commit 94c04b4

File tree

1 file changed

+2
-2
lines changed
  • apps/client/src/pages/dashboard/settings/_sections

1 file changed

+2
-2
lines changed

apps/client/src/pages/dashboard/settings/_sections/openai.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ const formSchema = z.object({
2222
apiKey: z
2323
.string()
2424
// eslint-disable-next-line lingui/no-unlocalized-strings
25-
.regex(/^sk-.+$/, "That doesn't look like a valid OpenAI API key.")
25+
.min(1, "API key cannot be empty.") //allow api keys like hf-.. and gsk_..
2626
.default(""),
2727
baseURL: z
2828
.string()
2929
// eslint-disable-next-line lingui/no-unlocalized-strings
30-
.regex(/^https?:\/\/[^/]+\/?$/, "That doesn't look like a valid URL")
30+
.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/
3131
.or(z.literal(""))
3232
.default(""),
3333
model: z.string().default(DEFAULT_MODEL),

0 commit comments

Comments
 (0)