OpenAI Function Calling - Full Beginner Tutorial

Поделиться
HTML-код
  • Опубликовано: 5 июл 2023
  • A lot of data professionals want to explore freelancing, but lack the systems, tools, and guidance on how to get started. If you're curious about how we help data analysts, engineers, and scientists, beyond these videos, the link below will explain. No nonsense, no webinar and no "free training". Check it out: www.datalumina.com/data-freel...
    🔗 Links
    github.com/daveebbelaar/langc...
    openai.com/blog/function-call...
    👋🏻 About Me
    Hey there, my name is @daveebbelaar and I work as a freelance data scientist and run a company called Datalumina. You've stumbled upon my RUclips channel, where I give away all my secrets when it comes to working with data. I'm not here to sell you any data course - everything you need is right here on RUclips. Making videos is my passion, and I've been doing it for 18 years.
    🛠️ My Development Workflow
    • My Development Workflo...
    ✔️ My Project Management Tool
    clickup.pxf.io/datalumina
    🎓 Our Training Programs
    www.skool.com/data-alchemy
    www.skool.com/data-freelancer
    🔗 Let's Connect
    / daveebbelaar
    / daveebbelaar
    📥 Datalumina's Newsletter
    www.datalumina.com/newsletter
    📊 How I'm using data to track my health
    join.whoop.com/datalumina
  • НаукаНаука

