Spring AI Introduction: Building AI Applications in Java with Spring

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 58

  • @fibfranco
    @fibfranco 9 місяців тому +30

    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!

    • @DanVega
      @DanVega  9 місяців тому +4

      That is funny 😄 I certainly don’t have all of my subscribers phones tapped 😂

  • @sohamsarkar174
    @sohamsarkar174 9 місяців тому +7

    Dan loved your session. Please upload a detailed video on RAG

  • @MohamedDernoun
    @MohamedDernoun 9 місяців тому

    How clear is your explanation, best address for people who scare from java!

  • @abdelkarimlyoussi3607
    @abdelkarimlyoussi3607 21 день тому

    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...😄

  • @WisdomofHal
    @WisdomofHal 9 місяців тому

    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!

  • @theunthinkable6280
    @theunthinkable6280 9 місяців тому +1

    Top, Clear, Informative. Good job!

  • @scitechplusexplorer2484
    @scitechplusexplorer2484 9 місяців тому +6

    Hey Dan, hello, Good Evening! Please make a full video on GraphQL including Pagination with latest Spring Boot version. It would be very helpful.

    • @DanVega
      @DanVega  9 місяців тому +1

      I have done a video on pagination you can watch it here
      ua-cam.com/video/3YTSh8vJ8eY/v-deo.html

  • @ThabaniMoyo-q7u
    @ThabaniMoyo-q7u 8 місяців тому

    Awesome @Dan Vega!! Keeping it simple but effective. Gave me the needed high level overview that I needed

  • @grrlgd3835
    @grrlgd3835 6 місяців тому

    great stuff Dan... please do more . cant wait to see the next content. keep up the good work

  • @kevinjia1984
    @kevinjia1984 15 днів тому

    super cool, thanks Dan

  • @walterpalladino1965
    @walterpalladino1965 9 місяців тому +2

    Great video. Can Spring AI interact with a local LLM? If can do it, will be great to se an example. Thanks.

  • @douglasdotv
    @douglasdotv 8 місяців тому

    Thank you for another video.

  • @unus55
    @unus55 9 місяців тому

    Thanks for the wonderful session

  • @CodeBank-rw9bq
    @CodeBank-rw9bq 9 місяців тому

    Exactly this is what I was looking for ❤

  • @sagarbhat1
    @sagarbhat1 9 місяців тому +2

    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.

    • @DanVega
      @DanVega  9 місяців тому +3

      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

    • @sagarbhat3884
      @sagarbhat3884 9 місяців тому

      @@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
    @stephaneislistening6103 7 місяців тому +2

    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.

    • @stephaneislistening6103
      @stephaneislistening6103 7 місяців тому +2

      And so the chatClient bean could not be found, with the default implementation being: class DefaultChatClient implements ChatClient

    • @alanbarrientos9978
      @alanbarrientos9978 6 місяців тому +1

      @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

    • @alanbarrientos9978
      @alanbarrientos9978 6 місяців тому +1

      ​@@stephaneislistening6103
      I found the solution
      Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work

    • @alanbarrientos9978
      @alanbarrientos9978 6 місяців тому +1

      @@stephaneislistening6103
      I found the solution
      Try using OpenAiChatModel class instead of using the ChatClient interface and let the dependency injection made his work

  • @ArunKumar-jk5pq
    @ArunKumar-jk5pq 5 місяців тому

    @Dan Vega What is the IntelliJ theme you are using? It looks cool.

  • @minarashidi868
    @minarashidi868 7 місяців тому

    Thanks, that was so inspiring!

  • @kafkaesqued
    @kafkaesqued 7 місяців тому

    Hello Sir, could you provide a reference for SVN to GitHub migration with the help of Spring Java + GenAI tech

  • @BananBananski
    @BananBananski 9 місяців тому +1

    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?

    • @DanVega
      @DanVega  9 місяців тому +2

      Yes there is a StreamingChatClient
      docs.spring.io/spring-ai/reference/api/chatclient.html#_streamingchatclient

  • @nikhilrathi3627
    @nikhilrathi3627 6 місяців тому

    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.

  • @terrabys
    @terrabys 9 місяців тому

    Is there support for agentic workflow?

  • @ToddShafferW
    @ToddShafferW 3 місяці тому

    Great video!

  • @dew_reddit
    @dew_reddit 3 місяці тому +1

    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.

    • @DanVega
      @DanVega  3 місяці тому

      Please check out this video
      ua-cam.com/video/De9a-TaJImI/v-deo.html

  • @muslehhaj4164
    @muslehhaj4164 9 місяців тому

    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 ⚠

  • @gsilveralan
    @gsilveralan 9 місяців тому

    Geat video please do one with RAG

  • @backtoGodhead0
    @backtoGodhead0 7 місяців тому

    so cool, God bless you!

  • @adityasinghrajput7815
    @adityasinghrajput7815 9 місяців тому

    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

  • @tharindurajarathna
    @tharindurajarathna 6 місяців тому +2

    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();
    }

  • @sairamm.9700
    @sairamm.9700 4 місяці тому

    Thanks for the video. I ran into "Could not autowire. No beans of 'ChatClient' type found. " error. Anyone?

    • @milankovacevic89
      @milankovacevic89 2 місяці тому

      You need to build it yourself like ChatClient.builder(openAiChatModel).build(); where openAiChatModel is the bean you can autowire

  • @stephaneislistening6103
    @stephaneislistening6103 7 місяців тому

    Very cool Thanks !

  • @Bibhaw
    @Bibhaw 8 місяців тому

    Well explained, Thanks vega :)
    Can't we directly autowired ChatClient ?

  • @swethavemula1524
    @swethavemula1524 6 місяців тому

    getting error as " 'call(java.lang.String)' is deprecated and marked for removal " . By which method do i need to modify

    • @srisan9344
      @srisan9344 6 місяців тому

      same problem did you modify it

    • @satyam949
      @satyam949 6 місяців тому

      @@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 ?

    • @adods4058
      @adods4058 6 місяців тому

      @@satyam949 This works @GetMapping("/ai")
      String generation(@RequestParam(value = "message", defaultValue = "Are dogs loved?") String userInput) {
      return this.chatClient.prompt()
      .user(userInput)
      .call()
      .content();
      }

    • @adods4058
      @adods4058 6 місяців тому

      @@srisan9344 @GetMapping("/ai")
      String generation(@RequestParam(value = "message", defaultValue = "Are dogs loved?") String userInput) {
      return this.chatClient.prompt()
      .user(userInput)
      .call()
      .content();
      }

    • @adods4058
      @adods4058 6 місяців тому

      @@srisan9344 This works @GetMapping("/ai")
      String generation(@RequestParam(value = "message", defaultValue = "Dogs wonderful?") String userInput) {
      return this.chatClient.prompt()
      .user(userInput)
      .call()
      .content();
      }

  • @satyam949
    @satyam949 6 місяців тому +1

    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 ?

    • @robertfox1975
      @robertfox1975 2 місяці тому

      Yes, use this.chatClient=chatClient.build(); in the constructor.
      And something like return this.chatClient.prompt()
      .user(message).call().content(); in the API body

  • @crampanelarutzi
    @crampanelarutzi 9 місяців тому

    please make a video about weka framework.

  • @davidwaziri333
    @davidwaziri333 7 місяців тому

    Can you use free ChatGPT API key for this?

  • @checkantetibo
    @checkantetibo 9 місяців тому

    Interesting

  • @Gijox1
    @Gijox1 8 місяців тому

    Very nice!

  • @antonslonkin
    @antonslonkin 9 місяців тому

    Interesting!!!