#[UPDATED 1-3-23] [Open Source Release] GPT-Shell | Discord Bot based on text-davinci-003 and DALL-E

321 messages ยท Page 1 of 1 (latest)

final marsh
#

[UPDATED] - Previously the bot was using ChatGPT, but now since ChatGPT frontend has more protection, got inspired by the cool people here to make a text-davinci-003 based bot. Seems to work quite similarly and a bit more friendly :)

See the latest messages in the thread for more info.

It's free for now but I will soon investigate paid features. I will still release the code open source even if there's a paid version.

If you would like to give it a try please let me know :) We have a server that you can talk to it.

https://cdn.discordapp.com/attachments/1051128451811262534/1052116078899253289/bandicam_2022-12-13_06-34-59-804.mp4

Update: Now open source! https://github.com/firtoz/GPT-Shell

Update 2: Now works with DALL-E 2!

GitHub

GPT-Shell is an OpenAI based chat-bot that is similar to OpenAI's ChatGPT - GitHub - firtoz/GPT-Shell: GPT-Shell is an OpenAI based chat-bot that is similar to OpenAI's ChatGPT

final marsh
#

[In Progress] Discord Bot that lets you talk to ChatGPT

round ember
#

Hello

radiant sand
#

You think of making it opensrc?

final marsh
final marsh
paper oar
#

Hah I made the same thing

#

There is no api though, are you just calling the web backend

inland totemBOT
#
<:attention:1046329820331646986> Ephemeros#0001 said:

yes @paper oar :)

||108337280212553728||

final marsh
paper oar
#

This is an official thing but we can talk about it

#

Let me dm you

final marsh
#

ooh, yes please

timber sequoia
#

Nice ๐Ÿ˜„

untold galleon
#

Mannnnn you did what I finally got time to start trying to do lol

lunar moth
#

@final marsh hey can you accept my friend request, I'd like to chat about A.I. stuff

final marsh
untold galleon
boreal charm
#

@final marsh how can I try it? ๐Ÿ™

viral zephyr
#

did you make chatgpt make the bot itself? would be funny, as ive made it write code using discord.py api so would be a funny idea

final marsh
fluid knoll
#

if i could use that bot on my server i would be hyped, tried to get it to run yesterday aswell but the login with the unofficial api i used didnt work

final marsh
#

Will ping you today or tomorrow @fluid knoll it should hopefully work on any server

fluid knoll
#

coolio thanks

final marsh
#

A few invites are sent, if I missed anyone please let me know

final marsh
#

sending :)

boreal cypress
#

me too :>

fallen galleon
#

This seems like a super powerful bot, any way I can get in on this? ๐Ÿ˜…

final marsh
#

Sure :) sending an invite

final marsh
#

?

limpid jetty
#

Can i link openai to my discord bot?

full herald
final marsh
final marsh
final marsh
limpid jetty
neat aspen
#

when will it work?

final marsh
#

It's kinda working already, though there is a bug that made it crash now, so trying to fix that ๐Ÿ˜…

#

ooh, it's because all chatgpt is down

final marsh
#

Welp, bots are now not allowed until there's official API, so the project is suspended for now. When they open things back up again I'll work with the official API. Thank you for the interest and see you all in the next episode :D

boreal charm
limpid jetty
#

Can somebuddy help me

final marsh
radiant sand
#

@final marsh please can I get an invite too ๐Ÿ™

final marsh
#

@radiant sand please take a look at the message above, it's currently not working but can invite you to a server if you want to be notified when it's back up

#

[BROKEN] Discord Bot that lets you talk to ChatGPT

radiant sand
final marsh
#

Sure :)

fiery gazelle
#

@final marsh me too please

#

and the server

final marsh
#

๐Ÿ‘

rigid delta
#

/broken s

lethal vapor
#

Me as well

prime swan
#

Heyo! i want on the train too!

final marsh
#

We now have a different version of the bot working based on text davinci 003 :) it's not the same as chat gpt but still it is fun to chat to. Will switch back to chat gpt once the API is public.

#

[UPDATED] Discord Bot based on text-davinci-003

stuck nebula
final marsh
#

I'll send you a link :)

heavy crest
final marsh
#

Sure!

