mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-05-15 20:07:10 +02:00
init
This commit is contained in:
parent
b9d888b3d5
commit
f5b46410e8
@ -1,20 +0,0 @@
|
|||||||
package io.github.amithkoujalgi.ollama4j;
|
|
||||||
|
|
||||||
import io.github.amithkoujalgi.ollama4j.core.OllamaAPI;
|
|
||||||
import io.github.amithkoujalgi.ollama4j.core.types.OllamaModelType;
|
|
||||||
import io.github.amithkoujalgi.ollama4j.core.utils.SamplePrompts;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
String host = "http://localhost:11434/";
|
|
||||||
OllamaAPI ollamaAPI = new OllamaAPI(host);
|
|
||||||
|
|
||||||
String prompt1 = SamplePrompts.getSampleDatabasePromptWithQuestion("List all customer names who have bought one or more products");
|
|
||||||
String response1 = ollamaAPI.ask(OllamaModelType.SQLCODER, prompt1);
|
|
||||||
System.out.println(response1);
|
|
||||||
|
|
||||||
String prompt2 = "Give me a list of world cup cricket teams.";
|
|
||||||
String response2 = ollamaAPI.ask(OllamaModelType.LLAMA2, prompt2);
|
|
||||||
System.out.println(response2);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user