LineChatbot / core /llm.py
raystermomo's picture
Deploy romance chat to Hugging Face Spaces
6cd1906
Raw
History Blame Contribute Delete
361 Bytes
'''
API呼び出し
'''
# core/llm.py
from openai import OpenAI
client = OpenAI()
def call_openai(system_prompt: str, context_prompt: str) -> str:
response = client.responses.create(
model="gpt-4.1-mini",
instructions=system_prompt,
input=context_prompt,
max_output_tokens=100,
)
return response.output_text.strip()