30 lines
740 B
Python
30 lines
740 B
Python
"""
|
|
This program has been developed by students from the bachelor Computer Science at Utrecht
|
|
University within the Software Project course.
|
|
© Copyright Utrecht University (Department of Information and Computing Sciences)
|
|
"""
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ChatMessage(BaseModel):
|
|
"""
|
|
Represents a single message in a conversation.
|
|
|
|
:ivar role: The role of the speaker (e.g., 'user', 'assistant').
|
|
:ivar content: The text content of the message.
|
|
"""
|
|
|
|
role: str
|
|
content: str
|
|
|
|
|
|
class ChatHistory(BaseModel):
|
|
"""
|
|
Represents a sequence of chat messages, forming a conversation history.
|
|
|
|
:ivar messages: An ordered list of :class:`ChatMessage` objects.
|
|
"""
|
|
|
|
messages: list[ChatMessage]
|