mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* docs(docs): start implementing docs website * update video url * add autogenerated codebase docs for backend * precommit * update links * fix config and video * gh actions * rename * workdirs * path * path * fix doc1 * redo markdown * docs * change main folder name * simplify readme * add back architecture * Fix lint errors * lint * update poetry lock --------- Co-authored-by: Jim Su <jimsu@protonmail.com>
35 lines
792 B
Markdown
35 lines
792 B
Markdown
---
|
|
sidebar_label: parser
|
|
title: agenthub.SWE_agent.parser
|
|
---
|
|
|
|
#### get\_action\_from\_string
|
|
|
|
```python
|
|
def get_action_from_string(command_string: str,
|
|
path: str,
|
|
line: int,
|
|
thoughts: str = '') -> Action | None
|
|
```
|
|
|
|
Parses the command string to find which command the agent wants to run
|
|
Converts the command into a proper Action and returns
|
|
|
|
#### parse\_command
|
|
|
|
```python
|
|
def parse_command(input_str: str, path: str, line: int)
|
|
```
|
|
|
|
Parses a given string and separates the command (enclosed in triple backticks) from any accompanying text.
|
|
|
|
**Arguments**:
|
|
|
|
- `input_str` _str_ - The input string to be parsed.
|
|
|
|
|
|
**Returns**:
|
|
|
|
- `tuple` - A tuple containing the command and the accompanying text (if any).
|
|
|