From bfe22e40ee2077f9be093103ad189a4027bfa162 Mon Sep 17 00:00:00 2001 From: T-BENZIN Date: Sat, 5 Jul 2025 18:14:49 +0500 Subject: [PATCH] First attempt at making openai stuff pretty. As it uses replies instead of completions, update of openai library is required. --- reginaldCog/openai/content_builder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reginaldCog/openai/content_builder.py b/reginaldCog/openai/content_builder.py index f4ac300..cc18a04 100644 --- a/reginaldCog/openai/content_builder.py +++ b/reginaldCog/openai/content_builder.py @@ -48,6 +48,10 @@ class InputImage(Content): image_url: str = field(default=None) file_id: str = field(default=None) + def __post_init__(self): + if self.image_url is None and self.file_id is None: + raise ValueError("Either 'image_url' or 'file_id' must be provided.") + @dataclass class UrlCitation(Content):