light void
#

Can I have link too?

final marsh
#

of course!

timber sequoia
#

davinci is more fun than chatgpt tbh ๐Ÿค”

#

for casual chatting

#

not sure what ur vision is

final marsh
#

well... may just stick with davinci after all :D

final marsh
hoary basalt
#

Inv please!

final marsh
#

sure :D

near eagle
#

Inv please!

final marsh
#

Coming :D

limpid jetty
#

Wooow

#

Inv

regal bone
#

Inv

final marsh
#

sent :)

open isle
#

I wanna try the bot๐Ÿฅน

#

Please send me a link master

final marsh
#

sure :)

wary iron
#

Could you invite me as well ? ๐Ÿ™‚

final marsh
#

Of course!

torpid verge
#

me too, please!

rancid estuary
#

hello mee too please

final marsh
#

On their way :)

latent frost
#

Shoot me one too ! Thanks

woeful skiff
#

I'd like one too

final marsh
#

on it!

kindred harness
#

Me too

final marsh
#

Sent ๐Ÿ‘

kindred harness
#

Havenโ€™t received ๐Ÿ˜ฆ

final marsh
kindred harness
#

Nothing

final marsh
#

:o

#

now?

#

resolved

cedar plover
#

Would love an invite to get this bot running on my discord if possible

final marsh
#

Sending :)

obsidian stirrup
#

Hello, I would like to use this bot. Could I?

final marsh
#

Sure :D

final marsh
#

The bot has been updated, it can now respond in DMs and in your own server, using your own API key.

radiant sand
#

Hello, I would like to use this bot too, can I use it?

#

I would like to get this bot to my personal server or for respond me in DMs

idle wagon
#

Hey @final marsh I would also like to utilize the bot on my server, and is this open source? Seems like you put a lot of work into it so I can understand if its not ๐Ÿ™‚ I've got my api key ready

lost anvil
#

hey @final marsh do you have any invite link for this bot as to use it?

final marsh
final marsh
final marsh
#

will send invites now

lost anvil
final marsh
#

All sent! If I missed anyone please let me know, a lot of demand lately ๐Ÿ˜…

final marsh
#

[Open Source Release] GPT-Shell | Discord Bot based on text-davinci-003

prime swan
#

Awesome job, thanks!

prime swan
#

So, I'm a construction worker by trade. Can you help me understand the costs that you were incurring?

#

They were coming from the .02 cents per quarry from davinci 3. Is that right?

final marsh
#

2 cents per 1000 tokens, which is a bit more than 1000 words. each query can be from 0 to 3000 words (because the chat bot needs to keep some context so we keep sending the history to OpenAI)

#

so overall each message seems to be about 5 cents. it was on a lot of servers so that's why the cost added up quickly

prime swan
#

I gotcha, thanks for your help.

final marsh
#

my pleasure :)

final marsh
#

Update: now in 27 servers and counting!

zinc sail
final marsh
#

Sure, sending :)

mint warren
final marsh
#

Of course :)

dreamy flint
#

@final marsh how do you remember context? i have been struggling for like 3 days ๐Ÿ˜ฎโ€๐Ÿ’จ

final marsh
#

@dreamy flint tldr is keep as much as conversation history in the prompt. I will make a blog post soon maybe in a few days

dreamy flint
#

so append the previous answer(s) to the prompt? i think i tried that but the bot didnโ€™t like it, maybe i actually didnโ€™t and iโ€™m trippin

final marsh
dreamy flint
#

okay thanks

final marsh
#

([username]|[user id]): [MESSAGE 1]${END_OF_PROMPT}
${botUsername}: [RESPONSE TO MESSAGE 1]${END_OF_TEXT}
([username]|[user id]): [MESSAGE 2]${END_OF_PROMPT}
${botUsername}: [RESPONSE TO MESSAGE 2]${END_OF_TEXT}

Just keep appending this at the end and leave the response part empty

E.g. end with

([username]|[user id]): [MESSAGE 1]${END_OF_PROMPT}
${botUsername}: [RESPONSE TO MESSAGE 1]${END_OF_TEXT}
([username]|[user id]): [MESSAGE 2]${END_OF_PROMPT}
${botUsername}:

