Created
January 27, 2025 09:24
-
-
Save maxandersen/8378b5fb923ea78b0926f28780eda48d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS io.quarkus.platform:quarkus-bom:3.15.1@pom | |
//DEPS io.quarkus:quarkus-picocli | |
//DEPS io.quarkiverse.langchain4j:quarkus-langchain4j-openai:0.24.0.CR1 | |
//Q:CONFIG quarkus.banner.enabled=false | |
//Q:CONFIG quarkus.langchain4j.openai.api-key=${OPENAI_API_KEY} | |
//Q:CONFIG quarkus.langchain4j.openai.base-url=https://api.deepseek.com/v1 | |
//Q:CONFIG quarkus.langchain4j.openai.chat-model.model-name=deepseek-chat | |
import dev.langchain4j.model.chat.ChatLanguageModel; | |
import jakarta.inject.Inject; | |
import picocli.CommandLine.Command; | |
@Command | |
public class jokes implements Runnable { | |
@Inject | |
private ChatLanguageModel ai; | |
@Override | |
public void run() { | |
System.out.println("Asking for a joke..."); | |
System.out.println(ai.generate("tell me a joke about people with neonsigns behind their heads")); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS io.quarkus.platform:quarkus-bom:3.15.1@pom | |
//DEPS io.quarkus:quarkus-picocli | |
//DEPS io.quarkiverse.langchain4j:quarkus-langchain4j-ollama:0.24.0.CR1 | |
//Q:CONFIG quarkus.banner.enabled=false | |
//Q:CONFIG quarkus.log.level=WARN | |
//Q:CONFIG quarkus.langchain4j.ollama.chat-model.model-id=deepseek-r1:8b | |
//Q:CONFIG quarkus.langchain4j.ollama.timeout=60s | |
import dev.langchain4j.model.chat.ChatLanguageModel; | |
import jakarta.inject.Inject; | |
import picocli.CommandLine.Command; | |
@Command | |
public class localjokes implements Runnable { | |
@Inject | |
private ChatLanguageModel ai; | |
@Override | |
public void run() { | |
System.out.println("Asking for a joke..."); | |
System.out.println(ai.generate("tell me a joke about people with neonsigns behind their heads")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment