Chris Alexiuk
commited on
Commit
·
056a8db
1
Parent(s):
225a8d6
Update app.py
Browse files
app.py
CHANGED
@@ -23,42 +23,14 @@ Think through your response step by step.
|
|
23 |
|
24 |
@cl.on_chat_start # marks a function that will be executed at the start of a user session
|
25 |
async def start_chat():
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
id="Model",
|
32 |
-
label="OpenAI - Model",
|
33 |
-
values=["gpt-3.5-turbo"],
|
34 |
-
initial_index=0,
|
35 |
-
),
|
36 |
-
Switch(id="Streaming", label="OpenAI - Stream Tokens", initial=True),
|
37 |
-
Slider(
|
38 |
-
id="Temperature",
|
39 |
-
label="OpenAI - Temperature",
|
40 |
-
initial=1,
|
41 |
-
min=0,
|
42 |
-
max=2,
|
43 |
-
step=0.1,
|
44 |
-
),
|
45 |
-
Slider(
|
46 |
-
id="Max Tokens",
|
47 |
-
label="OpenAI - Max Tokens",
|
48 |
-
initial=250,
|
49 |
-
min=100,
|
50 |
-
max=500,
|
51 |
-
step=10
|
52 |
-
)
|
53 |
-
]
|
54 |
-
).send()
|
55 |
|
56 |
cl.user_session.set("settings", settings)
|
57 |
|
58 |
-
@cl.on_settings_update # marks a function that "logs" settings update
|
59 |
-
async def setup_agent(settings):
|
60 |
-
print("on_settings_update", settings)
|
61 |
-
|
62 |
@cl.on_message # marks a function that should be run each time the chatbot receives a message from a user
|
63 |
async def main(message: str):
|
64 |
|
|
|
23 |
|
24 |
@cl.on_chat_start # marks a function that will be executed at the start of a user session
|
25 |
async def start_chat():
|
26 |
+
settings = {
|
27 |
+
"model" : "gpt-3.5-turbo",
|
28 |
+
"temperature" : 0.5,
|
29 |
+
"max_tokens" : 500,
|
30 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
cl.user_session.set("settings", settings)
|
33 |
|
|
|
|
|
|
|
|
|
34 |
@cl.on_message # marks a function that should be run each time the chatbot receives a message from a user
|
35 |
async def main(message: str):
|
36 |
|