Build your FIRST OpenAI Assistant With Function Calling

Поделиться
HTML-код
  • Опубликовано: 15 июн 2024
  • Today, we'll use OpenAI's brand NEW Assistants feature to create an assistant that can call functions for us! I'll take you through a brief tutorial of how you can call an external API to help an Assistant answer questions using live flight data!
    Documentation
    ===
    - OpenAI Assistants: platform.openai.com/docs/assi...
    - OpenAI Function Calling: platform.openai.com/docs/guid...
    Timestamps
    ===
    0:00 What are OpenAI Assistant Functions?
    0:21 How functions work, step-by-step
    1:23 A live example
    2:18 How to build an OpenAI Assistant with Function Calling
    12:00 Outtro
    Link to Notebook
    ===
    gist.github.com/Sarghm/52f1a1...
  • НаукаНаука

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

  • @veeratilak8731
    @veeratilak8731 16 дней назад +1

    Wonderful, finally someone who doesn’t use a chatbot mechanism and explains how this works!!!

  • @kashishvarshney2225
    @kashishvarshney2225 5 месяцев назад +6

    everything literally everything I am searching since 1 month. please make more video on this topic for complex situations. please make video I really need it. thanks a lot

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

    I watched about 8 other videos trying to figure out this process. This one cracked it for me. Nice one.

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

    Bro imma be honest with you… i have seen a lot of videos trying to to understand how to integrate custom functions in my assistant, but none of them worked for me until i saw your video🙏🙏 thanks a lot, you have great teaching skills 🤙 u r the best

  • @ifightcode
    @ifightcode 6 месяцев назад +2

    Your function calling tutorial was such a lifesaver! Made it sooo easy to put it into my project. You're a coding angel!

    • @MakeStuffWithAI
      @MakeStuffWithAI  6 месяцев назад +2

      Comments like this make all the work feel like it was worth it, ha! Thanks so much for the kind words!

  • @Free-pp8mr
    @Free-pp8mr 5 месяцев назад +4

    Highly useful! In conditions when we have huge amount of marketing AI videos, and small amount technical ones, your video is very interesting and efficient! Thank you!

  • @cheetah100
    @cheetah100 3 месяца назад +2

    Awesome, very straight forward explanation.

  • @user-qt8ow7yl8i
    @user-qt8ow7yl8i 6 дней назад

    Thanks a lot for the clear and very informative explanation

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

    all you need in 12 minutes - thanks for this !!

  • @rasdanc1
    @rasdanc1 5 месяцев назад +1

    Thank you for the tutorial, it was very much appreciated, and very well explained such that even an amateur such as myself can understand it. I will be building an assistant to learn about my work site, as a veryquick example -- showing it a diagram of the door closing mechanism on the front entrance door, so that in the future it can help with troubleshooting/advising how to make a certain adjustments such as the door closing speed. Over time I'll have something similar to the computer on the Enterprise.... maybe. Anyway, it might be a fun video for you to consider making, and selfishly I might also get some pointers or ideas when seeing how you approach such a project.

  • @rumpelstilzchen2539
    @rumpelstilzchen2539 7 месяцев назад +2

    That helped a lot. Keep going with these Assistant tutorials. They are great.

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

      Thanks so much for the kind words! I'll get to work on some more :)

  • @user-rj6cw4sk9l
    @user-rj6cw4sk9l 2 месяца назад

    Amazing Video, Got my Respect! Thank you for that!

  • @ampagetech2624
    @ampagetech2624 7 месяцев назад +1

    Great tutorial , very clear screen and voice , helped a lot on function call

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

      Thanks for the kind words, and thanks again for subscribing! ❤

  • @user-rj6cw4sk9l
    @user-rj6cw4sk9l 2 месяца назад

    Please Do more Videos With OpenAI, API, Tools and Assistant API. Worth it.

  • @tribat68
    @tribat68 5 месяцев назад +1

    This was very informative. I’ve thought about doing something like this to take my current location and maybe a compass direction and use an adsb API to fetch the planes in that direction from me and return them in order of how close they are to me. Additional feature might be to use a plane reference site to gather additional details or emphasize more unusual ones. This would let me essentially ask “what’s flying low to the west of me” and have it describe the sub hunter plane that sometimes trains around here. It’s essentially the same thing as me pulling up a flight radar app on my phone, then googling for details about the one that caught my attention.
    If practical, this might be an interesting follow up.

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

    Very nice, well explained. Thank you! =]

  • @juanreyes9449
    @juanreyes9449 6 месяцев назад +2

    Excellent video, it was very helpful. Could you attach the notebook that you show in the video in order to make the interpretation and understanding of the concepts easier?

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

      No problem - have put the link in the description :)

  • @paulham.2447
    @paulham.2447 7 месяцев назад +2

    Excellent ! Thanks

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

      Thanks Paul! Hope it helped a bit :)

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

    Great video, very helhful

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

    Thank you very much. Could you please share the ipynb file you used in the video? The file mentioned in the comments seems to be different from the one in the video.

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

    Great introduction, thanks (music redundant)
    I would like to see an example how to obtain the flight number from user rather then hard coding it.

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

    Super video

  • @emanuelevalenti5531
    @emanuelevalenti5531 19 дней назад

    Great! could you post a link for the entire project in streamlit?

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

    Great video, exactly the kind of instructions I was looking for
    could I have your ipynb?

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

      Yep - have put the link in the description :)

  • @convertokc
    @convertokc 5 месяцев назад +1

    This helps so much when we are trying to build a similar one using XML product feed upload and then function calling. Do you have any suggestion on how to speed up the response from Assistant API? It takes at least 40 to 60 seconds to retrieve information and it's quite difficult to put it into commercial use

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

      So happy the guide helped! Unfortunately I can’t help much with speed on OpenAI’s side - best of luck though!

    • @convertokc
      @convertokc 4 месяца назад +1

      @@MakeStuffWithAI we changed our approach with the search using xml uploaded. We use relevance ai and create a 'tool' (i.e. a combination of small agents) that extract keywords from the production description. then instead of asking the agent to search from the xml, we made the agent to break down the search intent into keywords with the use of the function calling, then use those keywords extracted to carry out a search our database (with the keywords mapped to each product) and then return the results. A much nicer user experience which eliminates the wait time a LOT

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

    What is the UI framework are you using for the demo? Gradio?
    Nice tutorial

  • @user-pc1dx9td3d
    @user-pc1dx9td3d 3 месяца назад +1

    how can i call function just like you?
    In common, we add message in thread, but this video send instruction to run.
    help me. and your notebook link is not collect (other file)

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

    Thank you for the video. The notebook you had shared is openai_assistant_retrieval.ipynb. Are you able to share the notebook openai_assistant_functions.ipynb you used in the video? Thank you

  • @Techonsapevole
    @Techonsapevole 3 месяца назад +1

    Nice, can you do it with Ollama?

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

      Yep, I'll put together a video about it!

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

    I am newbie in coding so already sry for the dumb question but...
    where is this function deployed? Its running on your computer?
    For my understanding the information that we provide to the assistant is only what input are needed but the exact logic is not stored under "functions"?
    What if I dont want to run the logic on my computer? Do I have to deploy the function somewhere and put an API call as function for the assistant?

  • @user-pq6tt5pi8y
    @user-pq6tt5pi8y 16 дней назад

    then why we use agent ?
    use openai function calling + prompt eng. get more control

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

    Is there a way to add the flight API code (or any API) using only the Assistant Playground rather than VS3?

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

      I had a bit of a dig into this - it looks like some people have been experimenting with this on the OpenAI forums, and it looks like someone has found a way of doing it via Retrieval. Haven't tested it, but might be worth a try! community.openai.com/t/functions-in-the-assistant-api-playground/479721/8

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

    Can you please show how to set an assistant that fetches information from websites and gives you the answers?

  • @viniciusalmeida1102
    @viniciusalmeida1102 2 месяца назад +1

    Your link to the github repo is pointing to another project

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

    i am creating that chat bot but i got to know that even in threads model didn't remember the previous chat for example i wrote a prompt "change weight in previous prompt and keep rest details same". will that prompt work?

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

      I think as long as you're working in the same thread (and your context/conversation isn't too long), the assistant will reference that thread in the response. Hope that helps!

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

    The bot answers the question based on the data that was uploaded via the aviationstack API. How can I make the bot itself upload the necessary data? So that it doesn't need to enter the flight number in the aviationstack API.

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

      Hey - so two approaches here, one could be to fetch data from your own database (so instead of using AviationStack, you’d query your own database), or you could potentially use RAG (or Retrieval) to fetch context from provided documents, if the information is static. I have another video on OpenAI Assistants Retrieval which might help here.
      Best of luck!

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

    At the step with
    assistant = client.beta.assistants.retrieve(
    assistant_id=assistant_id
    )
    assistant
    I have the error:
    timeout: Override the client-level default timeout for this request, in seconds
    """
    extra_headers = {"OpenAI-Beta": "assistants=v1", **(extra_headers or {})}
    --> return self._get(
    f"/assistants/{assistant_id}",
    options=make_request_options(
    extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
    ),
    cast_to=Assistant,
    )
    I don't know what to do(

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

      Issue resolved

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

    Which Api are you using can you share it?

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

      I used aviationstack.com/ for the flight API :)

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

    The part I don't understand yet is, with the Python code where do you host it so the Assistant can call it. Then in the OpenAI assistants dashboard under functions say you have function Name: Get_weather and you hit test button. How does the Assistant know where the code is in relation to Get_weather? There is no endpoint etc set up? Im so confused on this part. Someone please help! haha

    • @pablovillarroel6582
      @pablovillarroel6582 4 месяца назад +1

      Hey! Kind of a late response but still.
      The model doesn't really call the function, so it does not need to know where the Python function is. All the model does (in a general sense) is taking the question/message from the user, taking a bunch of **descriptions** of some functions (and their parameters), and returning the name of the function to call. Basically the model only **tells** you what function you should call (and what parameters you should call it with) based on the descriptions you provided.
      After you get that response from the model, is up to you to call the function the model suggested (as stated in minute 8:30). And after doing this, you can optionally pass the values returned by these functions back to the model, so the model can come up with a more "human sounding" response (which is what's happening at minute 10:42).
      Hope that helps!

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

      Great reply, thanks for covering this for me!

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

      @@MakeStuffWithAI happy to help!

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

    Where is the full code?

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

    tutorial not for beginners

  • @lalamax3d
    @lalamax3d 6 месяцев назад +3

    thanks, why not create a simple react front end (which you showed) ... call api , get result, show in frontend as complete project.

    • @MakeStuffWithAI
      @MakeStuffWithAI  6 месяцев назад +2

      Thanks for the idea! I'll get to work on it :)