Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ async def start():
|
|
26 |
We can add some settings to our application to allow users to select the appropriate model, and more!
|
27 |
"""
|
28 |
cl.user_session.set("image_history", [{"role": "system", "content": "You are a helpful assistant. You are developed with GPT-4-vision-preview, if the user uploads an image, you have the ability to understand it."}])
|
29 |
-
|
30 |
settings = await cl.ChatSettings(
|
31 |
[
|
32 |
Select(
|
@@ -59,7 +59,7 @@ async def setup_agent(settings):
|
|
59 |
temperature=settings["Temperature"],
|
60 |
streaming=settings["Streaming"],
|
61 |
model=settings["Model"],
|
62 |
-
|
63 |
)
|
64 |
|
65 |
# We get our memory here, which is used to track the conversation history.
|
|
|
26 |
We can add some settings to our application to allow users to select the appropriate model, and more!
|
27 |
"""
|
28 |
cl.user_session.set("image_history", [{"role": "system", "content": "You are a helpful assistant. You are developed with GPT-4-vision-preview, if the user uploads an image, you have the ability to understand it."}])
|
29 |
+
cl.user_session.set("api_key", "sk-xxx")
|
30 |
settings = await cl.ChatSettings(
|
31 |
[
|
32 |
Select(
|
|
|
59 |
temperature=settings["Temperature"],
|
60 |
streaming=settings["Streaming"],
|
61 |
model=settings["Model"],
|
62 |
+
api_key=cl.user_session.get("api_key"),
|
63 |
)
|
64 |
|
65 |
# We get our memory here, which is used to track the conversation history.
|