File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -785,11 +785,15 @@ R_IPI const char *r2ai_get_provider_url(RCore *core, const char *provider) {
785
785
return "https://generativelanguage.googleapis.com/v1beta/openai" ;
786
786
} else if (strcmp (provider , "ollama" ) == 0 ) {
787
787
if (R_STR_ISNOTEMPTY (host )) {
788
- int port = r_config_get_i (core -> config , "r2ai.port" );
789
- if (r_str_startswith (host , "http" )) {
790
- return r_str_newf ("%s:%d/api" , host , port );
788
+ if (strchr (host , ':' )) {
789
+ return r_str_newf ("%s/api" , host );
790
+ } else {
791
+ int port = r_config_get_i (core -> config , "r2ai.port" );
792
+ if (r_str_startswith (host , "http" )) {
793
+ return r_str_newf ("%s:%d/api" , host , port );
794
+ }
795
+ return r_str_newf ("http://%s:%d/api" , host , port );
791
796
}
792
- return r_str_newf ("http://%s:%d/api" , host , port );
793
797
}
794
798
return "http://localhost:11434/api" ;
795
799
} else if (strcmp (provider , "xai" ) == 0 ) {
You can’t perform that action at this time.
0 commit comments