-
-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using langchain4j module #11273
Conversation
@pascalgrimaud @jdubois what do you think about these changes |
src/main/resources/generator/server/springboot/langchain4j/langchain4j.md.mustache
Outdated
Show resolved
Hide resolved
...h/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java
Show resolved
Hide resolved
...tor/server/springboot/langchain4j/infrastructure/primary/LangChain4JModuleConfiguration.java
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,5 @@ | |||
# LangChain4J |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# LangChain4J | |
# LangChain4j |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I do that mistake all the time!!!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CamelCase syndrome 😄
In another PR, I would add a new module import dev.langchain4j.model.chat.ChatLanguageModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api")
class ChatController {
private final ChatLanguageModel chatLanguageModel;
public ChatController(ChatLanguageModel chatLanguageModel) {
this.chatLanguageModel = chatLanguageModel;
}
@GetMapping("/chat")
public String model(@RequestParam(value = "message", defaultValue = "Hello") String message) {
return chatLanguageModel.generate(message);
}
} So it will help the user to test it (similar to the documentation): |
...h/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java
Outdated
Show resolved
Hide resolved
Super happy to see this! As I'm mostly using Azure OpenAI and GitHub Models, I'll need to have a look at adding those on top of this PR. |
So you'll have to make langChain4j module dependent on spring-boot-mvc-empty because you'll need rest dependency |
...ipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactoryTest.java
Outdated
Show resolved
Hide resolved
...h/jhipster/lite/generator/server/springboot/langchain4j/domain/LangChain4JModuleFactory.java
Outdated
Show resolved
Hide resolved
exactly @anunnakian :-) |
Thanks a lot for your contribution @anunnakian ! |
@anunnakian : approved |
I add langchain4j support by using langchain4j-spring-starter dependency (version: 0.35.0)
It fixes #9298