Docs: assets clean up (#598)

* Update ngrok.md

* Update linode.md

* Update cloudflare.md

* Update testing.md

* Update google_search.md

* Update introduction.md

* Update stable_diffusion.md

* Update wolfram.md

* docs: assets clean up
This commit is contained in:
Fuegovic 2023-07-06 17:41:22 -04:00 committed by GitHub
parent fabd85ff40
commit 69d192bac3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 102 additions and 110 deletions

View file

@ -1,37 +0,0 @@
# Azure OpenAI
In order to use Azure OpenAI with this project, specific environment variables must be set in your `.env` file. These variables will be used for constructing the API URLs.
The variables needed are outlined below:
## Required Variables
* `AZURE_API_KEY`: Your Azure OpenAI API key.
* `AZURE_OPENAI_API_INSTANCE_NAME`: The instance name of your Azure OpenAI API.
* `AZURE_OPENAI_API_DEPLOYMENT_NAME`: The deployment name of your Azure OpenAI API.
* `AZURE_OPENAI_API_VERSION`: The version of your Azure OpenAI API.
For example, with these variables, the URL for chat completion would look something like:
```plaintext
https://{AZURE_OPENAI_API_INSTANCE_NAME}.openai.azure.com/openai/deployments/{AZURE_OPENAI_API_DEPLOYMENT_NAME}/chat/completions?api-version={AZURE_OPENAI_API_VERSION}
```
You should also consider changing the `AZURE_OPENAI_MODELS` variable to the models available in your deployment.
## Optional Variables
* `AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME`: The deployment name for completion. This is currently not in use but may be used in future.
* `AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME`: The deployment name for embedding. This is currently not in use but may be used in future.
These two variables are optional but may be used in future updates of this project.
## Plugin Endpoint Variables
Note: The Plugins endpoint may not work as expected with Azure OpenAI, which may not support OpenAI Functions yet. Even when results were generated, they were not great compared to the regular OpenAI endpoint. You should set the "Functions" off in the Agent settings, and it's recommend to not skip completion with functions off.
To use Azure with the Plugins endpoint, there are some extra steps to take as the langchain library is particular with envrionment variables:
* `PLUGINS_USE_AZURE`: If set to "true" or any truthy value, this will enable the program to use Azure with the Plugins endpoint.
* `AZURE_OPENAI_API_KEY`: Your Azure API key must be set to this environment variable, not to be confused with `AZURE_API_KEY`, which can remain as before.
* `OPENAI_API_KEY`: Must be omitted or commented to use Azure with Plugins
These steps are quick workarounds as other solutions would require renaming environment variables. This is due to langchain overriding environment variables, and will have to be solved with a later solution.

View file

@ -21,14 +21,15 @@ Then you can get the API key, click the "Get a key" button on this page: https:/
Click to sign in(make a Google acct if you do not have one):
![image](../../assets/docs/features/plugins/google_search-1.png)
![google_search-1](https://github.com/danny-avila/LibreChat/assets/32828263/51db1a90-c2dc-493c-b32c-821257c27b4e)
## 3\. Register yourself a new account/Login to the Control Panel
After logging in, you will be redirected to the Control Panel to create a new search engine:
![image](../../assets/docs/features/plugins/google_search-2.png)
![google_search-2](https://github.com/danny-avila/LibreChat/assets/32828263/152cfe7c-4796-49c6-9160-92cddf38f1c8)
## 4\. Create a new search engine
@ -36,13 +37,12 @@ After logging in, you will be redirected to the Control Panel to create a new se
Fill in a name, select to "Search the entire web" and hit "Create":
![image](../../assets/docs/features/plugins/google_search-3.png)
![google_search-3](https://github.com/danny-avila/LibreChat/assets/32828263/c63441fc-bdb2-4086-bb7a-fcbe3d67aef9)
## 5\. Copy your Search engine ID to your .env file
![image](../../assets/docs/features/plugins/google_search-4.png)
![google_search-4](https://github.com/danny-avila/LibreChat/assets/32828263/e03b5c79-87e5-4a68-b83e-61faf4f2f718)
## 6\. Go to [custom-search docs](https://developers.google.com/custom-search/v1/introduction) to get a Google search API key
@ -50,16 +50,14 @@ Fill in a name, select to "Search the entire web" and hit "Create":
## 7\. Click "Get a Key":
![image](../../assets/docs/features/plugins/google_search-5.png)
![google_search-5](https://github.com/danny-avila/LibreChat/assets/32828263/2b93a2f9-5ed2-4794-96a8-a114e346a602)
## 8\. Name your project and agree to the Terms of Service
![image](../../assets/docs/features/plugins/google_search-6.png)
![google_search-6](https://github.com/danny-avila/LibreChat/assets/32828263/82c9c3ef-7363-40cd-a89e-fc45088e4c86)
## 9\. Copy your Google search API key to your .env file
![image](../../assets/docs/features/plugins/google_search-7.png)
![google_search-7](https://github.com/danny-avila/LibreChat/assets/32828263/8170206a-4ba6-40e3-b20e-bdbac21d6695)

View file

@ -1,6 +1,6 @@
# Plugins Endpoint
![image](../../assets/docs/features/plugins/introduction-1.png)
![introduction-1](https://github.com/danny-avila/LibreChat/assets/32828263/7e426681-2bef-4dfc-9b4e-0cf2c09cb1d5)
The plugins endpoint opens the door to prompting LLMs in new ways other than traditional input/output prompting.
@ -17,17 +17,17 @@ More than this, you can use this endpoint for changing your conversation setting
The LLM process when using Plugins is illustrated below.
![Untitled-2023-06-04-1543(1)](../../assets/docs/features/plugins/introduction-2.png)
![introduction-2](https://github.com/danny-avila/LibreChat/assets/32828263/789406e1-7345-43d2-823b-8aed0588bb78)
**When you open the settings with the Plugins endpoint selected, you will view the default settings for the Completion Phase.**
Clicking on **"Show Agent Settings"** will allow you to modify parameters for the thinking phase
![image](../../assets/docs/features/plugins/introduction-3.png)
![introduction-3](https://github.com/danny-avila/LibreChat/assets/32828263/f3cf33d0-701f-409d-8ef6-f336993df55d)
---
![image](../../assets/docs/features/plugins/introduction-4.png)
![introduction-4](https://github.com/danny-avila/LibreChat/assets/32828263/c6a33fb2-aa14-4a88-9467-9f2c429e6338)
- You can specify which plugins you would like to select from by installing/uninstalling them in the Plugin store
- See this guide on how to create your own plugins (WIP)
@ -68,8 +68,7 @@ Clicking on **"Show Agent Settings"** will allow you to modify parameters for th
### Showcase
![image](../../assets/docs/features/plugins/introduction-5.png)
![introduction-5](https://github.com/danny-avila/LibreChat/assets/32828263/40cd1989-437f-49bb-9055-010e3efc468b)
![image](../../assets/docs/features/plugins/introduction-6.png)
![introduction-6](https://github.com/danny-avila/LibreChat/assets/32828263/b009a094-7311-45fb-a7ea-f5010f32ec45)

View file

@ -57,12 +57,13 @@ With the docker deployment you can skip step 2 and step 3, use the setup instruc
### Select the plugins endpoint
![image](../../assets/docs/features/plugins/plugins_endpoint.png)
![plugins_endpoint](https://github.com/danny-avila/LibreChat/assets/32828263/9717e111-2e9e-43da-bd08-c5a0bbbc4d6d)
### Open the Plugin store and Install Stable Diffusion
![image](../../assets/docs/features/plugins/plugin_store.png)
![image](../../assets/docs/features/plugins/stable_diffusion-1.png)
![plugin_store](https://github.com/danny-avila/LibreChat/assets/32828263/add4d6a8-e5d6-4129-a334-4ff9290c0e2d)
![stable_diffusion-1](https://github.com/danny-avila/LibreChat/assets/32828263/b4364f41-0f7e-4197-af86-7d6061797366)
## 5. Select the plugin and enjoy!
![image](../../assets/docs/features/plugins/stable_diffusion-2.png)
![stable_diffusion-2](https://github.com/danny-avila/LibreChat/assets/32828263/8fa898b9-0826-42eb-bba4-6f85ec5f6ec2)

View file

@ -8,14 +8,14 @@ An AppID must be supplied in all calls to the Wolfram|Alpha API.
## 2. Go to the <a href='https://developer.wolframalpha.com/portal/myapps/'>Developer Portal</a> click on "Get an AppID".
## 3. Configure it in LibreChat
### Select the plugins endpoint
![image](../../assets/docs/features/plugins/plugins_endpoint.png)
![plugins_endpoint](https://github.com/danny-avila/LibreChat/assets/32828263/9717e111-2e9e-43da-bd08-c5a0bbbc4d6d)
### Open the Plugin store
![image](../../assets/docs/features/plugins/plugin_store.png)
![plugin_store](https://github.com/danny-avila/LibreChat/assets/32828263/add4d6a8-e5d6-4129-a334-4ff9290c0e2d)
### Install Wolfram and Provide your AppID
![image](../../assets/docs/features/plugins/wolfram-1.png)
![wolfram-1](https://github.com/danny-avila/LibreChat/assets/32828263/bd165497-d529-441d-8372-a68db19adc3f)
- Alternatively: you (the admin) can set the value in `\.env` to bypass the prompt: `WOLFRAM_APP_ID=your_app_id`
## 5. Select the plugin and enjoy!
![image](../../assets/docs/features/plugins/wolfram-2.png)
![wolfram-2](https://github.com/danny-avila/LibreChat/assets/32828263/2825e961-6c46-4728-96cd-1012a0862943)

View file

@ -1,99 +0,0 @@
# User/Auth System
## **First Time Setup**
In order for the auth system to function properly, there are some environment variables that are needed. Note that this information is also included in the [/.env.example](/.env.example) file.
In /.env, you will need to set the following variables:
```bash
# Change this to a secure string
JWT_SECRET=secret
# Set the expiration delay for the secure cookie with the JWT token
# Delay is in millisecond e.g. 7 days is 1000*60*60*24*7
SESSION_EXPIRY=1000 * 60 * 60 * 24 * 7
DOMAIN_SERVER=http://localhost:3080
DOMAIN_CLIENT=http://localhost:3080
```
*Please Note: If you are wanting this to work in development mode, you will need to create a file called `.env.development` in the root directory and set `DOMAIN_CLIENT` to `http://localhost:3090` or whatever port is provided by vite when runnning `npm run frontend-dev`*
Important: When you run the app for the first time, you need to create a new account by clicking on "Sign up" on the login page. The first account you make will be the admin account. The admin account doesn't have any special features right now, but it might be useful if you want to make an admin dashboard to manage other users later.
⚠️ **__For the first time, you should use a local account (email and password) to sign up and log in.__**
---
## **OAuth2/Social Login**
## How to Set Up Google Authentication
To enable Google login, you must create an application in the [Google Cloud Console](https://cloud.google.com) and provide the client ID and client secret in the `/.env` file.
1. Go to "APIs and Services" in your Google Cloud account and click on "Credentials".
2. Click on "Configure consent screen" and select "External" as the user type.
3. Add "profile", "email" and "openid" as the scopes for your app. These are the first three checkboxes when you click on "Add or remove scopes".
4. Click on "Save and continue" and then "Back to dashboard".
5. Click on "Create Credentials" and then "OAuth client ID".
6. Select "Web application" as the application type and give it a name.
7. Add "http://localhost" "http://localhost:3080" and "http://localhost:3090" to the authorized JavaScript origins.
8. Add "http://localhost:3080/oauth/google/callback" to the authorized redirect URIs.
9. Click on "Create" and copy your client ID and client secret.
10. Paste them into your /.env file.
11. Enable the feature in the /.env file
---
## How to Set Up OpenID Authentication with Azure AD
1. Go to the Azure Portal and sign in with your account.
2. In the search box, type Azure Active Directory and click on it.
3. On the left menu, click on App registrations and then on New registration.
4. Give your app a name and select Web as the platform type.
5. In the Redirect URI field, enter http://localhost:3080/oauth/openid/callback and click on Register.
6. You will see an Overview page with some information about your app. Copy the Application (client) ID and the Directory (tenant) ID and save them somewhere.
7. On the left menu, click on Authentication and check the boxes for Access tokens and ID tokens under Implicit grant and hybrid flows.
8. On the left menu, click on Certificates & Secrets and then on New client secret. Give your secret a name and an expiration date and click on Add.
9. You will see a Value column with your secret. Copy it and save it somewhere. Don't share it with anyone!
10. Open the .env file in your project folder and add the following variables with the values you copied:
```
OPENID_CLIENT_ID=Your Application (client) ID
OPENID_CLIENT_SECRET=Your client secret
OPENID_ISSUER=https://login.microsoftonline.com/Your Directory (tenant ID)/v2.0/
OPENID_SESSION_SECRET=Any random string
OPENID_SCOPE=openid profile email
OPENID_CALLBACK_URL=/oauth/openid/callback
```
11. Save the .env file and you're done! You have successfully set up OpenID authentication with Azure AD for your app.
---
## How to Set Up Github Authentication
1. Go to your [Github Developer settings](https://github.com/settings/apps)
2. Create a new Github app
3. Give it a GitHub App name and set in the Homepage URL your [DOMAIN_CLIENT](https://github.com/danny-avila/LibreChat/blob/main/.env.example#L219) (example: http://localhost:3080)
4. Add a callback URL and set it as "[Your DOMAIN_CLIENT](https://github.com/danny-avila/LibreChat/blob/main/.env.example#L219)/oauth/github/callback" (example: http://localhost:3080/oauth/github/callback)
5. Remove the Active checkbox in the Webhook section
6. Save changes and generate a Client Secret
7. In the Permissions & events tab select, open the Account Permissions and set Email addresses to Read-only
8. Put the Client ID and Client Secret in the .env file
9. Save the .env file
---
## **Email and Password Reset**
Most of the code is in place for sending password reset emails, but is not yet feature-complete as I have not setup an email server to test it. Currently, submitting a password reset request will then display a link with the one-time reset token that can then be used to reset the password. Understanding that this is a considerable security hazard, email integration will be included in the next release.
## **Disable User Registration**
To disable or re-enable registration, open up the root `.env` file and set `ALLOW_REGISTRATION=true` or `ALLOW_REGISTRATION=false` depending on if you want registration open or closed.
### ⚠️***Warning***
If you previously implemented your own user system using the original scaffolding that was provided, you will no longer see conversations and presets by switching to the new user system. This is because of a design flaw in the scaffolding implementation that was problematic for the inclusion of social login.
### For user updating from an older version of the app:
When the first account is registered, the application will automatically migrate any conversations and presets that you created before the user system was implemented to that account.
if you use login for the first time with a social login account (eg. Google, facebook, etc.), the conversations and presets that you created before the user system was implemented will NOT be migrated to that account.