This commit is contained in:
T-BENZIN 2025-06-28 11:46:31 +05:00
parent 89300e74e5
commit 43e073cbd1

View File

@ -3,26 +3,6 @@ from openai import OpenAI
client = OpenAI() client = OpenAI()
SUPPORTED_IMAGE_EXTENSIONS = ('.png', '.jpg', '.jpeg', '.webp', '.gif') SUPPORTED_IMAGE_EXTENSIONS = ('.png', '.jpg', '.jpeg', '.webp', '.gif')
# response = client.responses.create(
# model="gpt-4.1-mini",
# input=[{
# "role": "user",
# "content": [
# {"type": "input_text", "text": "Что на этих картинках и в этом PDF файле?"},
# {
# "type": "input_image",
# "image_url": "https://cdn.discordapp.com/attachments/1381924995994882150/1388385230108360855/2a264d9a62e7420586ee7873f53552d7.webp?ex=6860ca01&is=685f7881&hm=e8e21d0829cc9be3a21f63cb8f0c5065bf76c1de3952dbb524640694dd5037be&'>, <Attachment id=1388385230582321253 filename='",
# },
# {
# "type": "input_image",
# "image_url": "https://cdn.discordapp.com/attachments/1381924995994882150/1388385230582321253/u_312c5f5306d0913c58dd0639fe493bdd_800.png?ex=6860ca01&is=685f7881&hm=d0ebcfaecc2e69551da0cdefdf88c3833f8cbd59d04b035b787ea3150382bdd2&'>",
# },
# ],
# }],
# )
#
# print(response.output_text)
async def image_recognition(content: str, files: list[dict[str: str]]) -> str: async def image_recognition(content: str, files: list[dict[str: str]]) -> str:
input_data = [{'type': 'input_text', 'text': content}] input_data = [{'type': 'input_text', 'text': content}]