updated tokens maxed out message
Browse files
agents.py
CHANGED
|
@@ -69,7 +69,7 @@ def chatAgent(chat_message):
|
|
| 69 |
return output
|
| 70 |
|
| 71 |
|
| 72 |
-
def
|
| 73 |
output = ""
|
| 74 |
|
| 75 |
if is_magic(question_text, LOCAL_MAGIC_TOKENS):
|
|
@@ -90,7 +90,7 @@ def instructAgent(question_text, model_name):
|
|
| 90 |
output = response['output']
|
| 91 |
logger.info(f"🔹 Steps: {response['intermediate_steps']}")
|
| 92 |
except Exception as e:
|
| 93 |
-
output = "
|
| 94 |
logger.error(e)
|
| 95 |
|
| 96 |
return output
|
|
@@ -104,7 +104,7 @@ def salesAgent(instruction):
|
|
| 104 |
print("panda> " + output)
|
| 105 |
except Exception as e:
|
| 106 |
logger.error(e)
|
| 107 |
-
output = f"Rephrasing your prompt could get better results {e}"
|
| 108 |
return output
|
| 109 |
|
| 110 |
def chinookAgent(instruction, model_name):
|
|
|
|
| 69 |
return output
|
| 70 |
|
| 71 |
|
| 72 |
+
def agentController(question_text, model_name):
|
| 73 |
output = ""
|
| 74 |
|
| 75 |
if is_magic(question_text, LOCAL_MAGIC_TOKENS):
|
|
|
|
| 90 |
output = response['output']
|
| 91 |
logger.info(f"🔹 Steps: {response['intermediate_steps']}")
|
| 92 |
except Exception as e:
|
| 93 |
+
output = "Most likely ran out of tokens ..."
|
| 94 |
logger.error(e)
|
| 95 |
|
| 96 |
return output
|
|
|
|
| 104 |
print("panda> " + output)
|
| 105 |
except Exception as e:
|
| 106 |
logger.error(e)
|
| 107 |
+
output = f"Rephrasing your prompt could get better sales results {e}"
|
| 108 |
return output
|
| 109 |
|
| 110 |
def chinookAgent(instruction, model_name):
|
app.py
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
|
| 10 |
import streamlit as st
|
| 11 |
from pprint import pprint
|
| 12 |
-
from agents import
|
| 13 |
|
| 14 |
##############################################################################
|
| 15 |
|
|
@@ -64,7 +64,7 @@ if question_text and len(question_text) > 1:
|
|
| 64 |
else:
|
| 65 |
output = response
|
| 66 |
else:
|
| 67 |
-
output =
|
| 68 |
|
| 69 |
height = min(2*len(output), 280)
|
| 70 |
st.text_area(label="In response ...",
|
|
|
|
| 9 |
|
| 10 |
import streamlit as st
|
| 11 |
from pprint import pprint
|
| 12 |
+
from agents import agentController, salesAgent, chinookAgent, chatAgent
|
| 13 |
|
| 14 |
##############################################################################
|
| 15 |
|
|
|
|
| 64 |
else:
|
| 65 |
output = response
|
| 66 |
else:
|
| 67 |
+
output = agentController(question_text, option_llm)
|
| 68 |
|
| 69 |
height = min(2*len(output), 280)
|
| 70 |
st.text_area(label="In response ...",
|