Source code for dronebuddylib.models.conversation

from typing import List, Dict


[docs] class Conversation: """ This class represents a conversation with the ChatGPT model. It stores the conversation history in the form of a list of messages. """ def __init__(self): self.conversation_history: List[Dict] = []
[docs] def add_message(self, role, content): message = {"role": role, "content": content} self.conversation_history.append(message)