Комментарии • 101

  • @daveebbelaar
    @daveebbelaar  11 месяцев назад +2

    👉🏻Learn more about data science and AI: www.datalumina.io/newsletter

    • @DeniseRezende-yk4us
      @DeniseRezende-yk4us 11 дней назад

      ruclips.net/video/aqdWSYWC_LI/видео.htmlfeature=shared&t=1025 - Include Multiple Functions
      ruclips.net/video/aqdWSYWC_LI/видео.htmlfeature=shared&t=1314 - Make It Conversational With Langchain

  • @JethiyaChampakGada
    @JethiyaChampakGada 5 месяцев назад +12

    I watched a few tutorials but every one just went through plain code, but this man is exceptional he put in so much effort to make us really understand what is going on

  • @lordmelbury7174
    @lordmelbury7174 10 месяцев назад +8

    Great that you don't just use the default examples, many channels are guilty of that! I have just subscribed!

  • @sankhachakraborty5801
    @sankhachakraborty5801 5 месяцев назад

    This is a brilliant walkthrough of the concept. Couldn't have asked for a better one. Excellent video Dave!

  • @SwingingInTheHood
    @SwingingInTheHood 8 месяцев назад +1

    "This should put you ahead of most people in understanding how these function calling methods work." I have to give it to you, you did an excellent job breaking it down. I've been working with OpenAI models for 8 months, primarily building a RAG application but also dabbling in Text to SQL. Didn't really understand how functions worked until this video. And I particularly like the fact that you went through the business logic of this thing rather than the programming specific logic. I am a PHP programmer, so seeing the logic flow visually was super-helpful. Great job. Bravo!

  • @brandongillins
    @brandongillins 11 месяцев назад

    Dave, love your videos best notification of the day, always! Finally got access to GPT-4 api! Let’s go test out some function calling!

  • @Ray_1998_
    @Ray_1998_ Месяц назад

    Amazing tutorial! The gradual scaling in complexity really helped me understand the concepts in clear terms. Thanks 😊

  • @jag-dt1lp
    @jag-dt1lp 2 дня назад

    honestly this is actually 10/10 thanks dude

  • @planplay5921
    @planplay5921 6 месяцев назад +4

    I have a question: do I have to write code repeatedly to make LLM respond to the first, second, third, or more responses? can't LLM get the function that should be executed in a prompt at once?

  • @frankkuipers2024
    @frankkuipers2024 9 месяцев назад

    Thank voor de video man! Heb al een poosje geen openai meer gebruikt maar deze functies zijn wel echt heel interessant

  • @hourglass8450
    @hourglass8450 10 месяцев назад

    Thank you! Good move and idea to be able to call functions and get results for processing with OpenAI. Opens up a lot of doors with integrating LLM to application backends.

  • @aipujols
    @aipujols 9 месяцев назад

    Hi Dave, great Function Calling tutorial video, thanks a lot!

  • @bugglebegger143
    @bugglebegger143 8 месяцев назад +2

    I watched 4 or so tutorial videos about functions and they just really didn't explain it well. Best one so far, and I really feel I get it now. Important thing to realize when starting off is that the descriptions are of central importance, you're essentially prompting GPT in the descriptions for how to respond. Functions seem to basically just be a way to format GPTs responses in a much more rigid manner and use their AI in a more controlled way to get the kind of information you want so you can use it how you want.

  • @pareak
    @pareak 8 месяцев назад

    The first 10 minutes really helped me a lot!

  • @arbengb
    @arbengb 10 месяцев назад +1

    Great video. Just came in so clutch for me. Thanks a ton Dave. I appreciate you putting this together.

  • @lixiasong3459
    @lixiasong3459 11 месяцев назад +6

    Wow, Dave! This is absolutely awesome! Your talent and dedication are truly inspiring. Thanks a lot for sharing this incredible content with us. This is exactly what I need right now. Keep up the fantastic work, my friend! I'll definitely be eagerly waiting for more amazing videos from you. Kudos to you and your amazing talent!

    • @JakubGaniaSoftware
      @JakubGaniaSoftware 11 месяцев назад +2

      I totally agree. I have exactly the same opinion, you wrote it very well!

    • @daveebbelaar
      @daveebbelaar  11 месяцев назад

      What a great way to start my day, thanks!! 🙏🏻

  • @sourabmangrulkar9105
    @sourabmangrulkar9105 5 месяцев назад

    Thank you for a nice overview of function calling!

  • @axioworks
    @axioworks 7 месяцев назад

    Excellent tutorial, right down to the point, thank you!

  • @raghavachowdary8658
    @raghavachowdary8658 Месяц назад

    Excellent explanation. Thank you :)

  • @supalarry1009
    @supalarry1009 9 месяцев назад

    great video Dave, thank you it was very useful!

  • @EmilioGagliardi
    @EmilioGagliardi 11 месяцев назад +2

    great tutoiral and explanation. thanks! I also want to learn how you use the ipython session to view the contents of your variables, I'm just learning how to use VS Code so that is a really neat feature. Its still so abstract that its hard to wrap your brain around it. but it is what it is :D

  • @justinwr092
    @justinwr092 9 месяцев назад

    this is incredible. and such a helpful video! thank you, it was just what I needed.

  • @micbab-vg2mu
    @micbab-vg2mu 11 месяцев назад +1

    Dave, fantastic video! Thanks for sharing. I was wondering if you could make a future video about the ChatGPT - Code Interpreter. I'm really curious to know if it's reliable enough to use in my Data Science workflow. Currently, I find myself doing a lot of copying and pasting between GPT-4 and Python, so I'm excited to see if the Code Interpreter can streamline this process.

  • @Lexqueso
    @Lexqueso Месяц назад

    Thanks man, i dont understand the documentation from the page, your video helps a lot

  • @catalincrisan4840
    @catalincrisan4840 7 месяцев назад

    Wow, this is so cool man! I run a tech startup where I'm looking to add chatbot functionality. I would love to chat more with you on this

  • @user-sd2xf9qh4y
    @user-sd2xf9qh4y 9 месяцев назад +1

    Great tutorial, at 3:35 how were you able to view the Completion variable using a keyboard shortcut? is it some kind of extension?

  • @seallyolme
    @seallyolme 3 месяца назад

    This is one of the most comprehensive tutorials that breaks down function calling in a simple manner. In the conversational example, you had to manually call the function 4 times to get the response you wanted. Is there a way to do this so that we can just iterate over the responses and the AI automatically knows when to stop iterating?

  • @YouBetterBeYou
    @YouBetterBeYou 9 месяцев назад

    That is awesome. Quick question:
    Is a second_completion necessary for the iteration on the user response? Can we not just use the function-call to also provide this iterated version of the response and read that out at the same time?
    So the question is, I guess, is the function applied AFTER the response is generated or does the function heavily restrict the response BEFORE it is generated. Given the statistical nature of the response mechanism I don't really see how it can do this beforehand and still guarantee a consistent outcome. But if it is after the response, then it is basically a way to iterate on the generated response by either restructuring or even semantically refelct on it (?)

  • @titi_build
    @titi_build 6 месяцев назад

    Awesome video man, thanks a ton!

  • @JaeHoSong
    @JaeHoSong 11 месяцев назад

    Great!! Thank you. This helped a lot.👍

  • @gsstargamer
    @gsstargamer 10 месяцев назад +1

    Top notch info right here.

  • @yixinsong
    @yixinsong 8 месяцев назад

    Hi Dave, thanks for this really good video! What is the plugin you are using in this video to show the response? (the one ends with .interactive)

    • @leobeeson1
      @leobeeson1 6 месяцев назад

      ruclips.net/video/zulGMYg0v6U/видео.htmlsi=OeTp5Kf-wH_1OHH4&t=863
      This feature was the reason I migrated from PyCharm to VSCode, and the best thing is I've never had to touch a bloody Jupyter notebook again (well, except for in Google Colab but that's force majeure).

  • @russgo4953
    @russgo4953 4 месяца назад

    Hey Dave, can i use the function calling in assistants too? So function parameter would be set in the client.beta.threads.messages.create i think?

  • @user-cq1rb5nd6e
    @user-cq1rb5nd6e 8 месяцев назад +2

    Hey Dave, could you please tell me, what's the shortcut key you are using to run the selected line of code directly in the interactive window?

    • @titi_build
      @titi_build 6 месяцев назад +1

      PLEASE YESS!! hahah i was exactly looking for that comment man haha

  • @techiteasyaus
    @techiteasyaus 5 месяцев назад

    Thanks Dave, very educational. I am in the process of converting the code to the latest openai API (1.6) as the completion API has changed. This is a good exercise as it forces me to rewrite the syntax of the functions and of the API calls. I've got it running but the last part with Langchain isn't working, it crashes at llm.predict_messages, no idea why. Cheers.

  • @kevon217
    @kevon217 11 месяцев назад

    Another banger of a video!

  • @israeabdelbar8994
    @israeabdelbar8994 3 месяца назад

    Huge thanks for the useful video 😊.
    I'm wondering whether you know how to deal with missing data within the prompt, for instance for the get flight info, imagine the user doesn't provide the destination, is the LLM has the ability to detect that, and back to the user ask him to provide missing info which is in this case the destination name?

  • @Amit-bq1gj
    @Amit-bq1gj 10 месяцев назад

    do I have to pay for function calls as well, suppose I have 100 functions, so would each time these function cost added?

  • @robinchriqui2407
    @robinchriqui2407 10 месяцев назад

    Thank you Dave, do you think we will see new kind of jobs related to OpenAi?

  • @tancheeken
    @tancheeken 4 месяца назад

    At 14:23, you use eval(function_call.name) to reference to function. Since there is only one function, wouldn't it be better to do without eval and call the function(**params) directly?

  • @agedbytes82
    @agedbytes82 11 месяцев назад

    Thank you!

  • @shukrantpatil
    @shukrantpatil 3 месяца назад

    Is it possible to deploy a particular assistant which I have created in the assistant builder using the assistant ID ??

  • @Reviews_by_Ryan
    @Reviews_by_Ryan 8 месяцев назад

    Hey Dave! Have you gotten gpt to run a function twice? For instance if the prompt is
    "Create two events.. here are their details..."
    But the function call only creates 1 event at a time, and gpt only returns details for one at a time.

    • @colkbassad
      @colkbassad 8 месяцев назад

      Try passing "two" as an int parameter in your function (and function_description) as an iteration amount and have the return value a list instead. I have no idea if this would work, I'm still getting a grasp on function calling.

  • @uchennannamani7401
    @uchennannamani7401 8 месяцев назад

    I have a major issue, I automated the function calling but it does not always call the correct function, I need to leave it on auto so it decides when it is time to call a function. How can I make sure it always calls correct function? Function description is not working. It just calls the functions randomly

  • @rachadlakis1
    @rachadlakis1 6 месяцев назад

    THank you for ur effort

  • @RAMOLLAPRAKASH
    @RAMOLLAPRAKASH 3 месяца назад

    Thank you .

  •  4 месяца назад

    This will work different now for Assistants?

  • @shraey2021
    @shraey2021 11 месяцев назад

    You reckon then this replace the whole need of Tools in Langchain? or the need for Langchain altogether?

    • @daveebbelaar
      @daveebbelaar  11 месяцев назад

      This will definitely change things as the LangChain tools are essentially doing this under the hood. They will likely update the library to pick tools based on function calling.

  • @markp2381
    @markp2381 9 месяцев назад

    Can the properties be anything else other than object?

  • @holacuba2001
    @holacuba2001 4 месяца назад

    All brilliant and excellent learning material! But at 22:08 you have written the user input very nicely yourself, with all required parameters in place. This obviously is not the real life scenario. In my experience if the user omits one of the two required parameters the system will ask for it... and forget the already supplied parameter. Anyway, I profited here by learning how the functions work, how multiple functions work, and what is that "auto" parameter. Thanks.

  • @JazevoAudiosurf
    @JazevoAudiosurf 10 месяцев назад

    any way to make it more likely to call the function?

  • @user-ul5ys8pe1r
    @user-ul5ys8pe1r 5 месяцев назад

    Great!!

  • @broskmohammad8169
    @broskmohammad8169 6 месяцев назад

    are the python files you just ran saved somewhere ?

  • @YEM_
    @YEM_ 10 месяцев назад +1

    At 15:30 ish, how did it suddenly get internet access? I don't see where we enabled that.

    • @titi_build
      @titi_build 6 месяцев назад

      he faked an API call, and returned some hard coded data from his function

  • @enatsutoru7377
    @enatsutoru7377 4 месяца назад

    what is the plug-in name? It’s useful

  • @echandiac
    @echandiac 4 месяца назад

    is this just for python? is it posible to do this on php?

  • @shubhamverma2531
    @shubhamverma2531 2 месяца назад

    what plugin you are using for interactive CLI.

    • @daveebbelaar
      @daveebbelaar  2 месяца назад

      More info on that here: ruclips.net/video/3sIzCFuLgIQ/видео.html

  • @justicecalderon6641
    @justicecalderon6641 11 месяцев назад

    What screen recording software do you use?

  • @santiagobattezzati7895
    @santiagobattezzati7895 9 месяцев назад +2

    In real life, some times the user won t provide all the info you need for calling your function. How would you do to make GPT ask again for the missing information before calling the function.

    • @andrewwilliams5773
      @andrewwilliams5773 2 месяца назад

      You make one of the defined functions "get_complete_info(function_def, required_fields)" which itself calls an AI response to request this from the user. Then process the response and return the required_fields to the original function.

  • @RAMOLLAPRAKASH
    @RAMOLLAPRAKASH 3 месяца назад

    same can you please do one video on the function call on Gemini Ai ?

  • @user-ul8iu7kb2u
    @user-ul8iu7kb2u 3 месяца назад

    its assuming the parameters but is should ask the required arguments

  • @deathspainvincentblood6745
    @deathspainvincentblood6745 11 месяцев назад

    can u compare theme between programming helper 1990s vs CHAT GPT the programming helper there's no errors code depend on ur personal if u not believe me u can try programming helper and plus u r helping people

  • @vishalpachpande5921
    @vishalpachpande5921 6 дней назад

    Yea but how to put this into any production

  • @tijldeclerck7772
    @tijldeclerck7772 10 месяцев назад

    Hollander!

  • @archiee1337
    @archiee1337 10 месяцев назад

    Gold

  • @DeniseRezende-yk4us
    @DeniseRezende-yk4us 11 дней назад

    ruclips.net/video/aqdWSYWC_LI/видео.htmlfeature=shared&t=1025 - Include Multiple Functions
    ruclips.net/video/aqdWSYWC_LI/видео.htmlfeature=shared&t=1314 - Make It Conversational With Langchain

  • @goranceurukic8185
    @goranceurukic8185 8 месяцев назад

    Please don't use eval, result can be something unexpected and you can end up leaking unwanted parts of code/information

  • @SilvioAltmann-ek9rw
    @SilvioAltmann-ek9rw 5 месяцев назад

    OMG this is soooo cool! How amazing is this?? Love it. So I just add a random function the way it should be and the calling system is expected to return the right response..... YAYYY!°!!!111🍆💦

  • @parkersettle460
    @parkersettle460 3 месяца назад

    Has anyone tried this with a webhook?

  • @keithconner3982
    @keithconner3982 5 месяцев назад +2

    These videos would be stellar if they didn't have the background music-noise which is extremely annoying.

  • @Celso-tb6eb
    @Celso-tb6eb 2 месяца назад

    all good, but did the bg music puts me to sleep why you put it

  • @KilianMpoint
    @KilianMpoint 5 месяцев назад

    please cut the very high frequency when you speak, maybe you don't hear that frequency but it's horrible, cut above 15000/15500 hz, please 🙏🙏

    • @daveebbelaar
      @daveebbelaar  5 месяцев назад

      I will look into this, thanks! I don't hear it myself.

  • @Mis_guidedz
    @Mis_guidedz 11 месяцев назад

    Wtf

  • @awsick
    @awsick 10 месяцев назад

    Please do not recommend that folks casually use the `eval` function - that's pretty dangerous!

  • @user-pq6tt5pi8y
    @user-pq6tt5pi8y 5 месяцев назад

    well explained

  • @user-wj8xk4lv2v
    @user-wj8xk4lv2v 10 месяцев назад

    Still super unstable( and can't help u reduce gpt requests and even consume more tokens. I hope this helps to transform original answer into answers with params: like {
    "message": {
    "role": "assistant",
    "content": "reply",
    "": "param0",
    "": "param01"
    }
    }