Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaToolsResult.java
Go to the documentation of this file.
1
package
io.github.ollama4j.tools;
2
3
import
io.github.ollama4j.models.response.OllamaResult;
4
import
lombok.AllArgsConstructor;
5
import
lombok.Data;
6
import
lombok.NoArgsConstructor;
7
8
import
java.util.ArrayList;
9
import
java.util.List;
10
import
java.util.Map;
11
12
@Data
13
@NoArgsConstructor
14
@AllArgsConstructor
15
public
class
OllamaToolsResult
{
16
private
OllamaResult
modelResult;
17
private
Map<ToolFunctionCallSpec, Object> toolResults;
18
19
public
List<ToolResult>
getToolResults
() {
20
List<ToolResult> results =
new
ArrayList<>();
21
for
(Map.Entry<
ToolFunctionCallSpec
, Object> r :
this
.toolResults.entrySet()) {
22
results.add(
new
ToolResult(r.getKey().getName(), r.getKey().getArguments(), r.getValue()));
23
}
24
return
results;
25
}
26
27
@Data
28
@NoArgsConstructor
29
@AllArgsConstructor
30
public
static
class
ToolResult {
31
private
String functionName;
32
private
Map<String, Object> functionArguments;
33
private
Object result;
34
}
35
}
io.github.ollama4j.models.response.OllamaResult
Definition
OllamaResult.java:13
io.github.ollama4j.tools.OllamaToolsResult
Definition
OllamaToolsResult.java:15
io.github.ollama4j.tools.OllamaToolsResult.getToolResults
List< ToolResult > getToolResults()
Definition
OllamaToolsResult.java:19
io.github.ollama4j.tools.ToolFunctionCallSpec
Definition
ToolFunctionCallSpec.java:12
src
main
java
io
github
ollama4j
tools
OllamaToolsResult.java
Generated by
1.12.0