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
package gemini.workshop; | |
import com.github.dockerjava.api.model.Image; | |
import dev.langchain4j.model.chat.ChatLanguageModel; | |
import dev.langchain4j.model.ollama.OllamaChatModel; | |
import org.testcontainers.DockerClientFactory; | |
import org.testcontainers.ollama.OllamaContainer; | |
import org.testcontainers.utility.DockerImageName; | |
import java.io.IOException; |
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
package gemini.workshop; | |
import dev.langchain4j.model.chat.ChatLanguageModel; | |
import dev.langchain4j.model.ollama.OllamaChatModel; | |
import org.testcontainers.ollama.OllamaContainer; | |
import org.testcontainers.utility.DockerImageName; | |
import java.io.IOException; | |
public class CallGemma { |
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
@Grab('com.ibm.icu:icu4j') | |
@Grab('com.github.slugify:slugify') | |
import com.github.slugify.* | |
var slugify = Slugify.builder() | |
.transliterator(true) | |
.locale(Locale.ENGLISH) | |
.build() | |
println slugify.slugify("Un bel été où l'hôtel François à rebours des îles de Noël tenait tête") |
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
@Grab("com.google.openlocationcode:openlocationcode:1.0.4") | |
import com.google.openlocationcode.OpenLocationCode | |
// Eiffel Tower | |
def (lat, lon) = [48.8584, 2.29447] | |
def eiffelTowerPlusCode = OpenLocationCode.encode(lat, lon) | |
println "Eiffel Tower +code: ${eiffelTowerPlusCode}" | |
def decoded = OpenLocationCode.decode('8FW4V75V+9Q') |
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
{ | |
"msg": "Hello World!" | |
} |
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
import java.nio.file.Paths | |
@Grab('org.jsoup:jsoup:1.15.4') | |
import org.jsoup.Jsoup | |
import org.jsoup.safety.Safelist | |
@Grab('org.apache.commons:commons-lang3:3.12.0') | |
import static org.apache.commons.lang3.StringUtils.getLevenshteinDistance as levenDist | |
@Grab('org.codehaus.gpars:gpars:1.2.1') |
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
@Grab('org.jsoup:jsoup:1.15.4') | |
import org.jsoup.Jsoup | |
import org.jsoup.safety.Safelist | |
@Grab('io.github.furstenheim:copy_down:1.1') | |
import io.github.furstenheim.* | |
import java.nio.file.Paths | |
import java.nio.file.Files | |
import java.text.SimpleDateFormat |
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
@Controller("/product") | |
public class ProductController { | |
@Get | |
@Status(HttpStatus.OK) | |
public void index() { | |
throw Problem.builder() | |
.withType(URI.create("https://example.org/out-of-stock")) | |
.withTitle("Out of Stock") | |
.withStatus(new HttpStatusType(HttpStatus.BAD_REQUEST)) | |
.withDetail("Item B00027Y5QG is no longer available") |
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
HTTP/1.1 403 Forbidden | |
Content-Type: application/problem+json | |
Content-Language: en | |
{ | |
"type": "https://example.com/probs/out-of-credit", | |
"title": "You do not have enough credit.", | |
"detail": "Your current balance is 30, but that costs 50.", | |
"instance": "/account/12345/msgs/abc", | |
"balance": 30, |
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
https://www.youtube.com/watch?v=7e0RGIul8Kk |
NewerOlder