Compare commits

..

No commits in common. "38cf75f8c9833c88b4df61818638f0ad11e9fc88" and "066e3f81e98cdd5a8d5742f64cdd25cf7ca56137" have entirely different histories.

8 changed files with 20 additions and 42 deletions

View file

@ -25,7 +25,7 @@ jobs:
strategy: strategy:
matrix: matrix:
java-version: [17, 21, 24] java-version: [17, 21, 24]
kotlin-version: [1.9.25, 2.0.20, 2.1.21] kotlin-version: [1.9.25, 2.0.20, 2.1.20]
steps: steps:
- name: Checkout source repository - name: Checkout source repository

View file

@ -1,7 +1,7 @@
# mobibot # mobibot
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.21-7f52ff.svg)](https://kotlinlang.org) [![Kotlin](https://img.shields.io/badge/kotlin-2.1.20-7f52ff.svg)](https://kotlinlang.org)
[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_mobibot&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ethauvin_mobibot) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_mobibot&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ethauvin_mobibot)
[![GitHub CI](https://github.com/ethauvin/mobibot/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/mobibot/actions/workflows/bld.yml) [![GitHub CI](https://github.com/ethauvin/mobibot/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/mobibot/actions/workflows/bld.yml)

View file

@ -2,7 +2,6 @@ bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true bld.downloadExtensionSources=true
bld.downloadLocation= bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT
bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.5
bld.extension-gv=com.uwyn.rife2:bld-generated-version:1.0.1 bld.extension-gv=com.uwyn.rife2:bld-generated-version:1.0.1
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10 bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT

18
pom.xml
View file

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.thauvin.erik.mobibot</groupId> <groupId>net.thauvin.erik.mobibot</groupId>
<artifactId>mobibot</artifactId> <artifactId>mobibot</artifactId>
<version>0.8.0-rc+20250515215148</version> <version>0.8.0-rc+20250509073816</version>
<name>mobibot</name> <name>mobibot</name>
<description></description> <description></description>
<url></url> <url></url>
@ -54,25 +54,25 @@
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId> <artifactId>kotlin-stdlib</artifactId>
<version>2.1.21</version> <version>2.1.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId> <artifactId>kotlin-stdlib-common</artifactId>
<version>2.1.21</version> <version>2.1.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId> <artifactId>kotlin-stdlib-jdk7</artifactId>
<version>2.1.21</version> <version>2.1.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.kotlin</groupId> <groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId> <artifactId>kotlin-stdlib-jdk8</artifactId>
<version>2.1.21</version> <version>2.1.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -114,25 +114,25 @@
<dependency> <dependency>
<groupId>dev.langchain4j</groupId> <groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId> <artifactId>langchain4j-open-ai</artifactId>
<version>1.0.0</version> <version>0.36.2</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>dev.langchain4j</groupId> <groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-google-ai-gemini</artifactId> <artifactId>langchain4j-google-ai-gemini</artifactId>
<version>1.0.0-beta5</version> <version>0.36.2</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>dev.langchain4j</groupId> <groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId> <artifactId>langchain4j-core</artifactId>
<version>1.0.0</version> <version>0.36.2</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>dev.langchain4j</groupId> <groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId> <artifactId>langchain4j</artifactId>
<version>1.0.0</version> <version>0.36.2</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -34,7 +34,10 @@ package net.thauvin.erik;
import rife.bld.BuildCommand; import rife.bld.BuildCommand;
import rife.bld.Project; import rife.bld.Project;
import rife.bld.dependencies.Repository; import rife.bld.dependencies.Repository;
import rife.bld.extension.*; import rife.bld.extension.CompileKotlinOperation;
import rife.bld.extension.DetektOperation;
import rife.bld.extension.GeneratedVersionOperation;
import rife.bld.extension.JacocoReportOperation;
import rife.bld.operations.exceptions.ExitStatusException; import rife.bld.operations.exceptions.ExitStatusException;
import rife.bld.publish.PomBuilder; import rife.bld.publish.PomBuilder;
import rife.tools.FileUtils; import rife.tools.FileUtils;
@ -42,8 +45,6 @@ import rife.tools.exceptions.FileUtilsErrorException;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
@ -81,8 +82,8 @@ public class MobibotBuild extends Project {
SONATYPE_SNAPSHOTS_LEGACY); SONATYPE_SNAPSHOTS_LEGACY);
var log4j = version(2, 24, 3); var log4j = version(2, 24, 3);
var kotlin = version(2, 1, 21); var kotlin = version(2, 1, 20);
var langchain = version(1, 0, 0); var langchain = version(0, 36, 2);
scope(compile) scope(compile)
// PircBotX // PircBotX
.include(dependency("com.github.pircbotx", "pircbotx", "2.3.1")) .include(dependency("com.github.pircbotx", "pircbotx", "2.3.1"))
@ -108,7 +109,7 @@ public class MobibotBuild extends Project {
.include(dependency("org.apache.logging.log4j", "log4j-slf4j2-impl", log4j)) .include(dependency("org.apache.logging.log4j", "log4j-slf4j2-impl", log4j))
// LangChain4J // LangChain4J
.include(dependency("dev.langchain4j", "langchain4j-open-ai", langchain)) .include(dependency("dev.langchain4j", "langchain4j-open-ai", langchain))
.include(dependency("dev.langchain4j", "langchain4j-google-ai-gemini", "1.0.0-beta5")) .include(dependency("dev.langchain4j", "langchain4j-google-ai-gemini", langchain))
.include(dependency("dev.langchain4j", "langchain4j-core", langchain)) .include(dependency("dev.langchain4j", "langchain4j-core", langchain))
.include(dependency("dev.langchain4j", "langchain4j", langchain)) .include(dependency("dev.langchain4j", "langchain4j", langchain))
// Misc. // Misc.
@ -239,25 +240,4 @@ public class MobibotBuild extends Project {
.extension(".kt") .extension(".kt")
.execute(); .execute();
} }
@Override
public void test() throws Exception {
var testResultsDir = "build/test-results/test/";
var op = testOperation().fromProject(this);
op.testToolOptions().reportsDir(new File(testResultsDir));
op.execute();
var xunitViewer = new File("/usr/bin/xunit-viewer");
if (xunitViewer.exists() && xunitViewer.canExecute()) {
var reportsDir = "build/reports/tests/test/";
Files.createDirectories(Path.of(reportsDir));
new ExecOperation()
.fromProject(this)
.command(xunitViewer.getPath(), "-r", testResultsDir, "-o", reportsDir + "index.html")
.execute();
}
}
} }

