#GPT Will View Websites and Run Code for You!

134 messages Β· Page 1 of 1 (latest)

candid river
candid river
#

Your personal AI Assistant! | GPT-3xecute | give tasks, get resulrs

#

Your personal AI Assistant! | GPT-3xecute | give tasks, get results

soft widget
#

So it can connect to the internet?

candid river
#

It can run any python code using your machine

#

so it can connect to the internet

urban spear
#

hello

#

i want to ask about this

#

how to fixed?

candid river
#

Check the GitHub readme. You need to provide two API keys. One is the telegram API key for the telegram bot and one is the openAI API key

#

@urban spear

boreal elk
#

i have some erros, i hope u can help me

#

def handle_user_commands(updates: list[Update], history: ChatHistory) -> list[Update]:
^
SyntaxError: invalid syntax

candid river
#

I just updated the repo! The changes should not impact functionality at all though

#

Wrote up a blog post on this as well! https://www.thornewolf.com/let/

boreal elk
# candid river Interesting. did you modify the code at all? it would be surprising that this th...

I haven't made any changes. I cloned the repo, filled in the .env file, and started it with python main.py.
python main.py
Traceback (most recent call last):
File "main.py", line 1, in <module>
from logic import read_and_respond_to_chats_forever
File "/home/mike/Downloads/ai/gpt-3-execution/logic.py", line 18
def handle_user_commands(updates: list[Update], history: ChatHistory) -> list[Update]:
^
SyntaxError: invalid syntax

candid river
#

Python 3.6 was released in 2016, so if that is the case I do recommend you upgrade.

candid river
#

Telegram + GPT! It runs code and looks at the internet!

candid river
#

GPT Will View Websites and Run Code for You!

rose beacon
#

if it also work on vs code

candid river
spiral totem
#

@candid river this is really neat. How does it interface to ChatGPT?

candid river
spiral totem
#

ok that makes sense. thanks. this is probably off topic but was 3.5 trained on a different data set than 3? the 3.5 model itself says it was trained on up to 2021 i think. or was 3.5 just fine-tuned 3?

candid river
# spiral totem ok that makes sense. thanks. this is probably off topic but was 3.5 trained on a...

See https://medium.datadriveninvestor.com/openai-quietly-released-gpt-3-5-heres-what-you-can-do-with-it-4dee22aea438 as a random citation "In the meantime, OpenAI has quietly rolled out a series of AI models based on GPT-3.5, an improved version of GPT-3. The first of these models, ChatGPT, was unveiled at the end of November.

ChatGPT is a fine-tuned version of GPT-3.5 that can engage in conversations about a variety of topics, such as prose writing, programming, script and dialogues, and explaining scientific concepts to varying degrees of complexity."

So theoretically there is some difference between the models, but it hasn't really been surfaced in my experimentation

Medium

Some ideas to make the most of this mind-blowing tech

spiral totem
#

have you reversed how the throttling works on chatgpt? I was wondering if it is token based so you only get so many tokens before you get the to many requests in the last hour. cool down period message? also wondering how long you have to wait exactly.

candid river
spiral totem
#

oh yeah, i should have mentioned that it was another off topic question. sorry I haven't used discord much so maybe that question about chatgpt would better go in a chatgpt channel.

spiral totem
#

@candid river, I've hit a roadblock while trying to get this working. I keep receiving an error message from the botfather saying "Sorry, this username is invalid." Do you have any suggestions for resolving this issue?

candid river
#

here is a bot name i set up recently

spiral totem
#

According to the instructions, we are supposed to pick a username for our bot that ends in "bot", like "TetrisBot" or "tetris_bot". However, when I attempted to use "gptbot", it was unsuccessful. The instructions appear to be ambiguous. I then attempted to use "gpt" as the name and "gpt_bot" as the username but it also failed, and I got a message stating "Sorry, this username is already taken. Please try something different." Is there a way to view a list of already taken names?

#

Finally managed to find a bot name that wasn't already taken. That took forever! Still couldn't figure out how to see all the names that are already taken. Excited to get this set up!

spiral totem
#

it seems locked up here

/Volumes/git/gpt-3-execution (main)$ python main.py
MASTER:

Hello

Assistant:

spiral totem
#

what is this magic number? offset = 2083323969

candid river
spiral totem
#

success!

candid river
#

That is probably why it hung too

#

nice work on finding and my bad on the error

spiral totem
#

I left the offset in there and found I was missing just going to the telegram UI and starting up a conversation with the bot.

#

guess I'll go set that offset to 0 though

candid river
#

Here is another random usage example

spiral totem
#

this is amazing! really nice work!

candid river
#

Thanks! Feel free to make any improvements you can think of and send me a pull request. Especially if you decide to integrate with another frontend like Whatsapp or discord

limpid cosmos
#

@candid river hey there, I've got a question, so I'm building a poweful ai myself which also should be able to search web, get urls, return the most accurate info from first 3 or 5 urls in either duckduckgo or google.
Recently been fixing other errors so haven't got to that part, does your project cover those aspects?

