Gemini LLM JSON Mode: Generate Structured Output from LLM

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • Learn how to harness the power of Gemini LLM's JSON mode to generate consistent and structured JSON outputs from large language models (LLMs). This video demonstrates step-by-step how to configure Gemini LLM, optimize prompts, and ensure accurate JSON responses.
    GitHub: github.com/AIA...
    Join this channel to get access to perks:
    / @aianytime
    To further support the channel, you can contribute via the following methods:
    Bitcoin Address: 32zhmo5T9jvu8gJDGW3LTuKBM1KPMHoCsW
    UPI: sonu1000raw@ybl
    #gemini #ai #llm

ความคิดเห็น • 15

  • @MarceloFerreira-rl6hh
    @MarceloFerreira-rl6hh 2 หลายเดือนก่อน

    Great video! Thanks. You provided two options. 1 where you specify the JSON schema in the actual prompt and 2. Where the JSON schema is part of the config / schema_response part. Which one is more reliable 1 or 2?

  • @talalmuzaffar
    @talalmuzaffar 4 หลายเดือนก่อน +1

    Thanks for this amazing video ✨❤I was actually looking for a solution to force JSON output and here you are with the video 😅

    • @adityashinde436
      @adityashinde436 4 หลายเดือนก่อน +1

      return json.loads(response.text.strip('```json').strip('```').strip()) or
      return json.loads(response.text.strip(' ```json').strip('```').strip())
      use these to get output in json (make sure write "return the response in json format" in prompt)

    • @hamzawaleed
      @hamzawaleed หลายเดือนก่อน

      You don't need to strip manually, simple add instructions in promot to not include ``` for formatting

  • @shadyether1451
    @shadyether1451 18 วันที่ผ่านมา

    what about langchain? how do i get json structured output from langchain?

  • @muhammedajmalg6426
    @muhammedajmalg6426 4 หลายเดือนก่อน

    thanks for this video

  • @bastabey2652
    @bastabey2652 2 หลายเดือนก่อน +1

    google JSON output documentation is lousy

  • @velugucharan8096
    @velugucharan8096 4 หลายเดือนก่อน

    Sir can you build one application based on this multi model llm with Gemini llm medical chat bot user want to upload the image based on the image the modal want to give some medicine and food diet please upload this video tomorrow sir

  • @abdulqadar9580
    @abdulqadar9580 4 หลายเดือนก่อน

    amazing

    • @AIAnytime
      @AIAnytime  4 หลายเดือนก่อน

      Thanks

  • @myfullstackdev
    @myfullstackdev 4 หลายเดือนก่อน

    sourcecode link is broken

    • @AIAnytime
      @AIAnytime  4 หลายเดือนก่อน

      Updated. Apologies

  • @josephroman2690
    @josephroman2690 4 หลายเดือนก่อน

    your link has fall, could u update it

    • @AIAnytime
      @AIAnytime  4 หลายเดือนก่อน

      Yes done. Apologies