agiresearch / OpenAGI

OpenAGI: When LLM Meets Domain Experts
MIT License
1.82k stars 151 forks source link

feat: add tool calling for chatgpt-based math agent #50

Closed dongyuanjushi closed 1 month ago

dongyuanjushi commented 1 month ago
  1. add tool calling for chatgpt-based math agent
  2. refactor and wrap LLM request and LLM response, which can be found in utils.message.py.

Message object to wrap LLM request

class Message:
    def __init__(self,
            prompt, 
            context = None, 
            tools = None
        ) -> None:
        self.prompt = prompt
        self.context = context
        self.tools = tools

Response object to wrap LLM response

class Response:
    def __init__(
            self, 
            response_message,
            tool_calls = None
        ) -> None:
        self.response_message = response_message
        self.tool_calls = tool_calls