mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-10 01:34:22 +01:00
Refine prompt to reduce unnecessary browsing and open_file use
This commit is contained in:
@@ -29,7 +29,8 @@ def agent_implements_context(agent: BaseAgent) -> bool:
|
||||
|
||||
@command(
|
||||
"open_file",
|
||||
"Open a file for editing, creating it if it does not exist yet",
|
||||
"Open a file for editing, creating it if it does not exist yet."
|
||||
" Note: if you only need to read or write a file once, use `write_to_file` instead.",
|
||||
{
|
||||
"file_path": {
|
||||
"type": "string",
|
||||
|
||||
@@ -58,4 +58,4 @@ class Command:
|
||||
f"{param.name}: {param.type if param.required else f'Optional[{param.type}]'}"
|
||||
for param in self.parameters
|
||||
]
|
||||
return f"{self.name}: {self.description}. Params: ({', '.join(params)})"
|
||||
return f"{self.name}: {self.description.rstrip('.')}. Params: ({', '.join(params)})"
|
||||
|
||||
@@ -53,7 +53,7 @@ class PromptGenerator:
|
||||
params_string = ", ".join(
|
||||
f'"{key}": "{value}"' for key, value in self.params.items()
|
||||
)
|
||||
return f'{self.label}: "{self.name}". Params: ({params_string})'
|
||||
return f'{self.label}: "{self.name.rstrip(".")}". Params: ({params_string})'
|
||||
|
||||
def add_constraint(self, constraint: str) -> None:
|
||||
"""
|
||||
|
||||
@@ -6,10 +6,12 @@ constraints: [
|
||||
resources: [
|
||||
'Internet access for searches and information gathering.',
|
||||
'The ability to read and write files.',
|
||||
'You are a Large Language Model, trained on millions of pages of text, including a lot of factual knowledge. Make use of this factual knowledge to avoid unnecessary gathering of information.'
|
||||
]
|
||||
best_practices: [
|
||||
'Continuously review and analyze your actions to ensure you are performing to the best of your abilities.',
|
||||
'Constructively self-criticize your big-picture behavior constantly.',
|
||||
'Reflect on past decisions and strategies to refine your approach.',
|
||||
'Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps.'
|
||||
'Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps.',
|
||||
'Only make use of your information gathering abilities to find information that you don''t yet have knowledge of.'
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user