ahuang11 commited on
Commit
895af89
1 Parent(s): e32e90e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -56,8 +56,10 @@ fig
56
 
57
 
58
  async def callback(content: str, user: str, instance: pn.chat.ChatInterface):
59
- api_key = "eONhYm3inwx5qRfSiuSw9ryj45kyZblJ"
60
- client = MistralAsyncClient(api_key=api_key)
 
 
61
 
62
  # system
63
  messages = [SYSTEM_MESSAGE]
 
56
 
57
 
58
  async def callback(content: str, user: str, instance: pn.chat.ChatInterface):
59
+ if not api_key_input.value:
60
+ yield "Please first enter your Mistral API key"
61
+ return
62
+ client = MistralAsyncClient(api_key=api_key_input.value)
63
 
64
  # system
65
  messages = [SYSTEM_MESSAGE]