File size: 395 Bytes
07716a4
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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"  # 出力タイプ
)