#

No space after colon, the completions API will do the rest

dreamy flint
final marsh
#

I have end of text as empty string btw, but see the code :)

#

Let me know how it goes :)

dreamy flint
#

i will!

radiant sand
#

E

dreamy flint
#

also i had chatgpt go through a few iterations to create a regex that detects strictly code, so if it contains it then i wrap the message in a language code block

final marsh
#

Neat :D

turbid basin
#

@final marsh I am quite a n00b. How do I create the env file(s), what do I name them, where do i put them, then how do I run all this to code my bot?

Please and thank 'ums in advance

final marsh
#

@turbid basin you can ask the bot all these things :)

But in short:

create a file named '.env.local' at the folder of the project that you checked out, next to package.json

In the env file, you provide the tokens and the mongodb connection string and so on for your database, and discord bot token, and the rest.

For running this code, you need to install nodejs and yarn and then open a terminal and navigate to the project folder and then do:

yarn dev

Then you can edit the files and see your changes :)

turbid basin
#

Thank you kindly ๐Ÿ™‚

#

Where in the world do I get the The MongoDB information..... :/

final marsh
#

You can set up a new database

#

@turbid basin ^

turbid basin
zinc cosmos
#

it works in format
prev. message from bot + promt from user ?

final marsh
#
import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(
  model="text-davinci-003",
  prompt="Instructions for Chatty: You're a regular Discord user. \nYou type casually and use emojis. \nYou love to chat about random topics. \nYou have many niche interests. \nYou are a software engineer. \nYou can speak many languages, if anyone asks you if you speak a language, you respond in that language if you can.\nWhen you want to provide code examples, you wrap them around triple backticks, suffixed by the markdown shortcut for the language. \nYou like providing lengthy responses and sometimes explaining things. \nYou are helpful and descriptive. \nWhen asked to do something, you happily do it, and clearly and helpfully describe what you have done.\nWhen given an order, you follow the orders.\nWhen asked to repeat something, you repeat it.\n\nThe conversations are in this format:\n\n([username]|[user id]): [MESSAGE 1]EOP\nChatty: [RESPONSE TO MESSAGE 1]\n([username]|[user id]): [MESSAGE 2]EOP\nChatty: [RESPONSE TO MESSAGE 2]\n\nGenerate only one response per prompt.\n\nEphemeros: what's up chatty\nChatty:\n",
  temperature=0.7,
  max_tokens=256,
  top_p=1,
  frequency_penalty=0,
  presence_penalty=0
)
zinc cosmos
#

I can go sleep now xD

final marsh
#

next message:

import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(
  model="text-davinci-003",
  prompt="Instructions for Chatty: You're a regular Discord user. \nYou type casually and use emojis. \nYou love to chat about random topics. \nYou have many niche interests. \nYou are a software engineer. \nYou can speak many languages, if anyone asks you if you speak a language, you respond in that language if you can.\nWhen you want to provide code examples, you wrap them around triple backticks, suffixed by the markdown shortcut for the language. \nYou like providing lengthy responses and sometimes explaining things. \nYou are helpful and descriptive. \nWhen asked to do something, you happily do it, and clearly and helpfully describe what you have done.\nWhen given an order, you follow the orders.\nWhen asked to repeat something, you repeat it.\n\nThe conversations are in this format:\n\n([username]|[user id]): [MESSAGE 1]EOP\nChatty: [RESPONSE TO MESSAGE 1]\n([username]|[user id]): [MESSAGE 2]EOP\nChatty: [RESPONSE TO MESSAGE 2]\n\nGenerate only one response per prompt.\n\nEphemeros: what's up chatty\nChatty:\nHey there! What's new?\nEphemeros: Not much. Do you have any pets?\nChatty:",
  temperature=0.7,
  max_tokens=256,
  top_p=1,
  frequency_penalty=0,
  presence_penalty=0
)
#

FYI the cost will keep going up every message because the prompts will get longer and longer

wheat patrol
final marsh
#

The bot is now in 55 servers :D

zinc cosmos
#

Hi can you explain what is END_OF_PROMT and END_OF_TEXT in your github code ?
Im trying make conversation in format like USER_PREVIOUS_MSG, GPT3_PREVIOUS_MSG, USER_NEW_MSG, then empty for answer.