View file

@ -77,7 +77,7 @@ class ChatGpt2 : AbstractModule() {
.maxTokens(maxTokens) .maxTokens(maxTokens)
.build() .build()
return model.chat(query) return model.generate(query)
} catch (e: Exception) { } catch (e: Exception) {
throw ModuleException( throw ModuleException(
"$CHATGPT_CMD($query): IO", "$CHATGPT_CMD($query): IO",

View file

@ -90,7 +90,7 @@ class Gemini2 : AbstractModule() {
.maxOutputTokens(maxTokens) .maxOutputTokens(maxTokens)
.build() .build()
return gemini.chat(query) return gemini.generate(query)
} catch (e: Exception) { } catch (e: Exception) {
throw ModuleException("$GEMINI_CMD($query): IO", IO_ERROR, e) throw ModuleException("$GEMINI_CMD($query): IO", IO_ERROR, e)
} }

View file

@ -71,7 +71,6 @@ class ChatGpt2Test : LocalProperties() {
.isInstanceOf(ModuleException::class.java) .isInstanceOf(ModuleException::class.java)
.hasNoCause() .hasNoCause()
} }
private val apiKey = getProperty(ChatGpt2.API_KEY_PROP) private val apiKey = getProperty(ChatGpt2.API_KEY_PROP)
@Test @Test