Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
ModelRequest.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 lombok.AllArgsConstructor;
15import lombok.Data;
16
17@Data
18@AllArgsConstructor
19public class ModelRequest {
20 private String name;
21
22 @Override
23 public String toString() {
24 try {
25 return getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
26 } catch (JsonProcessingException e) {
27 throw new RuntimeException(e);
28 }
29 }
30}