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>
50 lines
1.0 KiB
Markdown
50 lines
1.0 KiB
Markdown
---
|
|
sidebar_label: prompt
|
|
title: agenthub.planner_agent.prompt
|
|
---
|
|
|
|
#### get\_hint
|
|
|
|
```python
|
|
def get_hint(latest_action_id: str) -> str
|
|
```
|
|
|
|
Returns action type hint based on given action_id
|
|
|
|
#### get\_prompt
|
|
|
|
```python
|
|
def get_prompt(plan: Plan, history: List[Tuple[Action, Observation]]) -> str
|
|
```
|
|
|
|
Gets the prompt for the planner agent.
|
|
Formatted with the most recent action-observation pairs, current task, and hint based on last action
|
|
|
|
**Arguments**:
|
|
|
|
- plan (Plan): The original plan outlined by the user with LLM defined tasks
|
|
- history (List[Tuple[Action, Observation]]): List of corresponding action-observation pairs
|
|
|
|
|
|
**Returns**:
|
|
|
|
- str: The formatted string prompt with historical values
|
|
|
|
#### parse\_response
|
|
|
|
```python
|
|
def parse_response(response: str) -> Action
|
|
```
|
|
|
|
Parses the model output to find a valid action to take
|
|
|
|
**Arguments**:
|
|
|
|
- response (str): A response from the model that potentially contains an Action.
|
|
|
|
|
|
**Returns**:
|
|
|
|
- Action: A valid next action to perform from model output
|
|
|