Spaces:
Runtime error
Runtime error
Commit ·
2bbcd59
1
Parent(s): 771ecb7
Cleaning up debug logs
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ client = OpenAI()
|
|
| 16 |
load_dotenv()
|
| 17 |
|
| 18 |
|
| 19 |
-
system_prompt = "You are the LivePlan Assistant, embedded in LivePlan by Palo Alto Software. You combine the speed, flexibility, and sophistication of various AI models with over 40+ years of extensive business planning expertise. You address many of the challenges LivePlan customers share around what makes business planning difficult, and ensures their business plans are the best that they can be."
|
| 20 |
assistant = client.beta.assistants.create(
|
| 21 |
model="gpt-3.5-turbo-1106",
|
| 22 |
# model="gpt-4-1106-preview"
|
|
@@ -148,7 +148,7 @@ with gr.Blocks(theme=LivePlanTheme(), css=CSS) as demo:
|
|
| 148 |
user_info = f"Use this data when making function calls. Note: all of these should be used directly without modification, never generated: {json.dumps(user_info, indent=2)}"
|
| 149 |
instructions = f"{system_prompt}\n\n{user_info}"
|
| 150 |
print("Creating run")
|
| 151 |
-
print(instructions)
|
| 152 |
run = client.beta.threads.runs.create(
|
| 153 |
thread_id=thread.id,
|
| 154 |
assistant_id=assistant.id,
|
|
@@ -219,7 +219,7 @@ with gr.Blocks(theme=LivePlanTheme(), css=CSS) as demo:
|
|
| 219 |
msg, chatbot], js=get_user_info)
|
| 220 |
|
| 221 |
def init_thread(message: gr.Textbox, chat_history: gr.Chatbot, user_info) -> gr.JSON:
|
| 222 |
-
print(user_info)
|
| 223 |
check_secret_key(user_info["secret_key"])
|
| 224 |
global thread
|
| 225 |
# FIXME: Danger - this is insecure because we don't verify the user
|
|
@@ -227,7 +227,7 @@ with gr.Blocks(theme=LivePlanTheme(), css=CSS) as demo:
|
|
| 227 |
# history
|
| 228 |
thread = retrieve_or_create_thread(
|
| 229 |
user_info["user_uuid"], user_info["company_uuid"])
|
| 230 |
-
print(thread)
|
| 231 |
return get_messages(chat_history), user_info
|
| 232 |
|
| 233 |
demo.load(init_thread, [msg, chatbot, user_info],
|
|
|
|
| 16 |
load_dotenv()
|
| 17 |
|
| 18 |
|
| 19 |
+
system_prompt = "You are the LivePlan Assistant, embedded in LivePlan by Palo Alto Software. You combine the speed, flexibility, and sophistication of various AI models with over 40+ years of extensive business planning expertise. You address many of the challenges LivePlan customers share around what makes business planning difficult, and ensures their business plans are the best that they can be. Use Markdown formatting to style your text."
|
| 20 |
assistant = client.beta.assistants.create(
|
| 21 |
model="gpt-3.5-turbo-1106",
|
| 22 |
# model="gpt-4-1106-preview"
|
|
|
|
| 148 |
user_info = f"Use this data when making function calls. Note: all of these should be used directly without modification, never generated: {json.dumps(user_info, indent=2)}"
|
| 149 |
instructions = f"{system_prompt}\n\n{user_info}"
|
| 150 |
print("Creating run")
|
| 151 |
+
# print(instructions)
|
| 152 |
run = client.beta.threads.runs.create(
|
| 153 |
thread_id=thread.id,
|
| 154 |
assistant_id=assistant.id,
|
|
|
|
| 219 |
msg, chatbot], js=get_user_info)
|
| 220 |
|
| 221 |
def init_thread(message: gr.Textbox, chat_history: gr.Chatbot, user_info) -> gr.JSON:
|
| 222 |
+
# print(user_info)
|
| 223 |
check_secret_key(user_info["secret_key"])
|
| 224 |
global thread
|
| 225 |
# FIXME: Danger - this is insecure because we don't verify the user
|
|
|
|
| 227 |
# history
|
| 228 |
thread = retrieve_or_create_thread(
|
| 229 |
user_info["user_uuid"], user_info["company_uuid"])
|
| 230 |
+
# print(thread)
|
| 231 |
return get_messages(chat_history), user_info
|
| 232 |
|
| 233 |
demo.load(init_thread, [msg, chatbot, user_info],
|