mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-11-02 01:20:41 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab70201844 | ||
|
|
ac8a40a017 | ||
|
|
1ac65f821b | ||
|
|
d603c4b94b | ||
|
|
a418cbc1dc | ||
|
|
785dd12730 | ||
|
|
dda807d818 | ||
|
|
a06a4025fa | ||
| 761fbc3398 | |||
| a96dc11679 | |||
| b2b3febdaa | |||
|
|
f27bea11d5 | ||
|
|
9503451d5a | ||
|
|
04bae4ca6a | ||
|
|
3e33b8df62 |
29
.github/workflows/close-issue.yml
vendored
Normal file
29
.github/workflows/close-issue.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Close inactive issues
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # for manual run
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *" # Runs daily at midnight
|
||||||
|
|
||||||
|
# Fine-grant permission
|
||||||
|
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
close-issues:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v5
|
||||||
|
with:
|
||||||
|
exempt-issue-labels: "refactor,help wanted,good first issue,research,bug"
|
||||||
|
days-before-issue-stale: 7 # Issues become stale after 7 days
|
||||||
|
days-before-issue-close: 15 # Issues close 15 days after being marked stale
|
||||||
|
stale-issue-label: "stale"
|
||||||
|
close-issue-message: "This issue was closed because it has been inactive for 15 days since being marked as stale."
|
||||||
|
days-before-pr-stale: -1 # PRs are not handled
|
||||||
|
days-before-pr-close: -1 # PRs are not handled
|
||||||
|
operations-per-run: 10000
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
28
.github/workflows/label-issue-stale.yml
vendored
Normal file
28
.github/workflows/label-issue-stale.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Mark stale issues and pull requests
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # for manual run
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *' # Runs every day at midnight
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # only for delete-branch option
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Mark stale issues and pull requests
|
||||||
|
uses: actions/stale@v8
|
||||||
|
with:
|
||||||
|
repo-token: ${{ github.token }}
|
||||||
|
days-before-stale: 15
|
||||||
|
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.'
|
||||||
|
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.'
|
||||||
|
days-before-close: 7
|
||||||
|
stale-issue-label: 'stale'
|
||||||
|
exempt-issue-labels: 'pinned,security'
|
||||||
|
stale-pr-label: 'stale'
|
||||||
|
exempt-pr-labels: 'work-in-progress'
|
||||||
@@ -283,6 +283,8 @@ If you like or are using this project to build your own, please give us a star.
|
|||||||
| 7 | Katie Backend | An open-source AI-based question-answering platform for accessing private domain knowledge | [GitHub](https://github.com/wyona/katie-backend) |
|
| 7 | Katie Backend | An open-source AI-based question-answering platform for accessing private domain knowledge | [GitHub](https://github.com/wyona/katie-backend) |
|
||||||
| 8 | TeleLlama3 Bot | A question-answering Telegram bot | [Repo](https://git.hiast.edu.sy/mohamadbashar.disoki/telellama3-bot) |
|
| 8 | TeleLlama3 Bot | A question-answering Telegram bot | [Repo](https://git.hiast.edu.sy/mohamadbashar.disoki/telellama3-bot) |
|
||||||
| 9 | moqui-wechat | A moqui-wechat component | [GitHub](https://github.com/heguangyong/moqui-wechat) |
|
| 9 | moqui-wechat | A moqui-wechat component | [GitHub](https://github.com/heguangyong/moqui-wechat) |
|
||||||
|
| 10 | B4X | A set of simple and powerful RAD tool for Desktop and Server development | [Website](https://www.b4x.com/android/forum/threads/ollama4j-library-pnd_ollama4j-your-local-offline-llm-like-chatgpt.165003/) |
|
||||||
|
|
||||||
|
|
||||||
## Traction
|
## Traction
|
||||||
|
|
||||||
|
|||||||
@@ -521,6 +521,23 @@ public class MyOllamaService{
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or, if one needs to provide an object instance directly:
|
||||||
|
```java
|
||||||
|
public class MyOllamaService{
|
||||||
|
|
||||||
|
public void chatWithAnnotatedTool(){
|
||||||
|
ollamaAPI.registerAnnotatedTools(new BackendService());
|
||||||
|
OllamaChatRequest requestModel = builder
|
||||||
|
.withMessage(OllamaChatMessageRole.USER,
|
||||||
|
"Compute the most important constant in the world using 5 digits")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
OllamaChatResult chatResult = ollamaAPI.chat(requestModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
The request should be the following:
|
The request should be the following:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import io.github.ollama4j.models.embeddings.OllamaEmbeddingsRequestModel;
|
|||||||
import io.github.ollama4j.models.embeddings.OllamaEmbedResponseModel;
|
import io.github.ollama4j.models.embeddings.OllamaEmbedResponseModel;
|
||||||
import io.github.ollama4j.models.generate.OllamaGenerateRequest;
|
import io.github.ollama4j.models.generate.OllamaGenerateRequest;
|
||||||
import io.github.ollama4j.models.generate.OllamaStreamHandler;
|
import io.github.ollama4j.models.generate.OllamaStreamHandler;
|
||||||
|
import io.github.ollama4j.models.generate.OllamaTokenHandler;
|
||||||
import io.github.ollama4j.models.ps.ModelsProcessResponse;
|
import io.github.ollama4j.models.ps.ModelsProcessResponse;
|
||||||
import io.github.ollama4j.models.request.*;
|
import io.github.ollama4j.models.request.*;
|
||||||
import io.github.ollama4j.models.response.*;
|
import io.github.ollama4j.models.response.*;
|
||||||
@@ -785,15 +786,34 @@ public class OllamaAPI {
|
|||||||
* @throws InterruptedException if the operation is interrupted
|
* @throws InterruptedException if the operation is interrupted
|
||||||
*/
|
*/
|
||||||
public OllamaChatResult chat(OllamaChatRequest request, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException {
|
public OllamaChatResult chat(OllamaChatRequest request, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException {
|
||||||
|
return chatStreaming(request, new OllamaChatStreamObserver(streamHandler));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask a question to a model using an {@link OllamaChatRequest}. This can be constructed using an {@link OllamaChatRequestBuilder}.
|
||||||
|
* <p>
|
||||||
|
* Hint: the OllamaChatRequestModel#getStream() property is not implemented.
|
||||||
|
*
|
||||||
|
* @param request request object to be sent to the server
|
||||||
|
* @param tokenHandler callback handler to handle the last token from stream (caution: all previous messages from stream will be concatenated)
|
||||||
|
* @return {@link OllamaChatResult}
|
||||||
|
* @throws OllamaBaseException any response code than 200 has been returned
|
||||||
|
* @throws IOException in case the responseStream can not be read
|
||||||
|
* @throws InterruptedException in case the server is not reachable or network issues happen
|
||||||
|
* @throws OllamaBaseException if the response indicates an error status
|
||||||
|
* @throws IOException if an I/O error occurs during the HTTP request
|
||||||
|
* @throws InterruptedException if the operation is interrupted
|
||||||
|
*/
|
||||||
|
public OllamaChatResult chatStreaming(OllamaChatRequest request, OllamaTokenHandler tokenHandler) throws OllamaBaseException, IOException, InterruptedException {
|
||||||
OllamaChatEndpointCaller requestCaller = new OllamaChatEndpointCaller(host, basicAuth, requestTimeoutSeconds, verbose);
|
OllamaChatEndpointCaller requestCaller = new OllamaChatEndpointCaller(host, basicAuth, requestTimeoutSeconds, verbose);
|
||||||
OllamaChatResult result;
|
OllamaChatResult result;
|
||||||
|
|
||||||
// add all registered tools to Request
|
// add all registered tools to Request
|
||||||
request.setTools(toolRegistry.getRegisteredSpecs().stream().map(Tools.ToolSpecification::getToolPrompt).collect(Collectors.toList()));
|
request.setTools(toolRegistry.getRegisteredSpecs().stream().map(Tools.ToolSpecification::getToolPrompt).collect(Collectors.toList()));
|
||||||
|
|
||||||
if (streamHandler != null) {
|
if (tokenHandler != null) {
|
||||||
request.setStream(true);
|
request.setStream(true);
|
||||||
result = requestCaller.call(request, streamHandler);
|
result = requestCaller.call(request, tokenHandler);
|
||||||
} else {
|
} else {
|
||||||
result = requestCaller.callSync(request);
|
result = requestCaller.callSync(request);
|
||||||
}
|
}
|
||||||
@@ -810,8 +830,8 @@ public class OllamaAPI {
|
|||||||
request.getMessages().add(new OllamaChatMessage(OllamaChatMessageRole.TOOL,"[TOOL_RESULTS]" + toolName + "(" + arguments.keySet() +") : " + res + "[/TOOL_RESULTS]"));
|
request.getMessages().add(new OllamaChatMessage(OllamaChatMessageRole.TOOL,"[TOOL_RESULTS]" + toolName + "(" + arguments.keySet() +") : " + res + "[/TOOL_RESULTS]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamHandler != null) {
|
if (tokenHandler != null) {
|
||||||
result = requestCaller.call(request, streamHandler);
|
result = requestCaller.call(request, tokenHandler);
|
||||||
} else {
|
} else {
|
||||||
result = requestCaller.callSync(request);
|
result = requestCaller.callSync(request);
|
||||||
}
|
}
|
||||||
@@ -826,7 +846,9 @@ public class OllamaAPI {
|
|||||||
toolRegistry.addTool(toolSpecification.getFunctionName(), toolSpecification);
|
toolRegistry.addTool(toolSpecification.getFunctionName(), toolSpecification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void registerAnnotatedTools() {
|
public void registerAnnotatedTools() {
|
||||||
|
try {
|
||||||
Class<?> callerClass = null;
|
Class<?> callerClass = null;
|
||||||
try {
|
try {
|
||||||
callerClass = Class.forName(Thread.currentThread().getStackTrace()[2].getClassName());
|
callerClass = Class.forName(Thread.currentThread().getStackTrace()[2].getClassName());
|
||||||
@@ -835,14 +857,22 @@ public class OllamaAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
OllamaToolService ollamaToolServiceAnnotation = callerClass.getDeclaredAnnotation(OllamaToolService.class);
|
OllamaToolService ollamaToolServiceAnnotation = callerClass.getDeclaredAnnotation(OllamaToolService.class);
|
||||||
if(ollamaToolServiceAnnotation == null) {
|
if (ollamaToolServiceAnnotation == null) {
|
||||||
throw new IllegalStateException(callerClass + " is not annotated as " + OllamaToolService.class);
|
throw new IllegalStateException(callerClass + " is not annotated as " + OllamaToolService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
Class<?>[] providers = ollamaToolServiceAnnotation.providers();
|
Class<?>[] providers = ollamaToolServiceAnnotation.providers();
|
||||||
|
for (Class<?> provider : providers) {
|
||||||
|
registerAnnotatedTools(provider.getDeclaredConstructor().newInstance());
|
||||||
|
}
|
||||||
|
} catch (InstantiationException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(Class<?> provider : providers){
|
public void registerAnnotatedTools(Object object) {
|
||||||
Method[] methods = provider.getMethods();
|
Class<?> objectClass = object.getClass();
|
||||||
|
Method[] methods = objectClass.getMethods();
|
||||||
for(Method m : methods) {
|
for(Method m : methods) {
|
||||||
ToolSpec toolSpec = m.getDeclaredAnnotation(ToolSpec.class);
|
ToolSpec toolSpec = m.getDeclaredAnnotation(ToolSpec.class);
|
||||||
if(toolSpec == null){
|
if(toolSpec == null){
|
||||||
@@ -895,19 +925,10 @@ public class OllamaAPI {
|
|||||||
)
|
)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
|
||||||
ReflectionalToolFunction reflectionalToolFunction =
|
ReflectionalToolFunction reflectionalToolFunction =
|
||||||
new ReflectionalToolFunction(provider.getDeclaredConstructor().newInstance()
|
new ReflectionalToolFunction(object, m, methodParams);
|
||||||
,m
|
|
||||||
,methodParams);
|
|
||||||
|
|
||||||
toolSpecification.setToolFunction(reflectionalToolFunction);
|
toolSpecification.setToolFunction(reflectionalToolFunction);
|
||||||
toolRegistry.addTool(toolSpecification.getFunctionName(),toolSpecification);
|
toolRegistry.addTool(toolSpecification.getFunctionName(),toolSpecification);
|
||||||
} catch (InstantiationException | IllegalAccessException | InvocationTargetException |
|
|
||||||
NoSuchMethodException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,19 @@
|
|||||||
package io.github.ollama4j.models.chat;
|
package io.github.ollama4j.models.chat;
|
||||||
|
|
||||||
import io.github.ollama4j.models.generate.OllamaStreamHandler;
|
import io.github.ollama4j.models.generate.OllamaStreamHandler;
|
||||||
|
import io.github.ollama4j.models.generate.OllamaTokenHandler;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
@RequiredArgsConstructor
|
||||||
import java.util.List;
|
public class OllamaChatStreamObserver implements OllamaTokenHandler {
|
||||||
|
private final OllamaStreamHandler streamHandler;
|
||||||
public class OllamaChatStreamObserver {
|
|
||||||
|
|
||||||
private OllamaStreamHandler streamHandler;
|
|
||||||
|
|
||||||
private List<OllamaChatResponseModel> responseParts = new ArrayList<>();
|
|
||||||
|
|
||||||
private String message = "";
|
private String message = "";
|
||||||
|
|
||||||
public OllamaChatStreamObserver(OllamaStreamHandler streamHandler) {
|
@Override
|
||||||
this.streamHandler = streamHandler;
|
public void accept(OllamaChatResponseModel token) {
|
||||||
}
|
if (streamHandler != null) {
|
||||||
|
message += token.getMessage().getContent();
|
||||||
public void notify(OllamaChatResponseModel currentResponsePart) {
|
|
||||||
responseParts.add(currentResponsePart);
|
|
||||||
handleCurrentResponsePart(currentResponsePart);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void handleCurrentResponsePart(OllamaChatResponseModel currentResponsePart) {
|
|
||||||
message = message + currentResponsePart.getMessage().getContent();
|
|
||||||
streamHandler.accept(message);
|
streamHandler.accept(message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package io.github.ollama4j.models.generate;
|
||||||
|
|
||||||
|
import io.github.ollama4j.models.chat.OllamaChatResponseModel;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
public interface OllamaTokenHandler extends Consumer<OllamaChatResponseModel> {
|
||||||
|
}
|
||||||
@@ -4,9 +4,8 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import io.github.ollama4j.exceptions.OllamaBaseException;
|
import io.github.ollama4j.exceptions.OllamaBaseException;
|
||||||
import io.github.ollama4j.models.chat.*;
|
import io.github.ollama4j.models.chat.*;
|
||||||
|
import io.github.ollama4j.models.generate.OllamaTokenHandler;
|
||||||
import io.github.ollama4j.models.response.OllamaErrorResponse;
|
import io.github.ollama4j.models.response.OllamaErrorResponse;
|
||||||
import io.github.ollama4j.models.generate.OllamaStreamHandler;
|
|
||||||
import io.github.ollama4j.tools.Tools;
|
|
||||||
import io.github.ollama4j.utils.Utils;
|
import io.github.ollama4j.utils.Utils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -29,7 +28,7 @@ public class OllamaChatEndpointCaller extends OllamaEndpointCaller {
|
|||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(OllamaChatEndpointCaller.class);
|
private static final Logger LOG = LoggerFactory.getLogger(OllamaChatEndpointCaller.class);
|
||||||
|
|
||||||
private OllamaChatStreamObserver streamObserver;
|
private OllamaTokenHandler tokenHandler;
|
||||||
|
|
||||||
public OllamaChatEndpointCaller(String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) {
|
public OllamaChatEndpointCaller(String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) {
|
||||||
super(host, basicAuth, requestTimeoutSeconds, verbose);
|
super(host, basicAuth, requestTimeoutSeconds, verbose);
|
||||||
@@ -60,8 +59,8 @@ public class OllamaChatEndpointCaller extends OllamaEndpointCaller {
|
|||||||
OllamaChatMessage message = ollamaResponseModel.getMessage();
|
OllamaChatMessage message = ollamaResponseModel.getMessage();
|
||||||
if(message != null) {
|
if(message != null) {
|
||||||
responseBuffer.append(message.getContent());
|
responseBuffer.append(message.getContent());
|
||||||
if (streamObserver != null) {
|
if (tokenHandler != null) {
|
||||||
streamObserver.notify(ollamaResponseModel);
|
tokenHandler.accept(ollamaResponseModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ollamaResponseModel.isDone();
|
return ollamaResponseModel.isDone();
|
||||||
@@ -71,9 +70,9 @@ public class OllamaChatEndpointCaller extends OllamaEndpointCaller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public OllamaChatResult call(OllamaChatRequest body, OllamaStreamHandler streamHandler)
|
public OllamaChatResult call(OllamaChatRequest body, OllamaTokenHandler tokenHandler)
|
||||||
throws OllamaBaseException, IOException, InterruptedException {
|
throws OllamaBaseException, IOException, InterruptedException {
|
||||||
streamObserver = new OllamaChatStreamObserver(streamHandler);
|
this.tokenHandler = tokenHandler;
|
||||||
return callSync(body);
|
return callSync(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@ public class OllamaChatEndpointCaller extends OllamaEndpointCaller {
|
|||||||
.POST(
|
.POST(
|
||||||
body.getBodyPublisher());
|
body.getBodyPublisher());
|
||||||
HttpRequest request = requestBuilder.build();
|
HttpRequest request = requestBuilder.build();
|
||||||
if (isVerbose()) LOG.info("Asking model: " + body.toString());
|
if (isVerbose()) LOG.info("Asking model: " + body);
|
||||||
HttpResponse<InputStream> response =
|
HttpResponse<InputStream> response =
|
||||||
httpClient.send(request, HttpResponse.BodyHandlers.ofInputStream());
|
httpClient.send(request, HttpResponse.BodyHandlers.ofInputStream());
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class OllamaModelType {
|
|||||||
public static final String LLAMA3_1 = "llama3.1";
|
public static final String LLAMA3_1 = "llama3.1";
|
||||||
public static final String MISTRAL = "mistral";
|
public static final String MISTRAL = "mistral";
|
||||||
public static final String MIXTRAL = "mixtral";
|
public static final String MIXTRAL = "mixtral";
|
||||||
|
public static final String DEEPSEEK_R1 = "deepseek-r1";
|
||||||
public static final String LLAVA = "llava";
|
public static final String LLAVA = "llava";
|
||||||
public static final String LLAVA_PHI3 = "llava-phi3";
|
public static final String LLAVA_PHI3 = "llava-phi3";
|
||||||
public static final String NEURAL_CHAT = "neural-chat";
|
public static final String NEURAL_CHAT = "neural-chat";
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ class TestRealAPIs {
|
|||||||
assertEquals(1, function.getArguments().size());
|
assertEquals(1, function.getArguments().size());
|
||||||
Object noOfDigits = function.getArguments().get("noOfDigits");
|
Object noOfDigits = function.getArguments().get("noOfDigits");
|
||||||
assertNotNull(noOfDigits);
|
assertNotNull(noOfDigits);
|
||||||
assertEquals("5",noOfDigits);
|
assertEquals("5", noOfDigits.toString());
|
||||||
assertTrue(chatResult.getChatHistory().size()>2);
|
assertTrue(chatResult.getChatHistory().size()>2);
|
||||||
List<OllamaChatToolCalls> finalToolCalls = chatResult.getResponseModel().getMessage().getToolCalls();
|
List<OllamaChatToolCalls> finalToolCalls = chatResult.getResponseModel().getMessage().getToolCalls();
|
||||||
assertNull(finalToolCalls);
|
assertNull(finalToolCalls);
|
||||||
@@ -338,7 +338,7 @@ class TestRealAPIs {
|
|||||||
ollamaAPI.setVerbose(true);
|
ollamaAPI.setVerbose(true);
|
||||||
OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel());
|
OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getModel());
|
||||||
|
|
||||||
ollamaAPI.registerAnnotatedTools();
|
ollamaAPI.registerAnnotatedTools(new AnnotatedTool());
|
||||||
|
|
||||||
OllamaChatRequest requestModel = builder
|
OllamaChatRequest requestModel = builder
|
||||||
.withMessage(OllamaChatMessageRole.USER,
|
.withMessage(OllamaChatMessageRole.USER,
|
||||||
|
|||||||
Reference in New Issue
Block a user