mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-09 00:04:31 +01:00
Merge branch 'master' into fix/default-config
This commit is contained in:
@@ -79,7 +79,7 @@ def main(
|
||||
from autogpt.logs import logger
|
||||
from autogpt.memory import get_memory
|
||||
from autogpt.prompt import construct_prompt
|
||||
from autogpt.utils import get_latest_bulletin
|
||||
from autogpt.utils import get_current_git_branch, get_latest_bulletin
|
||||
|
||||
if ctx.invoked_subcommand is None:
|
||||
cfg = Config()
|
||||
@@ -105,6 +105,14 @@ def main(
|
||||
motd = get_latest_bulletin()
|
||||
if motd:
|
||||
logger.typewriter_log("NEWS: ", Fore.GREEN, motd)
|
||||
git_branch = get_current_git_branch()
|
||||
if git_branch and git_branch != "stable":
|
||||
logger.typewriter_log(
|
||||
"WARNING: ",
|
||||
Fore.RED,
|
||||
f"You are running on `{git_branch}` branch "
|
||||
"- this is not a supported branch.",
|
||||
)
|
||||
system_prompt = construct_prompt()
|
||||
# print(prompt)
|
||||
# Initialize variables
|
||||
|
||||
@@ -145,7 +145,7 @@ class Config(metaclass=Singleton):
|
||||
else:
|
||||
return ""
|
||||
|
||||
AZURE_CONFIG_FILE = os.path.join(os.path.dirname(__file__), "..", "azure.yaml")
|
||||
AZURE_CONFIG_FILE = os.path.join(os.path.dirname(__file__), "../..", "azure.yaml")
|
||||
|
||||
def load_azure_config(self, config_file: str = AZURE_CONFIG_FILE) -> None:
|
||||
"""
|
||||
@@ -168,7 +168,7 @@ class Config(metaclass=Singleton):
|
||||
self.openai_api_version = (
|
||||
config_params.get("azure_api_version") or "2023-03-15-preview"
|
||||
)
|
||||
self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", [])
|
||||
self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", {})
|
||||
|
||||
def set_continuous_mode(self, value: bool) -> None:
|
||||
"""Set the continuous mode value."""
|
||||
|
||||
@@ -62,7 +62,7 @@ def summarize_text(
|
||||
print(f"Text length: {text_length} characters")
|
||||
|
||||
summaries = []
|
||||
chunks = list(split_text(text))
|
||||
chunks = list(split_text(text, CFG.browse_chunk_max_length))
|
||||
scroll_ratio = 1 / len(chunks)
|
||||
|
||||
for i, chunk in enumerate(chunks):
|
||||
|
||||
@@ -85,7 +85,6 @@ def get_prompt() -> str:
|
||||
{"code": "<full_code_string>", "focus": "<list_of_focus_areas>"},
|
||||
),
|
||||
("Execute Python File", "execute_python_file", {"file": "<file>"}),
|
||||
("Task Complete (Shutdown)", "task_complete", {"reason": "<reason>"}),
|
||||
("Generate Image", "generate_image", {"prompt": "<prompt>"}),
|
||||
("Send Tweet", "send_tweet", {"text": "<text>"}),
|
||||
]
|
||||
|
||||
@@ -3,6 +3,7 @@ import os
|
||||
import requests
|
||||
import yaml
|
||||
from colorama import Fore
|
||||
from git import Repo
|
||||
|
||||
|
||||
def clean_input(prompt: str = ""):
|
||||
@@ -53,6 +54,15 @@ def get_bulletin_from_web() -> str:
|
||||
return ""
|
||||
|
||||
|
||||
def get_current_git_branch() -> str:
|
||||
try:
|
||||
repo = Repo(search_parent_directories=True)
|
||||
branch = repo.active_branch
|
||||
return branch.name
|
||||
except:
|
||||
return ""
|
||||
|
||||
|
||||
def get_latest_bulletin() -> str:
|
||||
exists = os.path.exists("CURRENT_BULLETIN.md")
|
||||
current_bulletin = ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
azure_api_type: azure_ad
|
||||
azure_api_type: azure
|
||||
azure_api_base: your-base-url-for-azure
|
||||
azure_api_version: api-version-for-azure
|
||||
azure_model_map:
|
||||
|
||||
@@ -27,7 +27,6 @@ flake8
|
||||
numpy
|
||||
pre-commit
|
||||
black
|
||||
sourcery
|
||||
isort
|
||||
gitpython==3.1.31
|
||||
|
||||
|
||||
Reference in New Issue
Block a user