CopilotJ / data /copilotj /core /message.py
introvoyz045's picture
Migrated from GitHub
04f192c verified
Raw History Blame Contribute Delete
530 Bytes
# SPDX-FileCopyrightText: Copyright contributors to the CopilotJ project.
#
# SPDX-License-Identifier: Apache-2.0
from typing import Literal
import pydantic
__all__ = ["TextMessage", "ImageMessage", "HandoffMessage"]
class TextMessage(pydantic.BaseModel):
role: Literal["assistant", "system", "user"]
text: str
class ImageMessage(pydantic.BaseModel):
role: Literal["assistant", "system", "user"]
image: str
class HandoffMessage(pydantic.BaseModel):
target: str
message: TextMessage | ImageMessage