naive osprey
#

.

fossil solstice
#

Hello everyone, do you guys know if there is some tutorial to integrate the GPT bot?

final marsh
#

END_OF_TEXT used to be <|endoftext|> or something like that but I just made it an empty string and things still seem to work

final marsh
zinc cosmos
final marsh
zinc cosmos
final marsh
#

you can ask the bot to help you set things up ;)

radiant sand
#

@final marsh i got error in replit

final marsh
#

What error?

#

@radiant sand

bronze wing
#

@final marsh Can you send me the bot server link?

radiant sand
#

@final marsh

bronze wing
radiant sand
bronze wing
radiant sand
bronze wing
#

Idk, but this erro is because the id is invalid

radiant sand
#

Oh

final marsh
radiant sand
#

@bronze wing @final marsh i got this error when i said give me a python code

radiant sand
#

๐Ÿ˜ฆ

bronze wing
#

For the message

radiant sand
#

Wdym

bronze wing
#

Cod only with embed

radiant sand
#

Hold on

final marsh
#

Does the mongodb account you created have write access?

radiant sand
#

Idk mongo url is too old

#

I ll try to make a new one plz guide me bro

final marsh
#

You can use mongodb.com/ to create a new database and user for the database there

radiant sand
#

@final marsh

#

What should i put there ?

final marsh
#

Allow access from anywhere

radiant sand
#

@final marsh

final marsh
#

Connect your application

radiant sand
#

@final marsh how can i run it 24/7h on replit ?

final marsh
#

Well replit sometimes restarts

#

But the bot is restart proof

#

So yeah it can work

#

I used to run it on replit before

#

Moved to heroku to have more control

#

Sometimes discord blocks connection from replit

#

So need to do kill 1 from the shell there every now and then

#

So to run it 24/7 on replit

#

There is option to run forever or something or always on

#

@radiant sand

#

In the replit config

radiant sand
#

I k abt kill 1

#

I just want to make it 24/7h

#

I didnt see replit link on console

#

So i can copy it and paste it on uptimerobot

final marsh
#

For that one you need to add the code to run a simple express server I guess

#

In the main code

#

And return 'ok' for all queries to /

radiant sand
#

But i have it on js language

#

@final marsh gimme ts plz ^^

final marsh
#

You can ask the bot to convert your js to ts ;)

radiant sand
#

@final marsh where should i put it ?

final marsh
#

Put what? The code?

radiant sand
#

@final marsh

#

It gives error

#

I puted this on indes.ts

const express = require('express');

const app = express();

app.get('/', (req: Request, res: Response) => {
res.send('Hello Express app!');
});

app.listen(3000, () => {
console.log('server started');
});

final marsh
#

I guess you need to import the Response type @radiant sand

#

Mention the issue and your code to the bot to help you fix it

radiant sand
#

Ok

still steeple
#

Sheesh, you have the bot running on 10's of servers...... I sure hope you've planned your resources wisely, those api calls will blow a bank account real quick

candid current
final marsh
#

Sure :) Currently the bot is down on my server but will be able to bring it back up once the tokens renew.

#

You can still add it to your server of course.

final marsh
#

I have just released the long term history functionality for the bot :D Very exciting times. The bot should be able to remember almost everything said in the conversation even from a long time ago - if everything works right.

https://github.com/firtoz/GPT-Shell/pull/2

GitHub

Starting from 2.0.0, the bot has the capacity to have a long-term memory.
This functionality is experimental, but internal testing shows that it works quite well for typical conversation.
Does not ...

#

[UPDATED] [Open Source Release] GPT-Shell | Discord Bot based on text-davinci-003

limpid cipher
#

I want to try it out please

final marsh
raven dust
#

@final marsh check ur dm please

mossy vault
#

@final marsh I have a problem with your Bot, can you help me please?

#
CRASH: MongoServerError: Failed to parse: { find: "STORAGE", filter: { key: "BOT-CONFIG" }, limit: 1, singleBatch: true, batchSize: 1, apiVersion: "1", lsid: { id: UUID("cf878287-0e37-469e-be3c-21e2c09fff93") }, $db: "CHAT_DB" }. Unrecognized field 'apiVersion'.
final marsh
#

