Skip to content

Commit

Permalink
fix: ollama host overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
carlrobertoh committed Sep 11, 2024
1 parent 03648e9 commit 6b7e264
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ private void processStreamRequest(
private HttpRequest buildPostHttpRequest(
Object request,
String path) throws JsonProcessingException {
var requestBuilder = HttpRequest.newBuilder(URI.create(BASE_URL + path))
var baseHost = port == null ? BASE_URL : format("http://localhost:%d", port);
var requestBuilder = HttpRequest.newBuilder(URI.create((host == null ? baseHost : host) + path))
.POST(HttpRequest.BodyPublishers.ofString(new ObjectMapper().writeValueAsString(request)))
.header("Content-Type", "application/x-ndjson");

Expand Down

0 comments on commit 6b7e264

Please sign in to comment.