Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def create_team(llm_config, primary_system_message, critic_system_message):
|
|
42 |
return team, model_client
|
43 |
|
44 |
# Function to stream the task through the workflow
|
45 |
-
async def async_stream_task(task_message, api_key, primary_system_message, critic_system_message):
|
46 |
# Start logging
|
47 |
logging_session_id = start(logger_type="file", config={"filename": LOG_FILE})
|
48 |
print(f"Logging session ID: {logging_session_id}")
|
@@ -84,13 +84,13 @@ async def async_stream_task(task_message, api_key, primary_system_message, criti
|
|
84 |
stop()
|
85 |
|
86 |
# Gradio interface function
|
87 |
-
async def chat_interface(api_key, primary_system_message, critic_system_message, task_message):
|
88 |
primary_messages = []
|
89 |
critic_messages = []
|
90 |
documentation_messages = []
|
91 |
|
92 |
# Append new messages while streaming
|
93 |
-
async for source, output in async_stream_task(task_message, api_key, primary_system_message, critic_system_message):
|
94 |
if source == "primary":
|
95 |
primary_messages.append(output)
|
96 |
elif source == "critic":
|
|
|
42 |
return team, model_client
|
43 |
|
44 |
# Function to stream the task through the workflow
|
45 |
+
async def async_stream_task(task_message, api_key, primary_system_message, critic_system_message, documentation_system_message):
|
46 |
# Start logging
|
47 |
logging_session_id = start(logger_type="file", config={"filename": LOG_FILE})
|
48 |
print(f"Logging session ID: {logging_session_id}")
|
|
|
84 |
stop()
|
85 |
|
86 |
# Gradio interface function
|
87 |
+
async def chat_interface(api_key, primary_system_message, critic_system_message, documentation_system_message, task_message):
|
88 |
primary_messages = []
|
89 |
critic_messages = []
|
90 |
documentation_messages = []
|
91 |
|
92 |
# Append new messages while streaming
|
93 |
+
async for source, output in async_stream_task(task_message, api_key, primary_system_message, critic_system_message, documentation_system_message):
|
94 |
if source == "primary":
|
95 |
primary_messages.append(output)
|
96 |
elif source == "critic":
|