import gradio as gr # API で呼び出す関数 def chat_api(message, username, temperature): response = f"User: {username}, Message: {message}, Temperature: {temperature}" return response # Gradio のインターフェース gradio_interface = gr.Interface( fn=chat_api, # 関数 inputs=["text", "text", "number"], # 入力タイプ outputs="text" # 出力タイプ )