Connecting OpenAI GPT-4 with Google Sheets (Google Apps Script)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

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

  • @vincenttetu757
    @vincenttetu757 ปีที่แล้ว +10

    Sorry it doesn't works : TypeError: Cannot read properties of undefined (reading '0')

    • @rveronez
      @rveronez 10 หลายเดือนก่อน +3

      The problem stops as soon as you buy some credits from OpenAI

  • @antonisaskianakis8367
    @antonisaskianakis8367 ปีที่แล้ว +4

    Error
    TypeError: Cannot read properties of undefined (reading '0')
    GPT @ Code.gs:32

    • @John-jt3dn
      @John-jt3dn 10 หลายเดือนก่อน

      I think this is related to BASEURL.. Did you solve it?

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

      @@John-jt3dn Same, did you find a solution?

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

      The problem stops as soon as you buy some credits from OpenAI

    • @zachtatum457
      @zachtatum457 9 หลายเดือนก่อน +1

      I added credits but I still haven’t figured out how to get past that code.

  • @aaafffsss18
    @aaafffsss18 9 หลายเดือนก่อน +1

    This was very easy to follow and very helpful. Thanks!!

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

      no, this method is much more difficult than when you use a module and copy and paste your 10-digit key

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

    how can I integrate customised assistants of openai with google sheets?

  • @caitlinhathaway
    @caitlinhathaway 11 หลายเดือนก่อน +3

    Thank you so much, this has been so unbelievably helpful and easy to get started!

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

      Thanks for watching :) good luck 👍

  • @ProttoyDipto
    @ProttoyDipto ปีที่แล้ว +2

    I keep getting this error
    TypeError: Cannot read properties of undefined (reading '0')
    GPT @ Code.gs:32

    • @Hitchon
      @Hitchon  ปีที่แล้ว

      Seems like you are getting some error with the array not having a 0 element. I suggest trying maybe to console.log(response) and see if you get valid output.

    • @antonisaskianakis8367
      @antonisaskianakis8367 ปีที่แล้ว

      not a coder here - can you suggest how to edit the text I have the same issue @@Hitchon

    • @Hitchon
      @Hitchon  ปีที่แล้ว

      @@antonisaskianakis8367 Hey both! I’m not too sure myself yet on the fix here. I was wondering are you guys getting this with all prompts even if it is short? Or just certain longer prompts?

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

      I encounter exactly the same problem - with longer or shorter promts. Is there any way out?

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

      Same, did you find a solution?

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

    Getting this error message, anyone know why?
    "TypeError: Cannot read properties of undefined (reading '0')"
    Help is appreciated thanks.

  • @adamfachler
    @adamfachler ปีที่แล้ว +2

    Even with very short GPT prompts, I can't get it to read multiple rows. On Google Sheets, I'm calling upon 65 rows of exercises to build a workout:
    =GPT("Build a workout from these movements."&(B1:B65))
    Any ideas? It just returns data from the first cell. Thanks so much!

    • @Hitchon
      @Hitchon  ปีที่แล้ว +1

      Hi Adam, I never really designed this to work with multiple rows but I have a suggestion that may be a good workaround. Try this
      =GPT(“Build a workout from these movements. ” & TEXTJOIN(“ “, TRUE, B1:B65))

    • @adamfachler
      @adamfachler ปีที่แล้ว

      This was very helpful!@@Hitchon

  • @MdAlAmin-xj1km
    @MdAlAmin-xj1km 10 หลายเดือนก่อน +1

    how to avoid time exucuting error? I want to write bulk content

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

      If the content is very large you may need to look at other options combined with google sheets. One suggestion is maybe make.com I have had trouble as well in the past with this and used make.com and then passed the output into google sheets

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

    This method is much more complicated than the other method which consists of copying and pasting the key into a module, are there any differences in using this method?

  • @VitaliiVarbanets
    @VitaliiVarbanets ปีที่แล้ว +3

    An't believe it has only 1.2k views. Great job

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

    this has been super helpful !
    now I can nerd out on using gpt, store data an google sheets using ai and automation

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

    Error
    TypeError: Cannot read properties of undefined (reading '0')
    console.log(response.choices[0].message.content);

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

      If you are debugging, then remove the 'Input' parameter from function 'function GPT() {'
      then, add first line var Input = "YOUR PROMPT HERE"

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

      The problem stops as soon as you buy some credits from OpenAI

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

    This is very helpful for working inside the google sheets, I have question about app script, so i'm tring to receive data from a platfrom to google sheets, The platfrom requires crc_token and 200 respnse. After using chatGPT to write the code and deploying the project as a web app then pasting the URL to the platfrom (Receipt link) it didn't work, Is is posibble to use app script for webhooks or no?

  • @good_vibes_20
    @good_vibes_20 9 หลายเดือนก่อน +1

    def worked, error code appears in debugging go back to his video he shows you how to add a variable to test it, remove the variable hit hte little save button and it should work through your API, make sure your api is loaded for a few minutes, mine kind of glitched out for 30 minutes or, took me a little while to get it to work but it's def possible

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

    Thank you for your brief tutorial. I have a question, how to handle secret api key outside the script like an env file. And if i want to make this script can be use by other people but they need to input their own API key, what choice should i choose in the deployment setting. Thanks again.

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

    Bonjour j'ai vu une vidéo où c'est beaucoup plus simple car c'est une simple clés gpt à 10 chiffres à copier-coller, est-ce que tu peux m'expliquer pourquoi cette méthode est différente ?

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

    I just use the Google Apps Script GPTs to create any script. Great tutorial, though. Will definitely help getting better results faster now that I understand a few basics.

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

    first, i need to add GPT for sheet extension, right?

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

      Hey no need to add that.

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

      ​@@Hitchon It's my misunderstanding. Sometimes I turn on GPT for the sheet extension, and it uses that instead of my API.

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

    Awesome script! Works beautifully. One issue I run into is that it runs again each time the sheet loads, replacing an existing response with a new one and unnecessarily using api tokens. For my use case, I need the text generated only once and then saved as static text to a cell where it will not be overwritten. Any ideas on modifying the script for this use case?

  • @pietrorusso9074
    @pietrorusso9074 9 วันที่ผ่านมา

    Error unknown function

  • @miguelcanonunez611
    @miguelcanonunez611 ปีที่แล้ว

    I've copy the script. The formula it isn't visible in drive when i enter +GPT or =GPT. Why is this happen¿?

    • @Hitchon
      @Hitchon  ปีที่แล้ว

      Hi there I can’t say for sure what your issue is but a few possibilities
      did you save everything, and enter api key , also is the function name GPT and not something else?

    • @rexgyasi7746
      @rexgyasi7746 ปีที่แล้ว

      Yh the get the same, when i run it in App script it self it seems to work. but not in sheets

    • @rexgyasi7746
      @rexgyasi7746 ปีที่แล้ว

      so it seems to be related to permission issue although i had already gave it permission, to resolve this i recreated the spreadsheet as new and recreated the function in the new sheet run in app script to prompt me the permission again > allowed. then refresh the spread sheet, the formula started to work although it wasn't visible. 🤷🏾‍♂

    • @Hitchon
      @Hitchon  ปีที่แล้ว +1

      @@rexgyasi7746 hey that makes sense that it was a permission issue the first time an app script is run a permission window will pop up. Thanks for finding this and posting your solution. Glad you were able to get it to work 👍👍

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

    Hello, thank you for the video. The code is functioning well for me!
    Is there any possibility to integrate the OpenAI Assistant API instead of the default language models? I have a considerable amount of data already uploaded into the Assistant, and I want Google Sheets to access it for reference.

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

    Very helpful video, thank you! Did you create your Google Slide builder yet? Would be keen to know how to make this work for Slides!

  • @Videodecumple
    @Videodecumple ปีที่แล้ว

    I would like to use my own fine_tuned_model. Can I just put my "ft:gpt-3.5-turbo-0613:........ " information as "model" : ?

    • @Hitchon
      @Hitchon  ปีที่แล้ว

      You should be able to add fine tune models. Admittedly I haven’t had a chance to really dive into fine tuned models and test them in appscript but something I will be trying out in future videos

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

    Hey Bro. Can open source llm be used instead of open ai?

  • @d-codify
    @d-codify 10 หลายเดือนก่อน

    Very cool, thanks. Hey is it possible to make it so that gpt accesses the web and returns responses to Google sheet?

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

      Yes that should be possible do you have a specific use case here. If so I can look into making a tutorial on this

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

    Bro best video no bs straight to point bravo you save me

  • @danielwallace5799
    @danielwallace5799 ปีที่แล้ว

    nice!! any idea how to get around the completion rate limiting? keep getting errors when I do stuff in bulk

    • @Hitchon
      @Hitchon  ปีที่แล้ว

      Hey! I can look into this for a future video. My guess would be to make a more efficient formula so perhaps making an array formula. I was curious to hear more what your use case was and approximately the amount of rows you are dealing with?

    • @danielwallace5799
      @danielwallace5799 ปีที่แล้ว

      10k rows in google sheets, doing a bulk title tag optimization for all my blog posts. your script doesn't seem to be jamming up actually though, it was all the other options I tried@@Hitchon

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

    This video was amazing, great work man.

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

    does it work with google document

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

      Yes google app script works nicely with google docs and google slides as well. I have even used this to write bullets for slides

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

    How can I ask to analyze multiple cells? for example a table with data?

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

      Using chat GPT I found a workaround to select multiple cells at the same time to analyze a table with data. You can use the function TEXTJOIN in the google sheet formula.
      EXAMPLE:
      =GPT("what's the date with less session?" &TEXTJOIN("; "; TRUE;A2:B27))

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

    Really helpful video. Thank you.

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

    This worked great! Thank you!

  • @st.3m906
    @st.3m906 9 หลายเดือนก่อน

    You're amazing!!!

    • @Hitchon
      @Hitchon  9 หลายเดือนก่อน +1

      Thank you for the support. U are amazing too

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

    I owe you a beer!!!! Thank you very much

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

      Haha thanks Jamie glad it was helpful:)

  • @CamilleChang-df5mi
    @CamilleChang-df5mi 8 หลายเดือนก่อน

    it worked ! thanks

  • @elkingold
    @elkingold ปีที่แล้ว

    Awesome! I'll send you a mocha coffee. thanks

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

    Thanks a million. Wow~

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

    Thank you!

  • @0koreanssam0
    @0koreanssam0 ปีที่แล้ว +1

    Thank you sir

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

    Wow. Just wow.

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

    some wierd shit with limits. Paid $5 but still free tier with 3 requests per minute

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

      but thank you for a good method

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

      problem was fixed by support, it was a bug

  • @MitchHarris-r6z
    @MitchHarris-r6z 10 หลายเดือนก่อน

    Getting this error - TypeError: Cannot read properties of undefined (reading '0') (line 32).

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

      The problem stops as soon as you buy some credits from OpenAI

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

    Thank you!