Compare commits
3 commits
066e3f81e9
...
38cf75f8c9
Author | SHA1 | Date | |
---|---|---|---|
38cf75f8c9 | |||
2e6778a29b | |||
4c15176b34 |
8 changed files with 42 additions and 20 deletions
2
.github/workflows/bld.yml
vendored
2
.github/workflows/bld.yml
vendored
|
@ -25,7 +25,7 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
java-version: [17, 21, 24]
|
||||
kotlin-version: [1.9.25, 2.0.20, 2.1.20]
|
||||
kotlin-version: [1.9.25, 2.0.20, 2.1.21]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# mobibot
|
||||
|
||||
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://kotlinlang.org)
|
||||
[](https://kotlinlang.org)
|
||||
[](https://rife2.com/bld)
|
||||
[](https://sonarcloud.io/summary/new_code?id=ethauvin_mobibot)
|
||||
[](https://github.com/ethauvin/mobibot/actions/workflows/bld.yml)
|
||||
|
|
|
@ -2,6 +2,7 @@ bld.downloadExtensionJavadoc=false
|
|||
bld.downloadExtensionSources=true
|
||||
bld.downloadLocation=
|
||||
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-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
|
||||
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
|
||||
|
|
18
pom.xml
18
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.thauvin.erik.mobibot</groupId>
|
||||
<artifactId>mobibot</artifactId>
|
||||
<version>0.8.0-rc+20250509073816</version>
|
||||
<version>0.8.0-rc+20250515215148</version>
|
||||
<name>mobibot</name>
|
||||
<description></description>
|
||||
<url></url>
|
||||
|
@ -54,25 +54,25 @@
|
|||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>2.1.20</version>
|
||||
<version>2.1.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-common</artifactId>
|
||||
<version>2.1.20</version>
|
||||
<version>2.1.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||
<version>2.1.20</version>
|
||||
<version>2.1.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>2.1.20</version>
|
||||
<version>2.1.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -114,25 +114,25 @@
|
|||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-open-ai</artifactId>
|
||||
<version>0.36.2</version>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-google-ai-gemini</artifactId>
|
||||
<version>0.36.2</version>
|
||||
<version>1.0.0-beta5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j-core</artifactId>
|
||||
<version>0.36.2</version>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.langchain4j</groupId>
|
||||
<artifactId>langchain4j</artifactId>
|
||||
<version>0.36.2</version>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -34,10 +34,7 @@ package net.thauvin.erik;
|
|||
import rife.bld.BuildCommand;
|
||||
import rife.bld.Project;
|
||||
import rife.bld.dependencies.Repository;
|
||||
import rife.bld.extension.CompileKotlinOperation;
|
||||
import rife.bld.extension.DetektOperation;
|
||||
import rife.bld.extension.GeneratedVersionOperation;
|
||||
import rife.bld.extension.JacocoReportOperation;
|
||||
import rife.bld.extension.*;
|
||||
import rife.bld.operations.exceptions.ExitStatusException;
|
||||
import rife.bld.publish.PomBuilder;
|
||||
import rife.tools.FileUtils;
|
||||
|
@ -45,6 +42,8 @@ import rife.tools.exceptions.FileUtilsErrorException;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
|
@ -82,8 +81,8 @@ public class MobibotBuild extends Project {
|
|||
SONATYPE_SNAPSHOTS_LEGACY);
|
||||
|
||||
var log4j = version(2, 24, 3);
|
||||
var kotlin = version(2, 1, 20);
|
||||
var langchain = version(0, 36, 2);
|
||||
var kotlin = version(2, 1, 21);
|
||||
var langchain = version(1, 0, 0);
|
||||
scope(compile)
|
||||
// PircBotX
|
||||
.include(dependency("com.github.pircbotx", "pircbotx", "2.3.1"))
|
||||
|
@ -109,7 +108,7 @@ public class MobibotBuild extends Project {
|
|||
.include(dependency("org.apache.logging.log4j", "log4j-slf4j2-impl", log4j))
|
||||
// LangChain4J
|
||||
.include(dependency("dev.langchain4j", "langchain4j-open-ai", langchain))
|
||||
.include(dependency("dev.langchain4j", "langchain4j-google-ai-gemini", langchain))
|
||||
.include(dependency("dev.langchain4j", "langchain4j-google-ai-gemini", "1.0.0-beta5"))
|
||||
.include(dependency("dev.langchain4j", "langchain4j-core", langchain))
|
||||
.include(dependency("dev.langchain4j", "langchain4j", langchain))
|
||||
// Misc.
|
||||
|
@ -240,4 +239,25 @@ public class MobibotBuild extends Project {
|
|||
.extension(".kt")
|
||||
.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ class ChatGpt2 : AbstractModule() {
|
|||
.maxTokens(maxTokens)
|
||||
.build()
|
||||
|
||||
return model.generate(query)
|
||||
return model.chat(query)
|
||||
} catch (e: Exception) {
|
||||
throw ModuleException(
|
||||
"$CHATGPT_CMD($query): IO",
|
||||
|
|
|
@ -90,7 +90,7 @@ class Gemini2 : AbstractModule() {
|
|||
.maxOutputTokens(maxTokens)
|
||||
.build()
|
||||
|
||||
return gemini.generate(query)
|
||||
return gemini.chat(query)
|
||||
} catch (e: Exception) {
|
||||
throw ModuleException("$GEMINI_CMD($query): IO", IO_ERROR, e)
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ class ChatGpt2Test : LocalProperties() {
|
|||
.isInstanceOf(ModuleException::class.java)
|
||||
.hasNoCause()
|
||||
}
|
||||
|
||||
private val apiKey = getProperty(ChatGpt2.API_KEY_PROP)
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue