Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
samholt committed Apr 22, 2024
1 parent 18999ef commit 264afbf
Show file tree
Hide file tree
Showing 31 changed files with 405 additions and 2,377 deletions.
58 changes: 58 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# API

## `run_l2mac`

Generate output based on the input prompt for specified domain and settings.

**Parameters:**

- `prompt_task` (str): The input prompt to generate, such as 'Create a playable snake game in PyGame'.
- `domain` (Domain): Domain to generate. Existing options are 'codebase', 'book'. Default is 'codebase'.
- `run_tests` (bool): Whether to run self-generated unit-tests when generating code. Default is `False`.
- `project_name` (Optional[str]): Unique project name, such as 'snakegame'.
- `steps` (int): Number of internal steps to use when creating the prompt program internally. Default is 10.
- `prompt_program` (Optional[str]): Path to the prompt program to use, or the prompt program as a string in list format.
- `prompts_file_path` (Optional[str]): Overrides the existing prompts to be used. Useful when creating a new prompt set for a new task.
- `tools_enabled` (Optional[str]): List of functions that the agents can use, separated by commas. Defaults to use all tools available.
- `debugging_level` (DebuggingLevel): Whether to print full context-windows out. Default is `info`.
- `init_config` (bool): Initialize the configuration file for L2MAC. Default is `False`.

**Examples:**

```bash
python core.py run_l2mac --prompt_task "Create a simple blog in Django" --domain codebase
```

Equivalent python code.

```python
from l2mac import run_l2mac, Domain

code = run_l2mac("Create a beautiful, playable and simple snake game with pygame. Make the snake and food be aligned to the same 10-pixel grid.", domain=Domain.codebase)
```

### Utility Functions

#### `generate_codebase`

Helper function to generate output specifically for codebase domain.

#### `generate_book`

Helper function to generate output specifically for book domain.

#### `generate_custom`

Helper function to generate output for custom domains as specified.

## Configuration

To manage configurations, modify the configuration files located at `config/config.yaml`. Initial setup can be triggered using the `--init_config` flag when running commands.

## Logging

Logging is handled via the `l2mac.utils.logging` module. Logs are stored in the specified directory `logs` in the local folder as per the configuration file.

## Error Handling

Errors are logged with detailed stack traces to assist in debugging. Errors during the generation process are captured and logged, with partial outputs stored if possible.
4 changes: 2 additions & 2 deletions docs/guide/faq.md β†’ docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Our vision is to 10x human efficiency on completing tasks, through providing a detailed and
Our vision empowers users to achieve 10x more with AI. The LLM Automatic Computer Framework (L2MAC) transforms cutting-edge LLMs into user-directed, reusable, and efficient AI assistants capable of autonomously executing complex real-world tasks, revolutionizing productivity and code generation.

### Convenient Link for Sharing this Document:

```
- MetaGPT-Index/FAQ-EN https://github.com/geekan/MetaGPT/blob/main/docs/FAQ-EN.md
- FAQ https://github.com/geekan/MetaGPT/blob/main/docs/FAQ-EN.md
- MetaGPT-Index/FAQ-CN https://deepwisdom.feishu.cn/wiki/MsGnwQBjiif9c3koSJNcYaoSnu4
```

Expand Down
3 changes: 0 additions & 3 deletions docs/guide/api.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/guide/get_started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

## Others (Optional)

Check [config.example.yaml](https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml) and
[config2.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/config.py) for more details.
Check [config.yaml](https://github.com/samholt/L2MAC/blob/master/config/config.yaml) and
[config.py](https://github.com/samholt/L2MAC/blob/master/l2mac/config.py) for more details.
32 changes: 16 additions & 16 deletions docs/guide/get_started/configuration/llm_api_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@ After installation, follow these steps to configure the LLM API, using the OpenA

2. **Edit Configuration**:

- Update `~/.l2mac/config.yaml` according to the [example](https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml) and [configuration code](https://github.com/geekan/MetaGPT/blob/main/metagpt/config2.py):
- Update `~/.l2mac/config.yaml` according to the [example](https://github.com/samholt/L2MAC/blob/master/config/config.yaml) and [configuration code](https://github.com/samholt/L2MAC/blob/master/l2mac/config.py):

```yaml
llm:
api_type: 'openai' # or azure etc. Check LLMType for more options
model: 'gpt-4-turbo-preview' # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
base_url: 'https://api.openai.com/v1' # or forward url / other llm url
api_key: 'YOUR_API_KEY'
api_type: "openai" # or azure etc. Check ApiType for more options
model: "gpt-4-turbo-preview" # or "gpt-4-turbo"
base_url: "https://api.openai.com/v1" # or forward url / other llm url
api_key: "YOUR_API_KEY"
```
> **Note**:
> Configuration priority is `~/.l2mac/config.yaml > config/config.yaml`.

With these steps, your setup is complete. To start with L2MAC, check out the [Quickstart guide](/guide/get_started/quickstart) or our [Tutorials](/guide/tutorials/concepts).

MetaGPT supports a range of LLM models. Configure your model API keys as needed.
L2MAC supports a range of LLM models. Configure your model API keys as needed.


## Azure OpenAI API
## OpenAI API

Check [llm_config.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/configs/llm_config.py)
Check [config.py](https://github.com/samholt/L2MAC/blob/master/l2mac/config.py)

```yaml
llm:
api_type: 'azure'
base_url: 'YOUR_AZURE_BASE_URL'
api_key: 'YOUR_API_KEY'
api_version: 'YOUR_API_VERSION'
api_type: 'openai'
model: 'YOUR_MODEL_NAME'
base_url: 'YOUR_BASE_URL'
api_key: 'YOUR_API_KEY'
```

## OpenAI API
## Azure OpenAI API

Check [llm_config.py](https://github.com/geekan/MetaGPT/blob/main/metagpt/configs/llm_config.py)
Check [config.py](https://github.com/samholt/L2MAC/blob/master/l2mac/config.py)

```yaml
llm:
api_type: 'openai'
api_type: 'azure'
model: 'YOUR_MODEL_NAME'
base_url: 'OPENAI_BASE_URL'
base_url: 'YOUR_AZURE_BASE_URL'
api_version: 'YOUR_API_VERSION'
api_key: 'YOUR_API_KEY'
```
2 changes: 0 additions & 2 deletions docs/guide/get_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ You may expect a similar output to that shown in [CodeBase Generator](../use_cas
β”‚ --tools-enabled TEXT List of functions that the agents can use, separated by commas. Defaults to use all tools available. [default: None] β”‚
β”‚ --debugging-level [debug|info|warn|error] Whether to print full context-windows out. [default: info] β”‚
β”‚ --init-config --no-init-config Initialize the configuration file for L2MAC. [default: no-init-config] β”‚
β”‚ --install-completion Install completion for the current shell. β”‚
β”‚ --show-completion Show completion for the current shell, to copy it or customize the installation. β”‚
β”‚ --help Show this message and exit. β”‚
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```
3 changes: 0 additions & 3 deletions docs/guide/in_depth_guides/agent_communication.md

This file was deleted.

Loading

0 comments on commit 264afbf

Please sign in to comment.