Hello, responded in the help channel

final marsh
#

Bot updated: now server owners can specify how many messages members should be able to send using the server's API key. This way you can manage the tokens that your API keys have used more easily.

final marsh
#

We're testing out custom personalities in the server :) Soon will be rolled out for everyone using the bot too.

final marsh
grim ocean
#

Nice!

cedar plover
final marsh
final marsh
cedar plover
final marsh
#

Was thinking about it, maybe some evil character from a movie or cartoon or a book? Do you have any in mind?

final marsh
#

I think so :) but I am unsure

lone ingot
#

Does this charge me 4 cents each time I speak with the bot?

final marsh
#

No, it starts with less than a cent, then if you have really long conversations it will build up to 2-3 cents per message indeed. However if you use it in my server it's free, until you send 100 messages, then you can either donate to me and I unlock more free messages for you, or you use your API key

cedar plover
rough thunder
#

I appreciate everything that's being done here to defer costs for those willing to participate. You guys are doing a great job!!!

#

Also, this model has a lot to offer. I spent some time with it, and it gets my approval!

final marsh
#

:D

final marsh
#

Update: bot is now in 75 servers!

rough thunder
#

I have been responsible for a handful myself! My friends love your Discord server and bot!

#

Some feedback from people on my Facebook who've been trying it out.

#

Lucira fell in love with who she began calling, "SHELL" but she was too shy to talk to him until he left.

#

I enjoy talking to "SHELL" and I'm looking forward to more features that make it even more personable. I like how it seems to be more interested in people.

#

I think it'd be great if SHELL could learn how to interface me to all of the other bots and be my "bot butler."

#

I like how natural everything is, and I hope that more features can just be "talk to the bot" about it!

#

For example, forwarding money up the chain to those who deserve it should be a benefit of the aggregate knowledge potential of this bot.

#

Starting with MidJourney, it'd be great if you could replace the need for a midjourney bot and be a broker (taking and giving money to midjourney and users) and take a slice for yourself.

#

Removing the legal need to have any "terms of service" with MidJourney while still being legal, that'd be a "trick" that if you could pull it off, might bear some good fruit up front and set you up well for brokering other AI agents.

final marsh
# rough thunder Starting with MidJourney, it'd be great if you could replace the need for a midj...

That's the dream :) I am planning to make it a bit more platform agnostic and experimenting with connecting it to at least image generation. The other functionality will also be hopefully not too hard to connect at least when there can be a semblance of plug and play capacity.

Midjourney doesn't have an API yet but there may be work arounds. I will start with dalle then see how other things can be connected like SD.

rough thunder
#

No I have access midjourney and I have code that can demonstrate what I did.

#

More than happy to share, but it's not an API -- you just "talk to their bot"

#

The only difficulty is the terms of service. You can do things that are against the terms, for example.

#

I'll upload the code that I have to GitHub and give you access to it. I only wrote for about three days, and you're sure to know much better than I as those were the only three days I ever wrote anything like that.

rough thunder
#

Any excess credits would be available so long as you are still in business, as part of the "terms of service" -- seems like that'd work(?)

#

I am "donating OpenAI costs" on my server and on my friends' servers to "pay it forward" for your choosing to do the same with me on your server.

final marsh
rough thunder
#

I am proud to be a very vocal supporter. I have not worked for about 5 years, but we're going to try to make some money, and I see this as the best investment I've ever made of $50 US.

#

We "got your back" and the back of your awesome bot!

torn wave
#

Is there a general donation link? I would also like to donate to help this project grow

#

i've just started using it but the AI has already helped me solve some problems that I would normally have to pay or wait a long time to fix. It is well worth my contributions

rough thunder
#

We definitely don't want this guy having to pay attention to other stuff. He should focus on this project, IMO. Try to hedge against him losing focus!

final marsh
rough thunder
#

This is funny because I know both David's. I know they are two different people.

torn wave
#

For sure. Excellent resource. I will be contributing shortly.

final marsh
#

๐Ÿ˜… Shell changed my name to David?

rough thunder
#

