Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
CustomModelRequest.java
Go to the documentation of this file.
1/*
2 * Ollama4j - Java library for interacting with Ollama server.
3 * Copyright (c) 2025 Amith Koujalgi and contributors.
4 *
5 * Licensed under the MIT License (the "License");
6 * you may not use this file except in compliance with the License.
7 *
8*/
9package io.github.ollama4j.models.request;
10
11import static io.github.ollama4j.utils.Utils.getObjectMapper;
12
13import com.fasterxml.jackson.core.JsonProcessingException;
14import java.util.List;
15import java.util.Map;
16import lombok.AllArgsConstructor;
17import lombok.Builder;
18import lombok.Data;
19
20@Data
21@AllArgsConstructor
22@Builder
23public class CustomModelRequest {
24 private String model;
25 private String from;
26 private Map<String, String> files;
27 private Map<String, String> adapters;
28 private String template;
29 private Object license;
30 private String system;
31 private Map<String, Object> parameters;
32 private List<Object> messages;
33 private Boolean stream;
34 private Boolean quantize;
35
37 this.stream = true;
38 this.quantize = false;
39 }
40
41 @Override
42 public String toString() {
43 try {
44 return getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
45 } catch (JsonProcessingException e) {
46 throw new RuntimeException(e);
47 }
48 }
49}