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,8 +1,11 @@
### 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):
![](../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.
If it's necessary to get a component in a random place, agent provides generic, type safe `get_component(type[T]) -> T | None`
If it's necessary to get a component in a random place, agent provides generic, type safe `get_component(type[T]) -> T | None`

View File

@@ -34,4 +34,4 @@ class MyAgent(Agent):
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.
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.
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`
@@ -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.
1. Create a class for the component that inherits from `CommandProvider`.
```py
class MyUserInteractionComponent(CommandProvider):
"""Provides commands to interact with the user."""
pass
```
```py
class MyUserInteractionComponent(CommandProvider):
"""Provides commands to interact with the user."""
pass
```
2. Implement command method that will ask user for input and return it.
```py
def ask_user(self, question: str) -> str:
"""If you need more details or information regarding the given goals,
you can ask the user for input."""
print(f"\nQ: {question}")
resp = input("A:")
return f"The user's answer: '{resp}'"
```
```py
def ask_user(self, question: str) -> str:
"""If you need more details or information regarding the given goals,
you can ask the user for input."""
print(f"\nQ: {question}")
resp = input("A:")
return f"The user's answer: '{resp}'"
```
3. The command needs to be decorated with `@command`.
```py
@command(
parameters={
"question": JSONSchema(
type=JSONSchema.Type.STRING,
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,
you can ask the user for input."""
print(f"\nQ: {question}")
resp = input("A:")
return f"The user's answer: '{resp}'"
```
```py
@command(
parameters={
"question": JSONSchema(
type=JSONSchema.Type.STRING,
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,
you can ask the user for input."""
print(f"\nQ: {question}")
resp = input("A:")
return f"The user's answer: '{resp}'"
```
4. We need to implement `CommandProvider`'s `get_commands` method to yield the command.
```py
def get_commands(self) -> Iterator[Command]:
yield self.ask_user
```
```py
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.
```py
def __init__(self, config: Config):
self.config = config
self._enabled = not config.noninteractive_mode
```
```py
def __init__(self, config: Config):
self.config = config
self._enabled = not config.noninteractive_mode
```
The final component should look like this:
@@ -228,7 +233,7 @@ class MyAgent(Agent):
## 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)
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_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
- `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_VOICE_ID`: ElevenLabs Voice ID. Optional.
- `EMBEDDING_MODEL`: LLM Model to use for embedding tasks. Default: `text-embedding-3-small`

View File

@@ -1,6 +1,6 @@
# AutoGPT Agent
[🔧 **Setup**](./setup)
[🔧 **Setup**](setup/index.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
```
[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).
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
@@ -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)
* To get the latest bleeding edge version, use `master`.
* If you're looking for more stability, check out the latest AutoGPT [release][releases].
- To get the latest bleeding edge version, use `master`.
- If you're looking for more stability, check out the latest AutoGPT [release][releases].
[project]: https://github.com/Significant-Gravitas/AutoGPT
[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?
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`
To print out debug logs:
@@ -16,20 +17,19 @@ To print out debug logs:
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).
![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.
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.
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
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:
@@ -41,12 +41,13 @@ E2b offers 3 types of severity:
You can name your tag any way you want.
#### How to add a tag
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
```
[components]: ./component%20agent/components.md
[commands]: ./component%20agent/built-in-components.md
[components]: ./components/components.md
[commands]: ./components/built-in-components.md