Spaces:
Runtime error
Runtime error
Update app.py
Browse files1234567891011121314151617import gradio as grimport osfrom gradio import ChatMessagetry:from groq import Groqexcept ImportError:os.system('pip install groq')from groq import Groq# 從環境變數中獲取 API 密鑰api_key = os.getenv("groq_key")# 初始化 groq 客戶端client = Groq(api_key)# 定義回應函數def respond(message, chat_history):1234567891011121314import gradio as grimport osfrom groq import Groqfrom gradio import ChatMessage# 從環境變數中獲取 API 密鑰api_key = os.getenv("groq_key")# 初始化 groq 客戶端client = Groq()client.set_api_key(api_key)# 定義回應函數def respond(message, chat_history):
app.py+4-7