From 2194dceb6ad6c09604498235cfa7e51ee4a2c595 Mon Sep 17 00:00:00 2001 From: Asim Shrestha <50181239+asim-shrestha@users.noreply.github.com> Date: Fri, 12 May 2023 17:58:32 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9A=20Update=20documentation=20(#525)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/development/index.md | 10 +++ docs/docs/development/setup.md | 64 +++++++++++++++++++ docs/docs/development/translations.md | 89 +++++++++++++++++++++++++++ docs/docs/faq.md | 21 +++++-- docs/docs/roadmap.md | 34 +++++++--- docs/docs/setup.md | 10 --- docs/docs/usecases.md | 4 +- docs/package.json | 2 +- next/src/middleware.ts | 0 9 files changed, 206 insertions(+), 28 deletions(-) create mode 100644 docs/docs/development/index.md create mode 100644 docs/docs/development/setup.md create mode 100644 docs/docs/development/translations.md delete mode 100644 docs/docs/setup.md delete mode 100644 next/src/middleware.ts diff --git a/docs/docs/development/index.md b/docs/docs/development/index.md new file mode 100644 index 0000000000..7d81c4ad00 --- /dev/null +++ b/docs/docs/development/index.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 2 +hide_table_of_contents: true +--- + +import DocCardList from "@theme/DocCardList"; + +# πŸ–₯ Development + + diff --git a/docs/docs/development/setup.md b/docs/docs/development/setup.md new file mode 100644 index 0000000000..1d28ee429a --- /dev/null +++ b/docs/docs/development/setup.md @@ -0,0 +1,64 @@ +--- +sidebar_position: 1 +--- + +# πŸ› οΈ Setup + +The following document will help you set up a local installation of AgentGPT. + +## Stack + +- πŸ’… Frontend: NextJS + Typescript +- 🐍 Backend: FastAPI + Python +- πŸ“š DB: MySQL through docker with the option of running SQLite locally + +## ENV + +Before you can get started, you need to ensure your ENV is correctly configured. To do this, copy over +the [.env.example](https://github.com/reworkd/AgentGPT/blob/main/.env.example) file into the `./next/` directory, rename +it to `.env` and update values as necessary. Some things to note: + +- You will need to update the `OPENAI_API_KEY` with your own value. See the [FAQ](/faq) for details +- The DB ENV values are taken from definitions in `./docker-compose.yml` +- To enable web search, set `NEXT_PUBLIC_WEB_SEARCH_ENABLED=true` and use [your own SERP api key](https://serper.dev/) + for `SERP_API_KEY`. + +## Using Docker + +The docker build is very straightforward and should work out of the box. +Ensure you have docker installed by visiting [their website](https://www.docker.com/). After this, run the following +command: + +```bash +docker-compose up --build +``` + +This will spin up a container for the frontend, backend, and database. + +## Developing outside of docker + +Outside of docker, you'll need to just configure your ENV. Additionally, you can use `setup.sh` to walkthrough ENV +configuration and also update your Prisma configuration to point to a local SQLite +instance. + +After this, you can run the following to set up your Next.js project. We will add additional instructions for the Python +backend when enabled. + +```bash +// Frontend +cd ./next +npm install +npm run dev +``` + +## Running the site + +After you have locally built AgentGPT, you can travel to http://localhost:3000/ in your web browser. + +## Issues / Additional help + +If you're still having trouble, you can follow a legacy guide from +@CybrCo: [How to install AgentGPT locally](https://snapdragon-writer-867.notion.site/How-to-Install-AgentGPT-Locally-9b96b2314c9b491397976249fd121023) + +If you still face problems, please submit an [issue on GitHub](https://github.com/reworkd/AgentGPT/issues) or reach out +to the team on [discord](https://discord.gg/jdSBAnmdnY). diff --git a/docs/docs/development/translations.md b/docs/docs/development/translations.md new file mode 100644 index 0000000000..01db037b41 --- /dev/null +++ b/docs/docs/development/translations.md @@ -0,0 +1,89 @@ +--- +sidebar_position: 2 +--- + +# 🌎 Translations + +AgentGPT has translations across a variety of languages thanks to the help of many contributors such as @Cs4K1Sr4C. +languages. We're always looking to improve our translations however, if you notice something is off or missing, please +feel free to make the necessary updates or submit a ticket on GitHub! + +## Translating the Frontend + +We use i18next to handle our frontend translations. How it works is we have a folder for each language +in [next/public/locales](https://github.com/reworkd/AgentGPT/tree/main/next/public/locales). + +```bash title="next/public/locales" +> en +> fr +> hu +... +> zh +``` + +For each component within the app, we namespace their translations. For example, our ChatWindow uses the `chat` name +space and its translations will be found in the `chat.json` under each folder. Translations are key value pairs where +the key represents the +desired text and the value represents the translation for a given langauge. + +An example from the `chat` namespace: + +- English: `"EMBARKING_ON_NEW_GOAL": "Embarking on a new goal:"` +- Spanish:`"EMBARKING_ON_NEW_GOAL": "EmbarcΓ‘ndose en un nuevo objetivo:"` + +#### Adding a new langauge + +To add a new language, go into our i18 config and add a new locale + +```bash title="next/next-i18next.config.js" +i18n: { + defaultLocale: "en", + locales: + [ + "en", + "hu", + ..., + "sk", + "hr", + "tr", + // Insert new language code here + ], + ... +``` + +Then head over to our languages definition and add a section to the available languages list + +```tsx title="next/src/utils/languages.ts" +export const availableLanguages: Language[] = [ + ENGLISH, + { code: "fr", name: "FranΓ§ais", flag: "πŸ‡«πŸ‡·" }, + // ... + { code: "tr", name: "TΓΌrkΓ§e", flag: "πŸ‡ΉπŸ‡·" }, + // Insert new language here +]; +``` + +After this, you must create a new folder with your langauge code +in [next/public/locales](https://github.com/reworkd/AgentGPT/tree/main/next/public/locales) and add translations for all +namespaces of our app. Note these values may not hot reload, so you must manually restart your next server. + +## Translating the Backend + +The backend translations are handled via the model itself. +We simply prompt it to provide the answer in the user selected langauge. +This means that whenever a new frontend language is added, the language is immediately supported on the backend! +This does however mean that we don't currently have much room to actually edit the translations provided by the model. + +## Translating the Readme + +We have a few README translations that live in [main/docs](https://github.com/reworkd/AgentGPT/tree/main/docs) such +as `README.zh-HANS.md`. If you'd like to translate the README to your language, make a similar file. + +After doing this, add a link badge to our main english README alongside the other badges. Example: + +English + +## Translating our Documentation + +This documentation is very experimental. Because of this, we have no plans to support translation just yet 😒 + diff --git a/docs/docs/faq.md b/docs/docs/faq.md index 9e9d46aea5..f5c073d55e 100644 --- a/docs/docs/faq.md +++ b/docs/docs/faq.md @@ -1,11 +1,17 @@ --- -sidebar_position: 3 +sidebar_position: 4 --- + # ❓ Frequently Asked Questions + ### Introduction -Below is a list of the most frequently asked questions about AgentGPT. If you have any unanswered questions, please reach out to the moderation or dev team on [Discord](https://discord.gg/jdSBAnmdnY) or [GitHub](https://github.com/reworkd/AgentGPT). + +Below is a list of the most frequently asked questions about AgentGPT. If you have any unanswered questions, please +reach out to the moderation or dev team on [Discord](https://discord.gg/jdSBAnmdnY) +or [GitHub](https://github.com/reworkd/AgentGPT). ### API key issues +
Where can I get an API key? You should first sign up for an OpenAI account. You can do so here. @@ -24,7 +30,8 @@ Expired credit will show up as red such as the below image ![Example banner](./assets/expired-free-tier.png) -If you have used up your free tier credits, you will need to add billing information into your API key: OpenAI API Overview. +If you have used up your free tier credits, you will need to add billing information into your API +key: OpenAI API Overview. Note that a few runs of AgentGPT will only cost a few cents.
@@ -47,6 +54,7 @@ Using AgentGPT is free as we handle the API costs. If you provide your own API k ### Agent issues +
AgentGPT said it made a file / database / script, where can I find it? Currently AgentGPT is incapable of outputs in that manner, but this is something we are actively working on. @@ -90,11 +98,13 @@ If you provide your own API key, you can increase the output length within the a
### Misc +
What is the difference between this and ChatGPT? ChatGPT is a great tool that will allow you to ask a specific question and receive a result. It also follows a conversation, so after you have received a response, you can continue talking to it and it will remember (within limits) what was descussed previously. -AgentGPT on the otherhand is a platform for AI agents. You configure an agent to accomplish a broad goal, and it will automatically think and perform tasks to achieve it. +AgentGPT on the otherhand is a platform for AI agents. You configure an agent to accomplish a broad goal, and it will +automatically think and perform tasks to achieve it.
@@ -112,12 +122,11 @@ AgentGPT can do a lot, but we're also working on giving it a lot more capabiliti Not yet but this is coming very soon! Keep an eye on our roadmap.
- ### Local contribution issues
I'm having trouble setting up AgentGPT locally! -Please visit our setup guide to diagnose any issues. If you have a problem that is undocumented, please submit an issue on GitHub. +Please visit our setup guide to diagnose any issues. If you have a problem that is undocumented, please submit an issue on GitHub.
diff --git a/docs/docs/roadmap.md b/docs/docs/roadmap.md index ad9a6e55c2..7a1a2e947f 100644 --- a/docs/docs/roadmap.md +++ b/docs/docs/roadmap.md @@ -1,20 +1,25 @@ --- -sidebar_position: 2 +sidebar_position: 3 --- # πŸš€ Roadmap + AgentGPT is currently in beta and we have a lot of features planned. Here's a glimpse of whats in the works! ## Finished features βœ” + - πŸ” **Users and authentication** - πŸ’Ύ **Saving and sharing agent runs** - If you are signed in, after your agent run has finished you have the ability to save it to our database. - 🌐 **Dynamic translations for multiple languages** - - AgentGPT is used worldwide and we want to ensure everyone has a seamless experience on the platform. If we are missing the translation for your language, we'd love your help in getting it implemented! + - AgentGPT is used worldwide, and we want to ensure everyone has a seamless experience on the platform. If we are + missing the translation for your language, we'd love your help in getting it implemented! - πŸ€– **AI Model customization** - - Now users have the ability to use their own OpenAI API key to customize everything from the model, temperature, loops, and more! This also all runs directly within the user's browser! + - Now users have the ability to use their own OpenAI API key to customize everything from the model, temperature, + loops, and more! This also all runs directly within the user's browser! ## Features in development ⏳ + :::tip AgentGPT developers are actively working on the following. Expect these to take anywhere from a few days to 2 weeks. ::: @@ -24,17 +29,23 @@ AgentGPT developers are actively working on the following. Expect these to take - Note we've had to disable this due to costs, we will have it back up and running permanently within the week. - This does not currently visit the websites themselves and parse websites but we are working on this. - ✈ **Backend migration to Python** - - This is a bigger undertaking but something we feel must be done. It will allow us to migrate off of edge functions and use all of the tools available for language models in the Python ecosystem. + - This is a bigger undertaking but something we feel must be done. It will allow us to migrate off of edge functions + and use all the tools available for language models in the Python ecosystem. - 🧠 **Long term memory via a vector DB** - - Providing Agents with more memory will allow them to perform tasks with a lot more context. This will also stop Agents from trying to perform the same or similar tasks multiple times. + - Providing Agents with more memory will allow them to perform tasks with a lot more context. This will also stop + Agents from trying to perform the same or similar tasks multiple times. - πŸ€– **Agent steer-ability** - - Users should be able to guide the Agent through a goal. This involves adding or removing tasks and providing additional context for the agent + - Users should be able to guide the Agent through a goal. This involves adding or removing tasks and providing + additional context for the agent - πŸ“š **Documentation overhaul** - - This is the page you're viewing right now! It will continually be updated as the project evolves to allow any new user / contributer to get familiar with AgentGPT as quickly as possible. + - This is the page you're viewing right now! It will continually be updated as the project evolves to allow any new + user / contributer to get familiar with AgentGPT as quickly as possible. ## Planned features πŸ•°οΈ + :::tip -If any of these features stand out to you or you'd like to suggest more features, please do so in the [AgentGPT discord](https://discord.gg/jdSBAnmdnY)! +If any of these features stand out to you, or you'd like to suggest more features, please do so in +the [AgentGPT discord](https://discord.gg/jdSBAnmdnY)! ::: - πŸ‘¨β€πŸ‘©β€πŸ‘¦ **Interaction with websites and people** @@ -45,5 +56,8 @@ If any of these features stand out to you or you'd like to suggest more features - πŸ€– **Cross agent communication** ## Notes -We are constantly updating our roadmap and adding new features so stay tuned for more updates and have a look at our GitHub. -We are however a small team and would love community support in helping develop AgentGPT. If you're interested, please head over to our [contributing page](/contributing). + +We are constantly updating our roadmap and adding new features so stay tuned for more updates and have a look at our +GitHub. +We are however a small team and would love community support in helping develop AgentGPT. If you're interested, please +head over to our [contributing page](/contributing). diff --git a/docs/docs/setup.md b/docs/docs/setup.md deleted file mode 100644 index 38a2fe4470..0000000000 --- a/docs/docs/setup.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -sidebar_position: 4 ---- - -# πŸ› οΈ Setup - -AgentGPT is constantly evolving and with this comes changes to how the platform behaves locally. We are working on updating this setup documentation with all of our new features and plan to keep it continually maintained. - -Until this work is done, please follow the following guide from @CybrCo: [How to install AgentGPT locally](https://snapdragon-writer-867.notion.site/How-to-Install-AgentGPT-Locally-9b96b2314c9b491397976249fd121023) -or follow our README on GitHub. If you have any issues, please submit an [issue on GitHub](https://github.com/reworkd/AgentGPT/issues) or reach out on [discord](https://discord.gg/jdSBAnmdnY). \ No newline at end of file diff --git a/docs/docs/usecases.md b/docs/docs/usecases.md index 1399033c17..e8de13f108 100644 --- a/docs/docs/usecases.md +++ b/docs/docs/usecases.md @@ -3,5 +3,7 @@ sidebar_position: 6 --- # πŸ”₯ Use Cases + This page is a WIP and will serve as a cool gateway into the different use cases of AgentGPT. -If you already interesting use cases in mind, please reach out to the moderation or dev team on [Discord](https://discord.gg/jdSBAnmdnY) or [GitHub](https://github.com/reworkd/AgentGPT). \ No newline at end of file +If you already have interesting use cases in mind, please reach out to the moderation or dev team +on [Discord](https://discord.gg/jdSBAnmdnY) or [GitHub](https://github.com/reworkd/AgentGPT). diff --git a/docs/package.json b/docs/package.json index 30df8aa9a2..df117599cf 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "docusaurus start", + "start": "docusaurus start --port 3001", "build": "docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", diff --git a/next/src/middleware.ts b/next/src/middleware.ts deleted file mode 100644 index e69de29bb2..0000000000