Sure, my pleasure! Let me know how it goes!
Wow, cool. Checking it out right now.
Thanks, hope you like it, let me know if you have ideas on improving it…
FYI, I created a new version for this as well with Embeddings API.
Hi @nelson. Thanks for sharing this!
Is there a way where ChatGPT could answer prompt questions with responses from real-time data coming from my API? For example: if my API feeds real-time stock information could this be incorporated into the chatGPT interface?
You cant do this with ChatGPT right now because there is no API for it.
You could however, do something with GPT3 and a chat prompt. Even though it can’t get data from a specific end point, you could potentially train it up to answer questions and use placeholders in your training.
Eg the current stock price on the for Russell 2000 on the NYSE is ##price##
Then whenever you see ##price## in a response, you could swap it out with the data you get from making your own call to another service that provides stock prices
The real trick here is to figure out what the placeholder(s) should be to get it to appear inline on a reliable basis.
Eg. The ## may be intercepted by codex and it may start to think you are trying to write a program instead of asking a completion.
You may also be able to use a different placeholder for the trading stock name (Russell 2000)
You may even be able to do this using a few-shot prompt instead of training
Anyway, just some ideas to try (Nothing tested by me)
Thanks for the explanation @raymonddavey. Probably I could reach the simple QA task with slot/placeholder filling however this is much cheaper with the some open-source QA model.
I will try a few-shot prompt this week and let you know how this turns out.
That is a very interesting use case. As @raymonddavey has mentioned, there is no official ChatGPT API now but the new text-davinci-003 model is pretty close.
I think there are many ways you can approach this problem.
- You can get someone to integrate the API feeds with the GPT API for you, and with programing you can customize it however you like.
- The other approach is the use the spreadsheet above and pull the stock information into the google spreadsheet in near realtime. That involves a little programming too, but there are probably plugins that can help you do that.
For example feed such as MarketWatch.com - Real-time Headlines
can go into this sheet…
You can do use the Search to to find data and feed it into GPT Prompt like this…
The idea of using GPT to analyze stock trend for you on a spreadsheet is pretty cool.
Hope you make a lot of money!
That was super fast. Thanks also for open-sourcing the google sheet.
Will try using your second approach to verify text-davinci-003 QA task before diving into unnecessary coding.
You are welcome, good luck.
Feel free to reach out if you hit a roadblock.
Thanks a lot @nelson
I’ve been working on a sheet similar to yours. It does work and generate the GPT3 response. My problem is that the formulas re-execute/prompt a response whenever I reopen the sheet. So, consuming additional tokens.
I checked your script, but I’m not sure if it prevents this issue. If so, how?
Thanks for sharing that, from what I can tell, it will only trigger the API call when the cell id modified. Let me check if there are other actions that can cause re-executing the prompt. Will keep you posted.
Thanks for the prompt reply.
The issue is with my own script. I was wondering if you were experiencing a similar problem. I haven’t tried your script yet. If there is no problem, I can start using yours with some modifications.
Maybe I can help you take a look at it? Do you mind sending over that to me?
@nelson I have a solution to preserve outputs and prevent unnecessary burning of tokens. Would love to connect to share with you here. Also have a question for you about how you were able to leverage embeddings into google sheets. Thanks!
Hi all, just want to make a friendly reminder.
Some users have been getting issues on editing the Google Spreadsheet. Just wanted to say that by default the Google Spreadsheet is read-only, but you are more than welcome to make a copy of the google spreadsheet to your own drive and make any changes necessary.
Would be very grateful if you could share the solution to prevent unnecessary burning of tokens here!
@songsofthespheres Are you using the newer version I posted here?
This one should not have any issues on burning tokens.
Also if you want to make sure, I added a new function call getCompletionsWithTimestamp
You can use this to test when was the last time the API executed.
Thanks Nelson. As far as I can tell, this now seems to be working for me!
I’ve noticed that the Search function only returns the entire text of the cell with the highest cosine similarity. Is there any way to make it so that the Search returns information from more than one cell (and not irrelevant information)?
I’m not much of a programmer so it is all a bit new to me. ChatGPT tells me I might consider using Named Entity Recognition based on spaCy, but wondering if you have any obvious workarounds.
What I am ultimately hoping to achieve is to fill the Sheets with my worldbuilding information then feed in relevant information into new prompts dynamically. Also, to have a summary cell for each category (e.g. a place) that I occasionally update using the Search function.
I’m glad that you find it useful. As you mentioned, the search function was designed to only give you the result with the highest score. May I ask why the result with the highest score is giving you irrelevant information? I think we need to look into why that is happening, otherwise give you more results back might not help.