Delete Message typed dict
This commit is contained in:
@@ -2,7 +2,6 @@ import json
|
||||
from typing import Dict
|
||||
|
||||
from jarvis.functional_modules.functional_module import CallerContext, moduleRegistry
|
||||
from jarvis.gpt.message import Message
|
||||
from jarvis.logger import logger
|
||||
|
||||
|
||||
@@ -16,21 +15,6 @@ def must_not_be_valid_json(s: str):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def create_chat_message(role, content) -> Message:
|
||||
"""
|
||||
Create a chat message with the given role and content.
|
||||
|
||||
Args:
|
||||
role (str): The role of the message sender, e.g., "system", "user", or "assistant".
|
||||
content (str): The content of the message.
|
||||
|
||||
Returns:
|
||||
dict: A dictionary containing the role and content of the message.
|
||||
"""
|
||||
return {"role": role, "content": content}
|
||||
|
||||
|
||||
def get_thoughts(reply: Dict, assistant_reply_json_valid: dict):
|
||||
assistant_thoughts_reasoning = None
|
||||
assistant_thoughts_speak = None
|
||||
|
||||
@@ -7,12 +7,10 @@ from typing import Dict, List
|
||||
from openai.error import RateLimitError
|
||||
|
||||
from jarvis import CFG
|
||||
from jarvis.ai_agent.agent_utils import must_not_be_valid_json, get_thoughts, get_function, execute_function, \
|
||||
create_chat_message
|
||||
from jarvis.ai_agent.agent_utils import must_not_be_valid_json, get_thoughts, get_function, execute_function
|
||||
from jarvis.ai_agent.base_agent import BaseAgent
|
||||
from jarvis.functional_modules.functional_module import CallerContext, moduleRegistry
|
||||
from jarvis.gpt import token_counter, gpt
|
||||
from jarvis.gpt.message import Message
|
||||
from jarvis.json_utils.json_fix_llm import fix_json_using_multiple_techniques
|
||||
from jarvis.json_utils.utilities import validate_json
|
||||
from jarvis.logger import logger
|
||||
@@ -74,7 +72,7 @@ you: {
|
||||
|
||||
class GptAgent(BaseAgent):
|
||||
_system_prompt: str
|
||||
_full_message_history: List[Message] = []
|
||||
_full_message_history: List[dict] = []
|
||||
_message_tokens: List[int] = []
|
||||
|
||||
def __init__(self, caller_context: CallerContext):
|
||||
|
||||
Reference in New Issue
Block a user