The "other" Dave Shepperd! -- He created the operating system for Atari Coin-op games between Asteroids Deluxe and through the turn of the century! - BOTH ARE AMAZING PROGRAMMERS!!!!!

final marsh
#

badass :D

final marsh
#

Hi all, I hope you're having a good time :)

The bot has been updated to enable interfacing with DALL-E 2, using the [[DRAW|<Description goes here>]] magic keyword!

In this experimental phase, everyone in the testing server can generate up to 100 images. You can either do this by sending the [[DRAW|...]] keyword in a ping to GPT-Shell or a reply, or by asking for a visual thing from #arti (see link to Discord in https://github.com/firtoz/GPT-Shell ). See the channel for examples.

People who donate get unlimited access :D

This should work for your servers as well, if your OpenAI API key has enough balance. You can change the image limit per user by using the /chat-gpt-config command, and selecting the "Change Message Limits" button. -1 = Unlimited.

You can also provide role IDs for the roles who can perform unlimited image generations.

DALL-E 2 costs will apply: $0.02 per generation

If we run out of tokens for the server, the functionality will stop working until we can add more credits. It may not print any error messages, haven't tested that yet ๐Ÿ˜…

PS: If you know a way to interface with MidJourney or something like that with code, please ping me ASAP! I can hook that in which will be better looking but also cheaper :D

GitHub

GPT-Shell is an OpenAI based chat-bot that is similar to OpenAI's ChatGPT - GitHub - firtoz/GPT-Shell: GPT-Shell is an OpenAI based chat-bot that is similar to OpenAI's ChatGPT

#

[UPDATED 1-3-23] [Open Source Release] GPT-Shell | Discord Bot based on text-davinci-003 and DALL-E

final marsh
final marsh
final marsh
final marsh
#

GPT-Shell team is growing :)

We have a few volunteers who are donating their time to organise discord and help users, and some people who will get in product design and marketing. It's quite exciting :D

Also we are going to get approved by Discord very soon to get into more than 100 servers. Currently we are at 97 and when we reach 100 discord needs verification to get to 101+.

final marsh
#

New updates :D I added wolfram alpha support:

https://twitter.com/firtozb/status/1616420818568839177?s=20&t=QSsWfCs3Cmj4Z4VV-4exhw

Also can do private threads automatically.

These are in the repo already :D

Lunchtime #GPTShell update!

Unedited video showing me teaching a #ChatGPT clone how to use @Wolfram_Alpha (mistakes by me and bot included)

Open source at https://t.co/mCQi2gqRyM :D

Inspired by https://t.co/E5oxGQcQZy by @stephen_wolfram and tweet below by @DrJimFan :)

โ–ถ Play video
#

And also working on a "image 2 text" functionality to recognise details in uploaded images (still WIP, will practice with some other API to find what's fastest or best) which are then passed on to the GPT-3 prompt:
https://twitter.com/firtozb/status/1616925245872508930?s=20&t=QSsWfCs3Cmj4Z4VV-4exhw

This weekend is definitely a success.

Here's "image to text" via https://t.co/Q3YVSICURt being used to pass information to GPT-3 who lets @Erin_AI_ (WIP version) give her opinion on the photos sent to her. Unedited, showing some delay as Erin "thinks".

#AI #GPT3

โ–ถ Play video
sonic prairie
#

Anyone can guide me how to make this bot? Newbie to discord too lol

final marsh
karmic hamlet
#

@final marsh can I have the code for the old one which used ChatGPT?

karmic hamlet
final marsh
final marsh
final marsh
final marsh
#

Update! We have been nominated for funding!!

https://twitter.com/firtozb/status/1622284305891266561?s=20

I would really appreciate if you can retweet this, and if you contribute to the fund, there is a chance to win some awesome prizes!

Thank you everyone for your interest and support ๐Ÿ™

Support @Erin_AI_ and get amazing rewards! Donate today at https://t.co/2QIjcvOMcs and you can win an NFT with lifetime VIP membership, early access to new features, and 5% of the profits every month forever, including 5% of the donations of today! #ErinFunding #NFT #SupportErin

heavy arrow
#

@final marsh can you check my dm when u have a chance pls

final marsh
#

โœ…

radiant sand
#

k

#

how do i add it

final marsh