From 7e6707e39d2b759ad4b8e9d76bd5e2e2c573e546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80?= <78488229+viktor138irk@users.noreply.github.com> Date: Mon, 11 May 2026 22:12:13 +0900 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B8=D0=BD=D1=82=D0=B5=D0=B3=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20OpenAI=20Responses=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/openai_client.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 backend/openai_client.py diff --git a/backend/openai_client.py b/backend/openai_client.py new file mode 100644 index 0000000..f36d192 --- /dev/null +++ b/backend/openai_client.py @@ -0,0 +1,15 @@ +from openai import OpenAI +import os + +client = OpenAI( + api_key=os.getenv('OPENAI_API_KEY') +) + + +async def ask_ai(prompt: str): + response = client.responses.create( + model='gpt-5', + input=prompt + ) + + return response.output_text