Skip to content

Commit 52233df

Browse files
committed
Merge branch 'master' into fix/default-config
2 parents 8581ee2 + 1f3cd21 commit 52233df

File tree

8 files changed

+27
-11
lines changed

8 files changed

+27
-11
lines changed

README.md

+4-4
Large diffs are not rendered by default.

autogpt/cli.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def main(
7979
from autogpt.logs import logger
8080
from autogpt.memory import get_memory
8181
from autogpt.prompt import construct_prompt
82-
from autogpt.utils import get_latest_bulletin
82+
from autogpt.utils import get_current_git_branch, get_latest_bulletin
8383

8484
if ctx.invoked_subcommand is None:
8585
cfg = Config()
@@ -105,6 +105,14 @@ def main(
105105
motd = get_latest_bulletin()
106106
if motd:
107107
logger.typewriter_log("NEWS: ", Fore.GREEN, motd)
108+
git_branch = get_current_git_branch()
109+
if git_branch and git_branch != "stable":
110+
logger.typewriter_log(
111+
"WARNING: ",
112+
Fore.RED,
113+
f"You are running on `{git_branch}` branch "
114+
"- this is not a supported branch.",
115+
)
108116
system_prompt = construct_prompt()
109117
# print(prompt)
110118
# Initialize variables

autogpt/config/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_azure_deployment_id_for_model(self, model: str) -> str:
145145
else:
146146
return ""
147147

148-
AZURE_CONFIG_FILE = os.path.join(os.path.dirname(__file__), "..", "azure.yaml")
148+
AZURE_CONFIG_FILE = os.path.join(os.path.dirname(__file__), "../..", "azure.yaml")
149149

150150
def load_azure_config(self, config_file: str = AZURE_CONFIG_FILE) -> None:
151151
"""
@@ -168,7 +168,7 @@ def load_azure_config(self, config_file: str = AZURE_CONFIG_FILE) -> None:
168168
self.openai_api_version = (
169169
config_params.get("azure_api_version") or "2023-03-15-preview"
170170
)
171-
self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", [])
171+
self.azure_model_to_deployment_id_map = config_params.get("azure_model_map", {})
172172

173173
def set_continuous_mode(self, value: bool) -> None:
174174
"""Set the continuous mode value."""

autogpt/processing/text.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def summarize_text(
6262
print(f"Text length: {text_length} characters")
6363

6464
summaries = []
65-
chunks = list(split_text(text))
65+
chunks = list(split_text(text, CFG.browse_chunk_max_length))
6666
scroll_ratio = 1 / len(chunks)
6767

6868
for i, chunk in enumerate(chunks):

autogpt/prompt.py

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def get_prompt() -> str:
8585
{"code": "<full_code_string>", "focus": "<list_of_focus_areas>"},
8686
),
8787
("Execute Python File", "execute_python_file", {"file": "<file>"}),
88-
("Task Complete (Shutdown)", "task_complete", {"reason": "<reason>"}),
8988
("Generate Image", "generate_image", {"prompt": "<prompt>"}),
9089
("Send Tweet", "send_tweet", {"text": "<text>"}),
9190
]

autogpt/utils.py

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import requests
44
import yaml
55
from colorama import Fore
6+
from git import Repo
67

78

89
def clean_input(prompt: str = ""):
@@ -53,6 +54,15 @@ def get_bulletin_from_web() -> str:
5354
return ""
5455

5556

57+
def get_current_git_branch() -> str:
58+
try:
59+
repo = Repo(search_parent_directories=True)
60+
branch = repo.active_branch
61+
return branch.name
62+
except:
63+
return ""
64+
65+
5666
def get_latest_bulletin() -> str:
5767
exists = os.path.exists("CURRENT_BULLETIN.md")
5868
current_bulletin = ""

azure.yaml.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
azure_api_type: azure_ad
1+
azure_api_type: azure
22
azure_api_base: your-base-url-for-azure
33
azure_api_version: api-version-for-azure
44
azure_model_map:

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ flake8
2727
numpy
2828
pre-commit
2929
black
30-
sourcery
3130
isort
3231
gitpython==3.1.31
3332

0 commit comments

Comments
 (0)