Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,11 @@ import panel as pn
|
|
9 |
pn.extension()
|
10 |
|
11 |
MODEL = "gpt-3.5-turbo"
|
12 |
-
query = "How do I trigger a function when clicking a button in Panel?"
|
13 |
|
14 |
|
15 |
def seek(contents, user, instance):
|
16 |
-
messages = instance.serialize()[1
|
17 |
-
rag_context = retrieve_context(
|
18 |
prompts = construct_prompt(
|
19 |
messages,
|
20 |
rag_context,
|
|
|
9 |
pn.extension()
|
10 |
|
11 |
MODEL = "gpt-3.5-turbo"
|
|
|
12 |
|
13 |
|
14 |
def seek(contents, user, instance):
|
15 |
+
messages = instance.serialize()[1:-1]
|
16 |
+
rag_context = retrieve_context(contents, k=1, openai_api_key=environ["OPENAI_API_KEY"])
|
17 |
prompts = construct_prompt(
|
18 |
messages,
|
19 |
rag_context,
|