This file contains 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 $? | |
//JAVA 11+ | |
// Update the Quarkus version to what you want here or run jbang with | |
// `-Dquarkus.version=<version>` to override it. | |
//DEPS io.quarkus.platform:quarkus-bom:${quarkus.version:3.5.1}@pom | |
//DEPS io.quarkiverse.langchain4j:quarkus-langchain4j-openai:0.1.0 | |
//DEPS io.quarkus:quarkus-picocli | |
//Q:CONFIG quarkus.banner.enabled=false | |
//Q:CONFIG quarkus.log.level=WARN | |
//FILES application.properties |
This file contains 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 $? | |
//JAVA 11+ | |
// Update the Quarkus version to what you want here or run jbang with | |
// `-Dquarkus.version=<version>` to override it. | |
//DEPS io.quarkus.platform:quarkus-bom:${quarkus.version:3.5.1}@pom | |
//DEPS io.quarkiverse.langchain4j:quarkus-langchain4j-openai:0.1.0 | |
//DEPS io.quarkus:quarkus-picocli | |
//Q:CONFIG quarkus.banner.enabled=false | |
//Q:CONFIG quarkus.log.level=WARN | |
//FILES application.properties |
This file contains 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
//JAVA 21+ | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class Main { | |
static { | |
System.out.print("Hello,"); | |
try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) { |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" class="overflow-hidden min-h-screen"> | |
<head> | |
<meta charset="UTF-8"/> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<title>jnotebook</title> | |
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📓</text></svg>"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css" integrity="sha384-GvrOXuhMATgEsSwCs4smul74iXGOixntILdUW9XmUC6+HX0sLNAK3q71HotJqlAn" crossorigin="anonymous"> |
This file contains 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
//DEPS dev.langchain4j:langchain4j:0.23.0 | |
//DEPS dev.langchain4j:langchain4j-open-ai:0.23.0 | |
//DEPS org.slf4j:slf4j-simple:2.0.9 | |
//JAVA_OPTIONS -Dorg.slf4j.simpleLogger.defaultLogLevel=debug | |
import dev.langchain4j.model.chat.ChatLanguageModel; | |
import dev.langchain4j.model.openai.OpenAiChatModel; | |
import static dev.langchain4j.model.openai.OpenAiModelName.*; | |
import static java.time.Duration.ofSeconds; |
This file contains 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
//JAVA 21+ | |
//PREVIEW | |
// Make this available in a library somewhere | |
interface ConsoleApp { | |
default void println(String s) { | |
System.out.println(s); | |
} |
This file contains 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
//JAVA 21+ | |
//PREVIEW | |
// Make this available in a library somewhere | |
public interface ConsoleApp { | |
default void println(String s) { | |
System.out.println(s); | |
} |
This file contains 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 info.picocli:picocli:4.6.3 | |
//DEPS morpher.java | |
import picocli.CommandLine; | |
import picocli.CommandLine.Command; | |
import picocli.CommandLine.Parameters; | |
import java.util.concurrent.Callable; |
This file contains 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
jbang --verbose -s quack@maxandersen -c 'quack("Hello World");' | |
[jbang] [0:188] jbang version 0.108.0 | |
[jbang] [0:200] Literal Script to execute: 'quack("Hello World");' | |
[jbang] [0:223] Resolving resource ref: quack@maxandersen | |
[jbang] [0:225] Reading catalog from /Users/manderse/code/maxandersen/jbang-catalog/jbang-catalog.json | |
[jbang] [0:243] Reading catalog from /Users/manderse/.jbang/jbang-catalog.json | |
[jbang] [0:245] Reading catalog from /Users/manderse/.jbang/implicit-catalog.json | |
[jbang] [0:248] Using cached file /Users/manderse/.jbang/cache/urls/ff4a362589363f54286075a3df852970e41063999fb774dc692b5bf0e22ecac6/jbang-catalog.json for remote https://raw.githubusercontent.com/maxandersen/jbang-catalog/HEAD/jbang-catalog.json | |
[jbang] [0:248] Reading catalog from https://github.com/maxandersen/jbang-catalog/blob/HEAD/jbang-catalog.json | |
[jbang] [0:250] Obtained catalog from https://github.com/maxandersen/jbang-catalog/blob/HEAD/jbang-catalog.json |
This file contains 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
dev: | |
quarkus dev | |
jshell: | |
#!/usr/bin/env jbang --jsh | |
//DEPS com.github.javafaker:javafaker:1.0.2 | |
var faker = new com.github.javafaker.Faker(); | |
println(faker.nation().nationality()); | |
java: |