Skip to content

Commit

Permalink
Merge branch 'master' into fix-prompt-settings.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
waynehamadi committed Jun 13, 2023
2 parents 7ce8909 + 857c330 commit 7035dab
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 727 deletions.
13 changes: 9 additions & 4 deletions autogpt/agent/agent.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import signal
import sys
from datetime import datetime
Expand All @@ -7,8 +8,7 @@
from autogpt.commands.command import CommandRegistry
from autogpt.config import Config
from autogpt.config.ai_config import AIConfig
from autogpt.json_utils.json_fix_llm import fix_json_using_multiple_techniques
from autogpt.json_utils.utilities import LLM_DEFAULT_RESPONSE_FORMAT, validate_json
from autogpt.json_utils.utilities import extract_json_from_response, validate_json
from autogpt.llm.base import ChatSequence
from autogpt.llm.chat import chat_with_ai, create_chat_completion
from autogpt.llm.providers.openai import OPEN_AI_CHAT_MODELS
Expand Down Expand Up @@ -144,15 +144,20 @@ def signal_handler(signum, frame):
self.config.fast_llm_model,
)

assistant_reply_json = fix_json_using_multiple_techniques(assistant_reply)
try:
assistant_reply_json = extract_json_from_response(assistant_reply)
validate_json(assistant_reply_json)
except json.JSONDecodeError as e:
logger.error(f"Exception while validating assistant reply JSON: {e}")
assistant_reply_json = {}

for plugin in self.config.plugins:
if not plugin.can_handle_post_planning():
continue
assistant_reply_json = plugin.post_planning(assistant_reply_json)

# Print Assistant thoughts
if assistant_reply_json != {}:
validate_json(assistant_reply_json, LLM_DEFAULT_RESPONSE_FORMAT)
# Get command name and arguments
try:
print_assistant_thoughts(
Expand Down
2 changes: 1 addition & 1 deletion autogpt/commands/execute_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from pathlib import Path

import docker
from confection import Config
from docker.errors import ImageNotFound

from autogpt.agent.agent import Agent
from autogpt.commands.command import command
from autogpt.config import Config
from autogpt.logs import logger
from autogpt.setup import CFG
from autogpt.workspace.workspace import Workspace
Expand Down
121 changes: 0 additions & 121 deletions autogpt/json_utils/json_fix_general.py

This file was deleted.

0 comments on commit 7035dab

Please sign in to comment.