Skip to content

Commit

Permalink
langchain4j - clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
hbelmiro committed Jan 19, 2024
1 parent 3c7f4a3 commit eec5eb0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions intelligent-java-blog-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
<artifactId>quarkus-langchain4j-openai</artifactId>
<version>${quarkus.langchain4j.version}</version>
</dependency>
<dependency>
<groupId>com.knuddels</groupId>
<artifactId>jtokkit</artifactId>
<version>${com.knuddels.jtokkit.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.knuddels</groupId>-->
<!-- <artifactId>jtokkit</artifactId>-->
<!-- <version>${com.knuddels.jtokkit.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public BlogReaderResource(BlogReaderService blogReaderService, WebCrawler webCra
this.requestSplitter = requestSplitter;
}


@Path("/read")
@POST
@Produces(MediaType.TEXT_PLAIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public interface BlogReaderService {
@UserMessage("""
Here's the next part of the body page:
```html
{html}.
{html}
```
Wait for the next parts. Don't answer anything else.
""")
String sendBody(String html);

@UserMessage("""
That's it. You can sum up the article now. Stay quiet. Return only the sum up and the key takeaways.
That's it. You can sum up the article and add key takeaways to the end of the sum up.
""")
String sumUp();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class BlogReaderResourceTest {
@Test
void test() {
var blogReaderResource = new BlogReaderResource(new FakeBlogReaderService(), webCrawler, requestSplitter);
assertEquals("MockGPT", blogReaderResource.read("https://thegreatapi.com/blog/a-beginners-guide-to-contributing-to-open-source/"));
assertEquals("MockGPT", blogReaderResource.read("https://www.redhat.com/en/blog/the-power-of-ai-is-open"));
}
}

0 comments on commit eec5eb0

Please sign in to comment.