mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 06:24:20 +01:00
Remove excessive debug text
This commit is contained in:
@@ -30,19 +30,16 @@ class Config(metaclass=Singleton):
|
|||||||
# TODO - make these models be self-contained, using langchain, so we can configure them once and call it good
|
# TODO - make these models be self-contained, using langchain, so we can configure them once and call it good
|
||||||
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
|
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
|
||||||
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
|
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
|
||||||
|
|
||||||
|
# TODO: Make this not so hard-coded
|
||||||
|
# This is the token limit that the main prompt needs to know. GPT-4 has a much bigger limit than GPT-3
|
||||||
|
if (self.smart_llm_model.startswith("gpt-3")):
|
||||||
self.thinking_token_limit = 4000
|
self.thinking_token_limit = 4000
|
||||||
# Initialize the OpenAI API client
|
else:
|
||||||
|
self.thinking_token_limit = 6000
|
||||||
|
|
||||||
self.openai_api_key = os.getenv("OPENAI_API_KEY")
|
self.openai_api_key = os.getenv("OPENAI_API_KEY")
|
||||||
self.elevenlabs_api_key = os.getenv("ELEVENLABS_API_KEY")
|
self.elevenlabs_api_key = os.getenv("ELEVENLABS_API_KEY")
|
||||||
# Print values:
|
|
||||||
print("Config values:")
|
|
||||||
print(f"continuous_mode: {self.continuous_mode}")
|
|
||||||
print(f"speak_mode: {self.speak_mode}")
|
|
||||||
print(f"fast_llm_model: {self.fast_llm_model}")
|
|
||||||
print(f"smart_llm_model: {self.smart_llm_model}")
|
|
||||||
print(f"thinking_token_limit: {self.thinking_token_limit}")
|
|
||||||
print(f"openai_api_key: {self.openai_api_key}")
|
|
||||||
print(f"elevenlabs_api_key: {self.elevenlabs_api_key}")
|
|
||||||
|
|
||||||
# Initialize the OpenAI API client
|
# Initialize the OpenAI API client
|
||||||
openai.api_key = self.openai_api_key
|
openai.api_key = self.openai_api_key
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def fix_and_parse_json(json_str: str, try_to_fix_with_gpt: bool = True):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
# TODO: Make debug a global config var
|
# TODO: Make debug a global config var
|
||||||
def fix_json(json_str: str, schema:str = None, debug=True) -> str:
|
def fix_json(json_str: str, schema:str = None, debug=False) -> str:
|
||||||
# Try to fix the JSON using gpt:
|
# Try to fix the JSON using gpt:
|
||||||
function_string = "def fix_json(json_str: str, schema:str=None) -> str:"
|
function_string = "def fix_json(json_str: str, schema:str=None) -> str:"
|
||||||
args = [json_str, schema]
|
args = [json_str, schema]
|
||||||
@@ -44,10 +44,9 @@ def fix_json(json_str: str, schema:str = None, debug=True) -> str:
|
|||||||
try:
|
try:
|
||||||
return dirtyjson.loads(result_string)
|
return dirtyjson.loads(result_string)
|
||||||
except:
|
except:
|
||||||
# Log the exception:
|
|
||||||
print("Failed to fix JSON")
|
|
||||||
# Get the call stack:
|
# Get the call stack:
|
||||||
import traceback
|
import traceback
|
||||||
call_stack = traceback.format_exc()
|
call_stack = traceback.format_exc()
|
||||||
print(call_stack)
|
# TODO: Handle this sort of thing better
|
||||||
|
print(f"Failed to fix JSON: '{json_str}' "+call_stack)
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
Reference in New Issue
Block a user