Add all the new component docs to the site and do a tidy up of docs (#7098)

* feat: add all the new component docs to the site

* fix(docs): relative links and markdown warnings

* feat(docs): How to contribute to the docs as a docs section

* fix(docs): missed docs page for developer setup

* fix(docs): re-add configurations options

* fix(docs): bad link to components fixed

* fix(docs): bad link to components fixed

* ref(docs): reorder some items to make more sense

* fix(docs): bad indentation and duplicate block

* fix(docs): warning about out of date markdown extension

* fix(docs): broken links fixed

* fix(docs): markdown formatter complaints
This commit is contained in:
Nicholas Tindle
2024-04-23 08:49:07 -05:00
committed by GitHub
parent fd3f8fa5fc
commit 5e89b8c6d1
18 changed files with 159 additions and 92 deletions

View File

@@ -1,7 +1,10 @@
### Other stuff # Advanced Components
## General
Debugging may be easier because we can inspect the exact components that were called and where the pipeline failed (current WIP pipeline): Debugging may be easier because we can inspect the exact components that were called and where the pipeline failed (current WIP pipeline):
![](../imgs/modular-pipeline.png) ![Modular Pipeline](../../imgs/modular-pipeline.png)
Also that makes it possible to call component/pipeline/function again when failed and recover. Also that makes it possible to call component/pipeline/function again when failed and recover.

View File

@@ -34,4 +34,4 @@ class MyAgent(Agent):
self.my_component = MyComponent() self.my_component = MyComponent()
``` ```
For more customization, you can override the `propose_action` and `execute` or even subclass `BaseAgent` directly. This way you can have full control over the agent's components and behavior. Have a look at the [implementation of Agent](./../../../../autogpts/autogpt/autogpt/agents/agent.py) for more details. For more customization, you can override the `propose_action` and `execute` or even subclass `BaseAgent` directly. This way you can have full control over the agent's components and behavior. Have a look at the [implementation of Agent](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt/autogpt/agents/agent.py) for more details.

View File

@@ -94,7 +94,7 @@ To learn more about commands see [🛠️ Commands](./commands.md).
After components provided all necessary data, the agent needs to build the final prompt that will be send to a llm. After components provided all necessary data, the agent needs to build the final prompt that will be send to a llm.
Currently, `PromptStrategy` (*not* a protocol) is responsible for building the final prompt. Currently, `PromptStrategy` (*not* a protocol) is responsible for building the final prompt.
If you want to change the way the prompt is built, you need to create a new `PromptStrategy` class, and then call relavant methods in your agent class. If you want to change the way the prompt is built, you need to create a new `PromptStrategy` class, and then call relavant methods in your agent class.
You can have a look at the default strategy used by the AutoGPT Agent: [OneShotAgentPromptStrategy](../../../../autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py), and how it's used in the [Agent](../../../../autogpts/autogpt/autogpt/agents/agent.py) (search for `self.prompt_strategy`). You can have a look at the default strategy used by the AutoGPT Agent: [OneShotAgentPromptStrategy](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py), and how it's used in the [Agent](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt/autogpt/agents/agent.py) (search for `self.prompt_strategy`).
## Example `UserInteractionComponent` ## Example `UserInteractionComponent`
@@ -102,53 +102,58 @@ Let's create a slighlty simplified version of the component that is used by the
It gives an ability for the agent to ask user for input in the terminal. It gives an ability for the agent to ask user for input in the terminal.
1. Create a class for the component that inherits from `CommandProvider`. 1. Create a class for the component that inherits from `CommandProvider`.
```py
class MyUserInteractionComponent(CommandProvider): ```py
"""Provides commands to interact with the user.""" class MyUserInteractionComponent(CommandProvider):
pass """Provides commands to interact with the user."""
``` pass
```
2. Implement command method that will ask user for input and return it. 2. Implement command method that will ask user for input and return it.
```py
def ask_user(self, question: str) -> str: ```py
"""If you need more details or information regarding the given goals, def ask_user(self, question: str) -> str:
you can ask the user for input.""" """If you need more details or information regarding the given goals,
print(f"\nQ: {question}") you can ask the user for input."""
resp = input("A:") print(f"\nQ: {question}")
return f"The user's answer: '{resp}'" resp = input("A:")
``` return f"The user's answer: '{resp}'"
```
3. The command needs to be decorated with `@command`. 3. The command needs to be decorated with `@command`.
```py
@command( ```py
parameters={ @command(
"question": JSONSchema( parameters={
type=JSONSchema.Type.STRING, "question": JSONSchema(
description="The question or prompt to the user", type=JSONSchema.Type.STRING,
required=True, description="The question or prompt to the user",
) required=True,
}, )
) },
def ask_user(self, question: str) -> str: )
"""If you need more details or information regarding the given goals, def ask_user(self, question: str) -> str:
you can ask the user for input.""" """If you need more details or information regarding the given goals,
print(f"\nQ: {question}") you can ask the user for input."""
resp = input("A:") print(f"\nQ: {question}")
return f"The user's answer: '{resp}'" resp = input("A:")
``` return f"The user's answer: '{resp}'"
```
4. We need to implement `CommandProvider`'s `get_commands` method to yield the command. 4. We need to implement `CommandProvider`'s `get_commands` method to yield the command.
```py
def get_commands(self) -> Iterator[Command]: ```py
yield self.ask_user def get_commands(self) -> Iterator[Command]:
``` yield self.ask_user
```
5. Since agent isn't always running in the terminal or interactive mode, we need to disable this component by setting `self._enabled` when it's not possible to ask for user input. 5. Since agent isn't always running in the terminal or interactive mode, we need to disable this component by setting `self._enabled` when it's not possible to ask for user input.
```py
def __init__(self, config: Config): ```py
self.config = config def __init__(self, config: Config):
self._enabled = not config.noninteractive_mode self.config = config
``` self._enabled = not config.noninteractive_mode
```
The final component should look like this: The final component should look like this:
@@ -228,7 +233,7 @@ class MyAgent(Agent):
## Learn more ## Learn more
The best place to see more examples is to look at the built-in components in the [autogpt/components](../../../../autogpts/autogpt/autogpt/components/) and [autogpt/commands](../../../../autogpts/autogpt/autogpt/commands/) directories. The best place to see more examples is to look at the built-in components in the [autogpt/components](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt/autogpt/components/) and [autogpt/commands](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt/autogpt/commands/) directories.
Guide on how to extend the built-in agent and build your own: [🤖 Agents](./agents.md) Guide on how to extend the built-in agent and build your own: [🤖 Agents](./agents.md)
Order of some components matters, see [🧩 Components](./components.md) to learn more about components and how they can be customized. Order of some components matters, see [🧩 Components](./components.md) to learn more about components and how they can be customized.

