@@ -237,6 +237,11 @@ class Chatgpt(SimpleService): ] messages.insert(0, {'role': 'system', 'content': system.content}) messages.insert(0, {'role': 'system', 'content': user_system_prompt}) + if image: + messages[-1]['content'] = [ + {'type': 'input_text', 'text': input_message.content}, + {'type': 'input_image', 'image_url': image_data['image_url']['url']} + ] json_data = { 'model': model_name, 'input': messages, @@ -394,7 +399,11 @@ class Chatgpt(SimpleService): if output_tokens == 0: output_tokens = self.count_text_tokens([response]) - if image and normalized_image and model_name not in ('o3-mini', 'gpt-4.5-preview'): + if ( + image + and normalized_image + and model_name not in ('o3-mini', 'gpt-4.5-preview', 'gpt-5', 'gpt-5-mini', 'gpt-5-nano') + ): self.logger.info(f'Input количество токенов БЕЗ картинки {model_name} - {input_tokens}') input_tokens += self.count_image_tokens(normalized_image.size, model_name)