From ede3d24cf20ce6437a608a4480048373fa40283a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Bre=C3=B1a=20Moral?= Date: Fri, 21 Jul 2023 19:28:12 +0200 Subject: [PATCH 1/2] Initial test --- pom.xml | 2 ++ spring-boot-starter-user-beans/pom.xml | 5 +++++ .../io/github/jabrena/GoogleBardTest.java | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java diff --git a/pom.xml b/pom.xml index 6ad9d6d..7c2d9f3 100644 --- a/pom.xml +++ b/pom.xml @@ -143,11 +143,13 @@ 17 + true diff --git a/spring-boot-starter-user-beans/pom.xml b/spring-boot-starter-user-beans/pom.xml index 2f5c794..fe22881 100644 --- a/spring-boot-starter-user-beans/pom.xml +++ b/spring-boot-starter-user-beans/pom.xml @@ -69,6 +69,11 @@ 2.27.2 test + + com.pkslow + google-bard + 0.3.4 + diff --git a/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java b/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java new file mode 100644 index 0000000..b98daab --- /dev/null +++ b/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java @@ -0,0 +1,20 @@ +package io.github.jabrena; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.pkslow.ai.Client; +import com.pkslow.ai.domain.Answer; +import com.pkslow.ai.domain.AnswerStatus; +import org.junit.jupiter.api.Test; + +class GoogleBardTest { + + @Test + void shouldWorks() { + String token = ""; + AIClient client = new GoogleBardClient(token); + Answer answer = client.ask("can you show me a picture of clock?"); + + assertThat(answer.getStatus()).isEqualTo(AnswerStatus.OK); + } +} From be736d0af419a749724da3f3a54174434b8fe916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Antonio=20Bre=C3=B1a=20Moral?= Date: Fri, 21 Jul 2023 17:43:45 +0000 Subject: [PATCH 2/2] New tests with bard library; KO --- .../src/test/java/io/github/jabrena/GoogleBardTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java b/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java index b98daab..24664cf 100644 --- a/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java +++ b/spring-boot-starter-user-beans/src/test/java/io/github/jabrena/GoogleBardTest.java @@ -2,7 +2,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.pkslow.ai.Client; +import com.pkslow.ai.AIClient; +import com.pkslow.ai.GoogleBardClient; import com.pkslow.ai.domain.Answer; import com.pkslow.ai.domain.AnswerStatus; import org.junit.jupiter.api.Test; @@ -11,10 +12,11 @@ class GoogleBardTest { @Test void shouldWorks() { - String token = ""; + String token = "ZAieRN7BGf6wg543LABRXAzwtc9GCEJ18b96OYBG6j-MFZZ15q5XDm31xNec5Q5lcZucGQ."; AIClient client = new GoogleBardClient(token); Answer answer = client.ask("can you show me a picture of clock?"); - assertThat(answer.getStatus()).isEqualTo(AnswerStatus.OK); + System.out.println(answer.toString()); + assertThat(answer.getStatus()).isEqualTo(AnswerStatus.ERROR); } }