Skip to content

Commit eabd4d9

Browse files
Fix URL formatting for OpenAI compatible API
1 parent ca210f1 commit eabd4d9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/llm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ R_IPI const char *r2ai_get_provider_url(RCore *core, const char *provider) {
178178
if (R_STR_ISNOTEMPTY (host)) {
179179
if (r_str_startswith (host, "http")) {
180180
if (p->api_type == R2AI_API_OPENAI_COMPATIBLE) {
181+
if (r_str_endswith (host, "/v1")) {
182+
return r_str_newf ("%s", host);
183+
}
181184
return r_str_newf ("%s/v1", host);
182185
}
183186
return r_str_newf ("%s/api", host);

0 commit comments

Comments
 (0)