Updates to javadoc

This commit is contained in:
Amith Koujalgi 2024-02-12 22:03:01 +05:30
parent d716b81342
commit 65f00defcf
3 changed files with 19 additions and 21 deletions

View File

@ -3,9 +3,9 @@ package io.github.amithkoujalgi.ollama4j.core;
import io.github.amithkoujalgi.ollama4j.core.exceptions.OllamaBaseException;
import io.github.amithkoujalgi.ollama4j.core.models.*;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatMessage;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestModel;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatResult;
import io.github.amithkoujalgi.ollama4j.core.models.chat.OllamaChatRequestBuilder;
import io.github.amithkoujalgi.ollama4j.core.models.request.CustomModelFileContentsRequest;
import io.github.amithkoujalgi.ollama4j.core.models.request.CustomModelFilePathRequest;
import io.github.amithkoujalgi.ollama4j.core.models.request.ModelEmbeddingsRequest;
@ -441,7 +441,7 @@ public class OllamaAPI {
/**
* Ask a question to a model using an {@link OllamaChatRequestModel}. This can be constructed using an {@link OllamaChatRequestBuilder}.
*
* Hint: the {@link OllamaChatRequestModel#getStream()} property is not implemented
* Hint: the OllamaChatRequestModel#getStream() property is not implemented.
*
* @param request request object to be sent to the server
* @return

View File

@ -1,11 +1,10 @@
package io.github.amithkoujalgi.ollama4j.core.models.chat;
import com.fasterxml.jackson.core.JsonProcessingException;
import static io.github.amithkoujalgi.ollama4j.core.utils.Utils.getObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.File;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -14,8 +13,8 @@ import lombok.RequiredArgsConstructor;
/**
* Defines a single Message to be used inside a chat request against the ollama /api/chat endpoint.
*
* @see https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion
*
* @see <a href="https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion">Generate chat completion</a>
*/
@Data
@AllArgsConstructor

View File

@ -16,27 +16,27 @@ import lombok.RequiredArgsConstructor;
/**
* Defines a Request to use against the ollama /api/chat endpoint.
*
* @see https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion
*
* @see <a
* href="https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion">Generate
* Chat Completion</a>
*/
@Data
@AllArgsConstructor
@RequiredArgsConstructor
public class OllamaChatRequestModel implements OllamaRequestBody{
public class OllamaChatRequestModel implements OllamaRequestBody {
@NonNull
private String model;
@NonNull private String model;
@NonNull
private List<OllamaChatMessage> messages;
@NonNull private List<OllamaChatMessage> messages;
private String format;
private Options options;
private String template;
private boolean stream;
private String keepAlive;
private String format;
private Options options;
private String template;
private boolean stream;
private String keepAlive;
@Override
@Override
public String toString() {
try {
return getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
@ -44,5 +44,4 @@ public class OllamaChatRequestModel implements OllamaRequestBody{
throw new RuntimeException(e);
}
}
}
}