View File

@@ -11,7 +11,7 @@ Configuration is controlled through the `Config` object. You can set configurati
- `BROWSE_CHUNK_MAX_LENGTH`: When browsing website, define the length of chunks to summarize. Default: 3000 - `BROWSE_CHUNK_MAX_LENGTH`: When browsing website, define the length of chunks to summarize. Default: 3000
- `BROWSE_SPACY_LANGUAGE_MODEL`: [spaCy language model](https://spacy.io/usage/models) to use when creating chunks. Default: en_core_web_sm - `BROWSE_SPACY_LANGUAGE_MODEL`: [spaCy language model](https://spacy.io/usage/models) to use when creating chunks. Default: en_core_web_sm
- `CHAT_MESSAGES_ENABLED`: Enable chat messages. Optional - `CHAT_MESSAGES_ENABLED`: Enable chat messages. Optional
- `DISABLED_COMMANDS`: Commands to disable. Use comma separated names of commands. See the list of commands from built-in components [here](../component%20agent/components.md). Default: None - `DISABLED_COMMANDS`: Commands to disable. Use comma separated names of commands. See the list of commands from built-in components [here](../components/components.md). Default: None
- `ELEVENLABS_API_KEY`: ElevenLabs API Key. Optional. - `ELEVENLABS_API_KEY`: ElevenLabs API Key. Optional.
- `ELEVENLABS_VOICE_ID`: ElevenLabs Voice ID. Optional. - `ELEVENLABS_VOICE_ID`: ElevenLabs Voice ID. Optional.
- `EMBEDDING_MODEL`: LLM Model to use for embedding tasks. Default: `text-embedding-3-small` - `EMBEDDING_MODEL`: LLM Model to use for embedding tasks. Default: `text-embedding-3-small`

View File

@@ -1,6 +1,6 @@
# AutoGPT Agent # AutoGPT Agent
[🔧 **Setup**](./setup) [🔧 **Setup**](setup/index.md)
 |   | 
[💻 **User guide**](./usage.md) [💻 **User guide**](./usage.md)
 |   | 

View File

@@ -191,4 +191,4 @@ docker run -it --env-file=.env -v $PWD:/app autogpt
docker run -it --env-file=.env -v $PWD:/app --rm autogpt --gpt3only --continuous docker run -it --env-file=.env -v $PWD:/app --rm autogpt --gpt3only --continuous
``` ```
[user guide]: /autogpt/usage/#command-line-interface [user guide]: ../usage.md/#command-line-interface

View File

@@ -46,7 +46,7 @@ Get your OpenAI API key from:
It's highly recommended that you keep track of your API costs on [the Usage page](https://platform.openai.com/account/usage). It's highly recommended that you keep track of your API costs on [the Usage page](https://platform.openai.com/account/usage).
You can also set limits on how much you spend on [the Usage limits page](https://platform.openai.com/account/billing/limits). You can also set limits on how much you spend on [the Usage limits page](https://platform.openai.com/account/billing/limits).
![For OpenAI API key to work, set up paid account at OpenAI API > Billing](/imgs/openai-api-key-billing-paid-account.png) ![For OpenAI API key to work, set up paid account at OpenAI API > Billing](../../imgs/openai-api-key-billing-paid-account.png)
## Setting up AutoGPT ## Setting up AutoGPT
@@ -58,8 +58,8 @@ Since we don't ship AutoGPT as a desktop application, you'll need to download th
![Screenshot of the dialog to clone or download the repo](get-repo-dialog.png) ![Screenshot of the dialog to clone or download the repo](get-repo-dialog.png)
* To get the latest bleeding edge version, use `master`. - To get the latest bleeding edge version, use `master`.
* If you're looking for more stability, check out the latest AutoGPT [release][releases]. - If you're looking for more stability, check out the latest AutoGPT [release][releases].
[project]: https://github.com/Significant-Gravitas/AutoGPT [project]: https://github.com/Significant-Gravitas/AutoGPT
[releases]: https://github.com/Significant-Gravitas/AutoGPT/releases [releases]: https://github.com/Significant-Gravitas/AutoGPT/releases

View File

@@ -1,9 +1,10 @@
## Share your logs with us to help improve AutoGPT # Share your logs with us to help improve AutoGPT
Do you notice weird behavior with your agent? Do you have an interesting use case? Do you have a bug you want to report? Do you notice weird behavior with your agent? Do you have an interesting use case? Do you have a bug you want to report?
Follow the steps below to enable your logs and upload them. You can include these logs when making an issue report or discussing an issue with us. Follow the steps below to enable your logs and upload them. You can include these logs when making an issue report or discussing an issue with us.
### Enable Debug Logs ## Enable Debug Logs
Activity, Error, and Debug logs are located in `./logs` Activity, Error, and Debug logs are located in `./logs`
To print out debug logs: To print out debug logs:
@@ -16,20 +17,19 @@ To print out debug logs:
docker-compose run --rm auto-gpt --debug # in Docker docker-compose run --rm auto-gpt --debug # in Docker
``` ```
### Inspect and share logs ## Inspect and share logs
You can inspect and share logs via [e2b](https://e2b.dev). You can inspect and share logs via [e2b](https://e2b.dev).
![E2b logs dashboard](./imgs/e2b-dashboard.png) ![E2b logs dashboard](../imgs/e2b-dashboard.png)
1. Go to [autogpt.e2b.dev](https://autogpt.e2b.dev) and sign in. 1. Go to [autogpt.e2b.dev](https://autogpt.e2b.dev) and sign in.
2. You'll see logs from other members of the AutoGPT team that you can inspect. 2. You'll see logs from other members of the AutoGPT team that you can inspect.
3. Or you upload your own logs. Click on the "Upload log folder" button and select the debug logs dir that you generated. Wait a 1-2 seconds and the page reloads. 3. Or you upload your own logs. Click on the "Upload log folder" button and select the debug logs dir that you generated. Wait a 1-2 seconds and the page reloads.
4. You can share logs via sharing the URL in your browser. 4. You can share logs via sharing the URL in your browser.
![E2b log URL](./imgs/e2b-log-url.png) ![E2b log URL](../imgs/e2b-log-url.png)
### Add tags to logs ### Add tags to logs
You can add custom tags to logs for other members of your team. This is useful if you want to indicate that the agent is for example having issues with challenges. You can add custom tags to logs for other members of your team. This is useful if you want to indicate that the agent is for example having issues with challenges.
E2b offers 3 types of severity: E2b offers 3 types of severity:
@@ -41,12 +41,13 @@ E2b offers 3 types of severity:
You can name your tag any way you want. You can name your tag any way you want.
#### How to add a tag #### How to add a tag
1. Click on the "plus" button on the left from the logs folder name. 1. Click on the "plus" button on the left from the logs folder name.
![E2b tag button](./imgs/e2b-tag-button.png) ![E2b tag button](../imgs/e2b-tag-button.png)
2. Type the name of a new tag. 1. Type the name of a new tag.
3. Select the severity. 1. Select the severity.
![E2b new tag](./imgs/e2b-new-tag.png) ![E2b new tag](../imgs/e2b-new-tag.png)

View File

@@ -227,5 +227,5 @@ For example, to disable python coding features, set it to the value below:
DISABLED_COMMANDS=execute_python_code,execute_python_file DISABLED_COMMANDS=execute_python_code,execute_python_file
``` ```
[components]: ./component%20agent/components.md [components]: ./components/components.md
[commands]: ./component%20agent/built-in-components.md [commands]: ./components/built-in-components.md

View File

@@ -1,5 +1,5 @@
# List of Challenges # List of Challenges
This page contains a curated list of challenges that AutoGPT currently faces. If you think you have a solution or idea to tackle any of these challenges, feel free to dive in and start working on them! New challenges can also be submitted by following the guidelines on the [Submit a Challenge](challenges/submit.md) page. This page contains a curated list of challenges that AutoGPT currently faces. If you think you have a solution or idea to tackle any of these challenges, feel free to dive in and start working on them! New challenges can also be submitted by following the guidelines on the [Submit a Challenge](./submit.md) page.
Memory Challenges: [List of Challenges](memory/introduction.md) Memory Challenges: [List of Challenges](memory/introduction.md)

View File

@@ -0,0 +1,48 @@
# Contributing to the Docs
We welcome contributions to our documentation! If you would like to contribute, please follow the steps below.
## Setting up the Docs
1. Clone the repository:
```shell
git clone github.com/Significant-Gravitas/AutoGPT.git
```
1. Install the dependencies:
```shell
python -m pip install -r docs/requirements.txt
```
or
```shell
python3 -m pip install -r docs/requirements.txt
```
1. Start iterating using mkdocs' live server:
```shell
mkdocs serve
```
1. Open your browser and navigate to `http://127.0.0.1:8000`.
1. The server will automatically reload the docs when you save your changes.
## Adding a new page
1. Create a new markdown file in the `docs/content` directory.
1. Add the new page to the `nav` section in the `mkdocs.yml` file.
1. Add the content to the new markdown file.
1. Run `mkdocs serve` to see your changes.
## Checking links
To check for broken links in the documentation, run `mkdocs build` and look for warnings in the console output.
## Submitting a Pull Request
When you're ready to submit your changes, please create a pull request. We will review your changes and merge them if they are appropriate.

View File

@@ -1,18 +1,20 @@
# AutoGPT Forge # AutoGPT Forge
### 🛠️ Build your own Agent 🛠️ ## 🛠️ Build your own Agent 🛠️
!!! warning !!! warning
If you are trying to use AutoGPT this is not the tutorial for you! You need to use [this one](../../AutoGPT/setup/) If you are trying to use AutoGPT this is not the tutorial for you! You need to use [this one](../AutoGPT/setup/index.md)
Forge is a ready-to-go template for *your* agent application. All the boilerplate code is already handled, letting you channel all your creativity into the things that set *your* agent apart. Forge is a ready-to-go template for *your* agent application. All the boilerplate code is already handled, letting you channel all your creativity into the things that set *your* agent apart.
--- ---
### 🛠️ **Why AutoGPT Forge?** ### 🛠️ **Why AutoGPT Forge?**
- 💤 **No More Boilerplate!** - Don't let the mundane tasks stop you. Fork and build without the headache of starting from scratch! - 💤 **No More Boilerplate!** - Don't let the mundane tasks stop you. Fork and build without the headache of starting from scratch!
- 🧠 **Brain-centric Development!** - All the tools you need so you can spend 100% of your time on what matters - crafting the brain of your AI! - 🧠 **Brain-centric Development!** - All the tools you need so you can spend 100% of your time on what matters - crafting the brain of your AI!
- 🛠️ **Tooling ecosystem!** - We work with the best in class tools to bring you the best experience possible! - 🛠️ **Tooling ecosystem!** - We work with the best in class tools to bring you the best experience possible!
--- ---
### 🚀 **Get Started!** ### 🚀 **Get Started!**
@@ -24,10 +26,8 @@ The getting started [tutorial series](https://aiedge.medium.com/autogpt-forge-e3
3. [AutoGPT Forge: Interacting with your Agent](https://aiedge.medium.com/autogpt-forge-interacting-with-your-agent-1214561b06b) 3. [AutoGPT Forge: Interacting with your Agent](https://aiedge.medium.com/autogpt-forge-interacting-with-your-agent-1214561b06b)
4. [AutoGPT Forge: Crafting Intelligent Agent Logic](https://medium.com/@aiedge/autogpt-forge-crafting-intelligent-agent-logic-bc5197b14cb4) 4. [AutoGPT Forge: Crafting Intelligent Agent Logic](https://medium.com/@aiedge/autogpt-forge-crafting-intelligent-agent-logic-bc5197b14cb4)
Coming soon: Coming soon:
5. Interacting with and Benchmarking your Agent 5. Interacting with and Benchmarking your Agent
6. Abilities 6. Abilities
7. The Planning Loop 7. The Planning Loop

View File

@@ -6,32 +6,42 @@ nav:
- Home: index.md - Home: index.md
- AutoGPT Agent: - AutoGPT Agent:
- Introduction: AutoGPT/index.md - Introduction: AutoGPT/index.md
- Setup: - Setup:
- Setting up AutoGPT: AutoGPT/setup/index.md - Setting up AutoGPT: AutoGPT/setup/index.md
- Set up with Docker: AutoGPT/setup/docker.md - Set up with Docker: AutoGPT/setup/docker.md
- Usage: AutoGPT/usage.md - For Developers: AutoGPT/setup/for-developers.md
- Plugins: AutoGPT/plugins.md - Configuration:
# - Configuration: - Options: AutoGPT/configuration/options.md
# - Options: AutoGPT/configuration/options.md - Search: AutoGPT/configuration/search.md
# - Search: AutoGPT/configuration/search.md - Voice: AutoGPT/configuration/voice.md
# - Memory: AutoGPT/configuration/memory.md - Image Generation: AutoGPT/configuration/imagegen.md
# - Voice: AutoGPT/configuration/voice.md - Components:
# - Image Generation: AutoGPT/configuration/imagegen.md - Introduction: AutoGPT/components/introduction.md
- Help us improve AutoGPT: - Agents: AutoGPT/components/agents.md
- Share your debug logs with us: AutoGPT/share-your-logs.md - Components: AutoGPT/components/components.md
- Contribution guide: contributing.md - Protocols: AutoGPT/components/protocols.md
- Running tests: AutoGPT/testing.md - Commands: AutoGPT/components/commands.md
- Code of Conduct: code-of-conduct.md - Built in Components: AutoGPT/components/built-in-components.md
- Creating Components: AutoGPT/components/creating-components.md
- Advanced: AutoGPT/components/advanced.md
- Usage: AutoGPT/usage.md
- Help us improve AutoGPT:
- Share your debug logs with us: AutoGPT/share-your-logs.md
- Contribution guide: contributing.md
- Running tests: AutoGPT/testing.md
- Code of Conduct: code-of-conduct.md
- Benchmark: - Benchmark:
- Readme: https://github.com/Significant-Gravitas/AutoGPT/blob/master/benchmark/README.md - Readme: https://github.com/Significant-Gravitas/AutoGPT/blob/master/benchmark/README.md
- Forge: - Forge:
- Introduction: forge/get-started.md - Introduction: forge/get-started.md
- Frontend: - Frontend:
- Readme: https://github.com/Significant-Gravitas/AutoGPT/blob/master/frontend/README.md - Readme: https://github.com/Significant-Gravitas/AutoGPT/blob/master/frontend/README.md
- Docs: docs/index.md
# - Challenges: # - Challenges:
# - Introduction: challenges/introduction.md # - Introduction: challenges/introduction.md
@@ -98,8 +108,8 @@ markdown_extensions:
- pymdownx.caret - pymdownx.caret
- pymdownx.details - pymdownx.details
- pymdownx.emoji: - pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight - pymdownx.highlight
- pymdownx.inlinehilite - pymdownx.inlinehilite
- pymdownx.keys - pymdownx.keys