candid river
pine skiff
#

Love to work on your repo, are you planning to update any feature or currently working on something in this project bro?

limpid cosmos
#

@candid river no worries at all, appreciate it!

candid river
candid river
#

Hey all, just pushed a refactoring update for the repo. You shouldn't see any changes in model performance, but the code should be a lot simpler to extend. For example, this is now what the core read+respond loop implementation looks like:

spiral totem
#

nice update. thanks. On another note: I hit an exception when it retrieves an edited message: result [{'update_id': 881893917, 'edited_message': {'message_id':...

File "/Volumes/git/gpt-3-execution/telegram.py", line 82, in <listcomp>
return [Update(**e) for e in result]
^^^^^^^^^^^
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for Update
message
field required (type=value_error.missing)

#

I think Update class is expecting a 'message' but this one had a 'edited_message' instead

knotty nova
#

Hi

#

Traceback (most recent call last):
File "main.py", line 1, in <module>
from logic import read_and_respond_to_chats_forever
File "/home/Bricon/api/gpt-3-execution/logic.py", line 17, in <module>
from text_interface import Message, TextInterface
File "/home/Bricon/api/gpt-3-execution/text_interface.py", line 17, in <module>
class TextInterface(ABC):
File "/home/Bricon/api/gpt-3-execution/text_interface.py", line 18, in TextInterface
def get_new_messages(self) -> list[Message]:
TypeError: 'type' object is not subscriptable

#

Good afternoon, has anyone got this error?

candid river
# knotty nova Good afternoon, has anyone got this error?

Hi @knotty nova , I am using python typing features introduced in Python3.9. This Python version was released in 2021, whereas the latest version (3.11) was released a few months ago. You can update to any current python version to take advantage of these features.

candid river
knotty nova
#

Starting bot...
Traceback (most recent call last):
File "/soc/api/gpt-3-execution/main.py", line 12, in <module>
main()
File "/soc/api/gpt-3-execution/main.py", line 7, in main
read_and_respond_to_chats_forever(ChatHistory(), TelegramInterface())
File "/soc/api/gpt-3-execution/logic.py", line 137, in read_and_respond_to_chats_forever
messages = chat_interface.get_new_messages()
File "/soc/api/gpt-3-execution/telegram.py", line 115, in get_new_messages
updates = get_updates(offset=self.message_read_offset)
File "/soc/api/gpt-3-execution/telegram.py", line 55, in wrapper
return fn(*args, token=TELEGRAM_API_KEY, **kwargs)
File "/soc/api/gpt-3-execution/telegram.py", line 86, in get_updates
return [Update(**e) for e in result]
File "/soc/api/gpt-3-execution/telegram.py", line 86, in <listcomp>
return [Update(**e) for e in result]
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for Update
message -> text
field required (type=value_error.missing)

#

randomly stopped working, need to do any more configuration?

candid river
#

I suspect that this is related to the bug mentioned by resen earlier. Did you edit any of your messages? I'll prioritize this fix.

knotty nova
#

I didn't make any edits to the question

candid river
# knotty nova Thanks!

I have just pushed an update to the repo that ignores invalid telegram updates. Lmk if this helps fix your error

#

also @spiral totem

knotty nova
#

Thank you my friend! I will validate πŸ˜‰

spiral totem
spiral totem
#

I believe the 'edited_message' issue is resolved. Thanks. Ran into another issue though. Am I using it correctly? The time in NYC should have been 8:14PM.

lone turret
#

gpt will view website

candid river
candid river
# spiral totem

I've just made an update that I believe improves the performance

#

This is my transcript

#

I made some changes to improve the prompt size, but this caused the code to sometimes not give GPT the full transcript, leading to it not being able to answer questions

spiral totem
#

I just pulled your latest changes but I don't have the change that moved the imports into solve.

spiral totem
#

never mind, I just saw the prompt where you added this:

{HUMAN_TITLE}:
Thanks! Always put the import statement inside of the solve function. It is bad practice to put it outside of the function.

I guess the model is just ignoring it lol

boreal elk
#

I have python 3.9 under debian 11 and always get the following error:
gpt-3-execution$ python3.9 main.py
Traceback (most recent call last):
File "/home/mike/Downloads/ai/gpt-3-execution/main.py", line 1, in <module>
from logic import read_and_respond_to_chats_forever
File "/home/mike/Downloads/ai/gpt-3-execution/logic.py", line 89, in <module>
) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

candid river
#

maybe I use too many very current python features. I guess that was added in Python 3.10 or 3.11

inner kettle
#

How to create a website for e-commerce

hollow kernel
#

This could be a great product in my opinion if you finish the various nuances

hollow kernel
#

`PS C:\Users\CLEVO\Desktop\gpt-3-execution-main\examples> & C:/Users/CLEVO/AppData/Local/Programs/Python/Python310/python.exe c:/Users/CLEVO/Desktop/gpt-3-execution-main/main.py
Starting bot...

RECEIVED USER MESSAGE


[Message(text='πŸ˜‚', message_id='791', user_id='793494085', chat_id='793494085'), Message(text='/stop', message_id='792', user_id='793494085', chat_id='793494085')]


Traceback (most recent call last):
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\main.py", line 12, in <module>
main()
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\main.py", line 7, in main
read_and_respond_to_chats_forever(ChatHistory(), TelegramInterface())
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\logic.py", line 151, in read_and_respond_to_chats_forever
handle_user_message(message, history, chat_interface)
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\logic.py", line 30, in handle_user_message
response = get_llm_completion_for_chat(message.chat_id, history)
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\logic.py", line 119, in get_llm_completion_for_chat
response = get_gpt_response(history.get(chat_id))
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\gpt.py", line 54, in get_gpt_response
write_most_recent_prompt_to_file(prompt)
File "c:\Users\CLEVO\Desktop\gpt-3-execution-main\gpt.py", line 45, in write_most_recent_prompt_to_file
f.write(prompt)
File "C:\Users\CLEVO\AppData\Local\Programs\Python\Python310\lib\encodings\cp1251.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f602' in position 3183: character maps to <undefined>
PS C:\Users\CLEVO\Desktop\gpt-3-execution-main\examples> `

How to fix now?

hollow kernel
#

i just send him 😁

karmic panther
#

@candid river can you please see what went wrong, i did everything the way you instructed. maybe i missed something. sorry for bothering you πŸ˜‡

hollow kernel
karmic panther
hollow kernel
#

awesome bot, I really like the way it works

karmic panther
#

hopefully πŸ˜ƒ

candid river
candid river
hollow kernel
#

it's like my virtual friend now)

hollow kernel
#

Should I just download a new archive from githab?

marble gyro
#

Here, Chat GPT is Not working! πŸ˜…

kindred galleon
#

need help

hollow kernel
zealous badge
#

Hi. I am a German psychologist. I want to use the ai chat as a kind of first point of contact in order to be able to give initial, helpful answers to possible questions, fears or problems of your patients. On Chat.open.ai I have already been able to teach the chatbot to be a corresponding psychologist. The replies were all excellent and helpful. Now I would like to take the next step and integrate this tool on my website or Whatapp - but have no idea how. Can you help?

hollow kernel
#

My bot is working again, but for some reason does not save the history of messages as before in a text file

zealous badge
hollow kernel
candid river
candid river
kindred galleon
golden torrent
#

@candid river How did you do, to make a conversation with the api like chatgpt? I have a similar telegram bot but I’m struggling, the bot works perfectly but the API can’t follow the conversation so she forgets the previous answers

zealous badge
# hollow kernel If I understand you correctly you want to connect the bot to watsap, I found the...

It is a bit more complex. I want the AI chat to act like a psychologist. Therefore I made a lot of tests at chat.openai.com (and teached him well to become a good psychologist like me) and really love the results so far. The idea is to turn this chatbot into a private messenger or app for my clients so that they can communicate with it as some kind of first, quick help. But I am not a coder πŸ™‚

candid river
# kindred galleon i need help
  1. Can you try downloading the GitHub repo in a fresh folder.
  2. In this fresh repo, make a .env file with some sample values
  3. Run the code
  4. DM me the screenshots

Note: there is no need to send me anything that contains any of your real API keys

hollow kernel
hollow kernel
#

@candid river Traceback (most recent call last):
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\main.py", line 22, in <module>
main()
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\main.py", line 15, in main
read_and_respond_to_chats_forever(ChatHistory(), TelegramInterface())
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\logic.py", line 147, in read_and_respond_to_chats_forever
handle_user_message(message, history, chat_interface)
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\logic.py", line 35, in handle_user_message
response = get_llm_completion_for_chat(message.chat_id, history)
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\logic.py", line 122, in get_llm_completion_for_chat
response = get_gpt_prefixed_response(history.get(chat_id))
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\gpt.py", line 52, in get_gpt_prefixed_response
write_most_recent_prompt_to_file(prompt)
File "c:\Users\CLEVO\Desktop\1\gpt-3-execution-main\gpt.py", line 47, in write_most_recent_prompt_to_file
f.write(prompt)
File "C:\Users\CLEVO\AppData\Local\Programs\Python\Python310\lib\encodings\cp1251.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f643' in position 3334: character maps to <undefined>
PS C:\Users\CLEVO\Desktop\gpt-3-execution-main\examples>

Agean trouble with smiles

candid river
#

it should skip writing to the file unless you set a flag to do so. This means by default you shouldn't get this error

hollow kernel
hollow kernel
#

openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens, however you requested 4276 tokens (3776 in your prompt; 500 for the completion). Please reduce your prompt; or completion length.

#

and after starting it begins to load supposedly new messages and again the error, roughly speaking - hung up. How to fix it?

hollow kernel
candid river
candid river
#

@autumn rapids

dusky cipher
#

can i have access to the bot that maybe one of you have already created so that i can tested out?

rustic dust
#

How school look like in 2050

#

I need help