-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfee5db
commit 2194dce
Showing
9 changed files
with
206 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
sidebar_position: 2 | ||
hide_table_of_contents: true | ||
--- | ||
|
||
import DocCardList from "@theme/DocCardList"; | ||
|
||
# 🖥 Development | ||
|
||
<DocCardList /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: | ||
<a href="https://github.com/reworkd/AgentGPT/blob/master/README.md"><img src="https://img.shields.io/badge/lang-English-blue.svg" alt="English"/></a> | ||
## Translating our Documentation | ||
This documentation is very experimental. Because of this, we have no plans to support translation just yet 😢 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.