Add OS Info into the initial prompt (#2587)

pull/1243/head
Mikel Calvo 2023-04-21 21:44:02 +02:00 committed by GitHub
parent a2e16695af
commit 9dcdb6d6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -5,9 +5,11 @@ A module that contains the AIConfig class object that contains the configuration
from __future__ import annotations
import os
import platform
from pathlib import Path
from typing import Optional, Type
import distro
import yaml
from autogpt.prompts.generator import PromptGenerator
@ -130,6 +132,17 @@ class AIConfig:
continue
prompt_generator = plugin.post_prompt(prompt_generator)
if cfg.execute_local_commands:
# add OS info to prompt
os_name = platform.system()
os_info = (
platform.platform(terse=True)
if os_name != "Linux"
else distro.name(pretty=True)
)
prompt_start += f"\nThe OS you are running on is: {os_info}"
# Construct full prompt
full_prompt = f"You are {prompt_generator.name}, {prompt_generator.role}\n{prompt_start}\n\nGOALS:\n\n"
for i, goal in enumerate(self.ai_goals):

View File

@ -1,5 +1,6 @@
beautifulsoup4>=4.12.2
colorama==0.4.6
distro==1.8.0
openai==0.27.2
playsound==1.2.2
python-dotenv==1.0.0