forked from Mirror/ollama4j
		
	Update OllamaAPI.java
This commit is contained in:
		@@ -392,8 +392,7 @@ public class OllamaAPI {
 | 
				
			|||||||
        String responseBody = response.body();
 | 
					        String responseBody = response.body();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (statusCode == 200) {
 | 
					        if (statusCode == 200) {
 | 
				
			||||||
            OllamaEmbedResponseModel embeddingResponse = Utils.getObjectMapper().readValue(responseBody, OllamaEmbedResponseModel.class);
 | 
					            return Utils.getObjectMapper().readValue(responseBody, OllamaEmbedResponseModel.class);
 | 
				
			||||||
            return embeddingResponse;
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            throw new OllamaBaseException(statusCode + " - " + responseBody);
 | 
					            throw new OllamaBaseException(statusCode + " - " + responseBody);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -561,6 +560,7 @@ public class OllamaAPI {
 | 
				
			|||||||
     * Convenience method to call Ollama API without streaming responses.
 | 
					     * Convenience method to call Ollama API without streaming responses.
 | 
				
			||||||
     * <p>
 | 
					     * <p>
 | 
				
			||||||
     * Uses {@link #generateWithImageURLs(String, String, List, Options, OllamaStreamHandler)}
 | 
					     * Uses {@link #generateWithImageURLs(String, String, List, Options, OllamaStreamHandler)}
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
     * @throws OllamaBaseException  if the response indicates an error status
 | 
					     * @throws OllamaBaseException  if the response indicates an error status
 | 
				
			||||||
     * @throws IOException          if an I/O error occurs during the HTTP request
 | 
					     * @throws IOException          if an I/O error occurs during the HTTP request
 | 
				
			||||||
     * @throws InterruptedException if the operation is interrupted
 | 
					     * @throws InterruptedException if the operation is interrupted
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user