Merge branch 'main' into multi-tenancy

Signed-off-by: Kaveen Kumarasinghe <k5kumara@uwaterloo.ca>
Kaveen Kumarasinghe 2 years ago committed by GitHub
commit eda7e66f02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -169,6 +169,15 @@ After the user's key is validated, they will be able to use GPT3 and DALLE comma
The Moderations service still uses the main API key defined in the `.env` file. Pinecone and discord-tokens are also per-host tokens, not per-user.
# Step-by-Step Guides for GPT3Discord
[**GPT3Discord Guides**](https://github.com/Kav-K/GPT3Discord/tree/main/detailed_guides)
If you follow the link above, you will now get to detailed step-by-step guides that will help you to install and set up your GPT3Discord bot quickly and easily. If you still run into problems or have suggestions for improving the guides, you can join the [**Discord-Server**](https://discord.gg/openai) and **@FluffyFox** will help you in our [**Discord-Thread**](https://discord.com/channels/974519864045756446/1050326404841082930).
*The number and content of the guides is constantly adapted to current requirements.*
# Configuration
All the model parameters are configurable inside discord. Type `/system settings` to view all the configurable parameters, and use `/system settings <param> <value>` to set parameters.

@ -0,0 +1,67 @@
<h1><a href="https://app.tango.us/app/workflow/c1516302-2b29-472d-b9d6-82e1e6a58d4e?utm_source=magicCopy&utm_medium=magicCopy&utm_campaign=workflow%20export%20links" target="_blank">How to create your own Droplet with DigitalOcean to run GPT3Discord</a></h1>
<div><b>Date:</b> January 8, 2023</div>
<div><b>Author:</b> CrypticHeaven-Lab</div>
<hr/>
<div><h3>1. <a href="https://www.digitalocean.com/" target="_blank">Go to DigitalOcean | The Cloud for Builders</a></h3>
</div>
<div><h3>2. Click on Sign up to register yourself.</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/98d99473-62a5-4ee8-ad23-b1659c31a315/b791b344-0dba-4bb4-809b-250a675e9545.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.8105&fp-y=0.0795&fp-z=2.9158&w=1200&ar=1879%3A931" width="600" alt="Click on Sign up to register yourself." />
</div>
<div><h3>3. If you already have an account click on Sign in.</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/51d47d6d-8f24-4d62-b472-62bfd4e28a9a/083509e5-a4d6-4690-9c4e-fab558f67831.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.9643&fp-y=0.0354&fp-z=3.0696&w=1200&ar=1879%3A931" width="600" alt="If you already have an account click on Sign in." />
</div>
<div><h3>4. Click password field</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/65f64772-bc0e-4695-8370-dc9d3ff34972/a3ff43ba-f2d6-499a-9078-35cdb5c750af.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.2501&fp-y=0.6165&fp-z=1.9538&w=1200&ar=1879%3A931" width="600" alt="Click password field" />
</div>
<div><h3>5. Enter your password and click on Log In.</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/3857a3a6-bcc3-4ec6-9abc-ccd3f4ab28fb/dd14f77f-bf57-458a-a015-a2d56075438f.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.2501&fp-y=0.6939&fp-z=1.9538&w=1200&ar=1879%3A931" width="600" alt="Enter your password and click on Log In." />
</div>
<div><h3>6. After these steps click on "Explore our control panel".</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/829f6452-8a93-4b9e-84db-8ac54ad4b673/bf136990-2676-4dba-90bf-3b0309b8a207.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=965%3A763" width="600" alt="After these steps click on &quot;Explore our control panel&quot;." />
</div>
<div><h3>7. Then Click on "Get started with a Droplet".</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/fde0ac69-a6a3-4f28-b69e-24da309481c7/1e628a55-9f9f-47cb-b5ef-cf64d21a039c.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1212%3A690" width="600" alt="Then Click on &quot;Get started with a Droplet&quot;." />
</div>
<div><h3>8. Here it is very important to choose the right distribution via the drop down menu.</h3>
<p>The distribution which works best with the bot is Ubuntu 20.04 (LTS) x64.</p>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/1bbff69f-df7d-4293-99d5-b259440d1ca1/ff4b265b-90f4-4269-ab9b-488145cd29a1.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1246%3A410" width="600" alt="Here it is very important to choose the right distribution via the drop down menu." />
</div>
<div><h3>9. For the next step You've to choose a plan and the CPU option.</h3>
<p>Do at least as shown in the picture below.</p>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/97db3b5f-08db-451a-a33b-47d3234f6884/f1982d00-efe6-4cad-bb3b-bc88524bdbc7.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1207%3A607" width="600" alt="For the next step You&#039;ve to choose a plan and the CPU option." />
</div>
<div><h3>10. You really don't need to add more block storage, as there is enough on default for the bot.</h3>
<p>Just choose the region closest to yours right below the "Add block storage"</p>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/640ade49-9b64-413a-b64c-62ebacc53fd3/a9039f3d-67a4-4b00-8ad0-c4b9a116adb6.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1209%3A524" width="600" alt="You really don&#039;t need to add more block storage, as there is enough on default for the bot." />
</div>
<div><h3>11. Choose the Password option and set up your password.</h3>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/d5c7b916-aaf1-4657-b92e-7e9b927e5a07/e163e4ab-25ff-4f08-ba21-83405622f0ac.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1210%3A484" width="600" alt="Choose the Password option and set up your password." />
</div>
<div><h3>12. I highly recommend you turn on the backup feature.</h3>
<p>Backups increase the monthly amount to pay. The rest is up to you as it is free.</p>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/d62e37b0-5cbd-4dbb-8760-bc00c42ba518/600595ba-1adf-4ad0-a7af-60c727c75c58.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1203%3A456" width="600" alt="I highly recommend you turn on the backup feature." />
</div>
<div><h3>13. Give your Droplet a name or left it untouched if you don't want to rename it.</h3>
<p>Choose some tags or left it untouched. It's for you to decide. </p>
<img src="https://images.tango.us/workflows/c1516302-2b29-472d-b9d6-82e1e6a58d4e/steps/278ef770-bc46-4da2-8ce4-d509ae7da44e/a21a72fd-49d8-45e3-a614-18a1bad9aa46.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1201%3A619" width="600" alt="Give your Droplet a name or left it untouched if you don&#039;t want to rename it." />
</div>
<div><h3>14. Congratulations! You have successfully created your own Droplet.</h3>
</div>
<hr/>
<div>

@ -0,0 +1,40 @@
<h1><a href="https://app.tango.us/app/workflow/d06b2900-1f94-4b89-a3f1-e22ef8428363?utm_source=magicCopy&utm_medium=magicCopy&utm_campaign=workflow%20export%20links" target="_blank">How to get a API-Key from OpenAI</a></h1>
<div><b>Date:</b> January 8, 2023</div>
<div><b>Author:</b> CrypticHeaven-Lab</div>
<hr/>
<div><h3>1. <a href="https://www.deepl.com/translator#de/en/Langsam%20fange%20ich%20an%20OpenAI%20zu%20hassen..." target="_blank">Go to OpenAI at https://openai.com/api/</a></h3>
</div>
<div><h3>2. Click on "SIGN UP" at the top right corner.</h3>
<img src="https://images.tango.us/workflows/d06b2900-1f94-4b89-a3f1-e22ef8428363/steps/b05bcb6b-a769-4629-82f4-182d164872e3/d708629b-cf0d-49d6-bc1d-9b82f42c7d5f.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=188%3A53" width="600" alt="Click on &quot;SIGN UP&quot; at the top right corner." />
</div>
<div><h3>3. Register yourself a new Account following the shown instructions.</h3>
</div>
<div><h3>4. After the successful registration you see the OpenAI overview.</h3>
<img src="https://images.tango.us/workflows/d06b2900-1f94-4b89-a3f1-e22ef8428363/steps/28e72617-81af-403e-8e10-cb163f7ef261/e45db744-e5a1-41c8-91e7-7920f51ea418.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=1852%3A777" width="600" alt="After the successful registration you see the OpenAI overview." />
</div>
<div><h3>5. There you click in the top right corner at "Personal".</h3>
<img src="https://images.tango.us/workflows/d06b2900-1f94-4b89-a3f1-e22ef8428363/steps/4e05d623-95d3-4a6d-8761-b6a46af948c5/3020df6c-a6d7-425a-a539-d11003bc6f23.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=289%3A36" width="600" alt="There you click in the top right corner at &quot;Personal&quot;." />
</div>
<div><h3>6. And then click at "View API keys" in the dropdown menu.</h3>
<img src="https://images.tango.us/workflows/d06b2900-1f94-4b89-a3f1-e22ef8428363/steps/8727d9b6-8909-41db-92ad-6c6cb4ffb565/acf192ed-f68f-4298-b93d-2373ba7bc00c.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=202%3A294" width="600" alt="And then click at &quot;View API keys&quot; in the dropdown menu." />
</div>
<div><h3>7. On the next page click at "Create new secret key".</h3>
<p>If you failed to copy it or lost the copied key, redo that step and delete the old key by clicking on the little grey trash icon right next to the "LAST USED" information for your key.</p>
<img src="https://images.tango.us/workflows/d06b2900-1f94-4b89-a3f1-e22ef8428363/steps/d3141fb6-b89f-49ef-b956-f8755981bbe6/846487b7-47df-4da3-8b9e-6c11992c839f.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=763%3A497" width="600" alt="On the next page click at &quot;Create new secret key&quot;." />
</div>
<div><h3>8. IMPORTANT STEP! Copy this key by clicking the green highlighted button.</h3>
<p>We will need this key in the future for setting up the bot on our server.</p>
<img src="https://images.tango.us/workflows/d06b2900-1f94-4b89-a3f1-e22ef8428363/steps/0e2df991-732e-425a-a6d5-e4924bc90b3f/c3f11360-e444-49d3-a4ce-63d3a30a9b50.png?fm=png&crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5000&fp-z=1.0000&w=1200&ar=518%3A269" width="600" alt="IMPORTANT STEP! Copy this key by clicking the green highlighted button." />
</div>
<hr/>
<div>

@ -40,7 +40,12 @@ if PINECONE_TOKEN:
PINECONE_INDEX = "conversation-embeddings"
if PINECONE_INDEX not in pinecone.list_indexes():
print("Creating pinecone index. Please wait...")
pinecone.create_index('conversation-embeddings', dimension=1536, metric='dotproduct', pod_type='s1')
pinecone.create_index(
"conversation-embeddings",
dimension=1536,
metric="dotproduct",
pod_type="s1",
)
pinecone_service = PineconeService(pinecone.Index(PINECONE_INDEX))
print("Got the pinecone service")

@ -41,7 +41,11 @@ class Settings_autocompleter:
"summarize_threshold": [str(num) for num in range(800, 3500, 50)],
}
if ctx.options["parameter"] in values.keys():
return [value for value in values[ctx.options["parameter"]] if value.startswith(ctx.value.lower())]
return [
value
for value in values[ctx.options["parameter"]]
if value.startswith(ctx.value.lower())
]
else:
await ctx.interaction.response.defer() # defer so the autocomplete in int values doesn't error but rather just says not found
return []

@ -15,4 +15,4 @@ GPT_ROLES = "openai,gpt"
WELCOME_MESSAGE = "Hi There! Welcome to our Discord server. We hope you'll enjoy our server and we look forward to engaging with you!" # This is a fallback message if gpt3 fails to generate a welcome message.
USER_INPUT_API_KEYS="False" # If True, users must use their own API keys for OpenAI. If False, the bot will use the API key in the .env file.
USER_INPUT_API_KEYS="False" # If True, users must use their own API keys for OpenAI. If False, the bot will use the API key in the .env file.

Loading…
Cancel
Save