Such an amazing coincidence haha I started looking at the Spring AI project for the first time a couple hours ago and thought: "wonder if vega has posted something about it" and you just did :) thank you, man!
Thanks Dan for this eye opening video. Very interesting especially that Spring as usual takes away the heavy burden of marshelling and unmarshelling boilerplate code to make coders life easy...😄
Oh my goodness. In my current Springboot project I've created a complete "Python Engine", using Java's process builder, to create embedding, parse embeddings, run all the required python scripts, error handling and output to create and run RAG Chains. It was quite fun, but this will help tremendously to take that load off. Thanks for sharing will be looking deeper into this. Cheers!
Thanks for taking time to make this video Dan. I’m building a RAG based application and have tried LangChain4j and Spring AI, and at this stage LangChain4j seems to have more features (Chat Memory, Hybrid semantic search with Azure AI search vector store) compared to Spring AI. But at the rate at which Spring AI is being developed, I’m sure it will catch up. Quick question - is there an easy way to log the requests and responses to/from the Open AI service in Spring AI? In Langchain4j it’s as simple as adding a property.
Spring AI in an MVC stack is using the RestClient. You need to enable logging for what ever underlying http client you're using which by default is the HttpUrlConnection. You can set this logging level to see the request/response. I would take this one step further though and add the actuator where you can then get metrics on all of these calls. logging.level.sun.net.www.protocol.http.HttpURLConnection=DEBUG
@@DanVega I tried this (logging.level.sun.net.www.protocol.http.HttpURLConnection=DEBUG) but it did not help. I could not see any trace of the request and response to/from the AI model.
@stephaneislistening6103 I am facing with the same problem Edit: I found the solution Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work
@@stephaneislistening6103 I found the solution Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work
@@stephaneislistening6103 I found the solution Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work
Looks like the ChatClient is synchronous and some models take a long time to respond - that would be a bottleneck in many use cases. Is there an asynchronous implementation as well?
Hey @Danvega Can we not build these applications without using open Ai . ? Cause that costs. I was thinking to build a audio generation platform where users can build the songs based on different genres.
I wish there could be a newer version of these videos. the API has changed completely so none of these changes apply. Documentation consists of some eamples but even those are pretty outdated. Need to rely directly on github repos and issues.
Hello Spring Boss 💪, I have a course idea but no one in "Udemy" did it yet K I've tried few course in Udemy , but none of them completed... I'm looking for a full-stack project wise course using spring boot as backend & Vaadin for front end .... but not sure if Vaadin is the right choice to build a real-life application .... please Advise me Boss ⚠
Sir please upload a full spring boot beginner to advanced series and after that spring security then spring cloud then micro servise then full project with spring boot integration of spring AI
It seems like the API has changed drastically since this video was released. The chatClient object is not getting injected with the constructor argument. On the other hand, the chatClient's call(String) method is deprecated. import org.springframework.ai.chat.client.ChatClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class Config { @Bean public ChatClient chatClient(ChatClient.Builder builder) { return builder.build(); } } ------------------------------------------------------------------------------------------- private final ChatClient chatClient; public ChatServiceImpl(ChatClient chatClient) { this.chatClient = chatClient; } @Override public String generateText(String textMessage) { return chatClient.prompt() .user(textMessage) .call() .content(); }
@@srisan9344 I think this is outdate video, I also see that chatClient object is not getting injected with constructor argument. On the other hand chatClient's call(String) method is deprecated. Did any one had a chance to make it work ?
I think this is outdate video, I also see that chatClient object is not getting injected with constructor argument. On the other hand chatClient's call(String) method is deprecated. Did any one had a chance to make it work ?
Yes, use this.chatClient=chatClient.build(); in the constructor. And something like return this.chatClient.prompt() .user(message).call().content(); in the API body
Such an amazing coincidence haha
I started looking at the Spring AI project for the first time a couple hours ago and thought: "wonder if vega has posted something about it" and you just did :)
thank you, man!
That is funny 😄 I certainly don’t have all of my subscribers phones tapped 😂
Dan loved your session. Please upload a detailed video on RAG
How clear is your explanation, best address for people who scare from java!
Thanks Dan for this eye opening video. Very interesting especially that Spring as usual takes away the heavy burden of marshelling and unmarshelling boilerplate code to make coders life easy...😄
Oh my goodness. In my current Springboot project I've created a complete "Python Engine", using Java's process builder, to create embedding, parse embeddings, run all the required python scripts, error handling and output to create and run RAG Chains. It was quite fun, but this will help tremendously to take that load off. Thanks for sharing will be looking deeper into this. Cheers!
Top, Clear, Informative. Good job!
Hey Dan, hello, Good Evening! Please make a full video on GraphQL including Pagination with latest Spring Boot version. It would be very helpful.
I have done a video on pagination you can watch it here
ua-cam.com/video/3YTSh8vJ8eY/v-deo.html
Awesome @Dan Vega!! Keeping it simple but effective. Gave me the needed high level overview that I needed
great stuff Dan... please do more . cant wait to see the next content. keep up the good work
super cool, thanks Dan
Great video. Can Spring AI interact with a local LLM? If can do it, will be great to se an example. Thanks.
Thank you for another video.
Thanks for the wonderful session
Exactly this is what I was looking for ❤
Thanks for taking time to make this video Dan.
I’m building a RAG based application and have tried LangChain4j and Spring AI, and at this stage LangChain4j seems to have more features (Chat Memory, Hybrid semantic search with Azure AI search vector store) compared to Spring AI. But at the rate at which Spring AI is being developed, I’m sure it will catch up.
Quick question - is there an easy way to log the requests and responses to/from the Open AI service in Spring AI? In Langchain4j it’s as simple as adding a property.
Spring AI in an MVC stack is using the RestClient. You need to enable logging for what ever underlying http client you're using which by default is the HttpUrlConnection. You can set this logging level to see the request/response. I would take this one step further though and add the actuator where you can then get metrics on all of these calls.
logging.level.sun.net.www.protocol.http.HttpURLConnection=DEBUG
@@DanVega I tried this (logging.level.sun.net.www.protocol.http.HttpURLConnection=DEBUG) but it did not help. I could not see any trace of the request and response to/from the AI model.
On SpringBoot 3.3.0 here and the OpenAI API seems to have changed quite a bit already in a month since this video was published.
And so the chatClient bean could not be found, with the default implementation being: class DefaultChatClient implements ChatClient
@stephaneislistening6103
I am facing with the same problem
Edit:
I found the solution
Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work
@@stephaneislistening6103
I found the solution
Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work
@@stephaneislistening6103
I found the solution
Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work
@Dan Vega What is the IntelliJ theme you are using? It looks cool.
Thanks, that was so inspiring!
Hello Sir, could you provide a reference for SVN to GitHub migration with the help of Spring Java + GenAI tech
Looks like the ChatClient is synchronous and some models take a long time to respond - that would be a bottleneck in many use cases. Is there an asynchronous implementation as well?
Yes there is a StreamingChatClient
docs.spring.io/spring-ai/reference/api/chatclient.html#_streamingchatclient
Hey @Danvega Can we not build these applications without using open Ai . ?
Cause that costs. I was thinking to build a audio generation platform where users can build the songs based on different genres.
Is there support for agentic workflow?
Great video!
I wish there could be a newer version of these videos. the API has changed completely so none of these changes apply. Documentation consists of some eamples but even those are pretty outdated. Need to rely directly on github repos and issues.
Please check out this video
ua-cam.com/video/De9a-TaJImI/v-deo.html
Hello Spring Boss 💪, I have a course idea but no one in "Udemy" did it yet K I've tried few course in Udemy , but none of them completed... I'm looking for a full-stack project wise course using spring boot as backend & Vaadin for front end .... but not sure if Vaadin is the right choice to build a real-life application .... please Advise me Boss ⚠
Geat video please do one with RAG
so cool, God bless you!
Sir please upload a full spring boot beginner to advanced series and after that spring security then spring cloud then micro servise then full project with spring boot integration of spring AI
It seems like the API has changed drastically since this video was released. The chatClient object is not getting injected with the constructor argument. On the other hand, the chatClient's call(String) method is deprecated.
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class Config {
@Bean
public ChatClient chatClient(ChatClient.Builder builder) {
return builder.build();
}
}
-------------------------------------------------------------------------------------------
private final ChatClient chatClient;
public ChatServiceImpl(ChatClient chatClient) {
this.chatClient = chatClient;
}
@Override
public String generateText(String textMessage) {
return chatClient.prompt()
.user(textMessage)
.call()
.content();
}
Thanks for the video. I ran into "Could not autowire. No beans of 'ChatClient' type found. " error. Anyone?
You need to build it yourself like ChatClient.builder(openAiChatModel).build(); where openAiChatModel is the bean you can autowire
Very cool Thanks !
Well explained, Thanks vega :)
Can't we directly autowired ChatClient ?
getting error as " 'call(java.lang.String)' is deprecated and marked for removal " . By which method do i need to modify
same problem did you modify it
@@srisan9344 I think this is outdate video, I also see that chatClient object is not getting injected with constructor argument. On the other hand chatClient's call(String) method is deprecated. Did any one had a chance to make it work ?
@@satyam949 This works @GetMapping("/ai")
String generation(@RequestParam(value = "message", defaultValue = "Are dogs loved?") String userInput) {
return this.chatClient.prompt()
.user(userInput)
.call()
.content();
}
@@srisan9344 @GetMapping("/ai")
String generation(@RequestParam(value = "message", defaultValue = "Are dogs loved?") String userInput) {
return this.chatClient.prompt()
.user(userInput)
.call()
.content();
}
@@srisan9344 This works @GetMapping("/ai")
String generation(@RequestParam(value = "message", defaultValue = "Dogs wonderful?") String userInput) {
return this.chatClient.prompt()
.user(userInput)
.call()
.content();
}
I think this is outdate video, I also see that chatClient object is not getting injected with constructor argument. On the other hand chatClient's call(String) method is deprecated. Did any one had a chance to make it work ?
Yes, use this.chatClient=chatClient.build(); in the constructor.
And something like return this.chatClient.prompt()
.user(message).call().content(); in the API body
please make a video about weka framework.
Can you use free ChatGPT API key for this?
Interesting
Very nice!
Interesting!!!