fixed salesAgent bug
Browse files
agents.py
CHANGED
|
@@ -127,16 +127,19 @@ def bookAgent(query):
|
|
| 127 |
def agentController(question_text, model_name):
|
| 128 |
output = ""
|
| 129 |
|
|
|
|
| 130 |
if is_magic(question_text, LOCAL_MAGIC_TOKENS):
|
| 131 |
output = salesAgent(question_text)
|
| 132 |
print(f"๐น salesAgent: {output}")
|
| 133 |
elif is_magic(question_text, DIGITAL_MAGIC_TOKENS):
|
| 134 |
output = chinookAgent(question_text, model_name)
|
| 135 |
print(f"๐น chinookAgent: {output}")
|
|
|
|
| 136 |
elif semantically_similar(question_text, "fight a war"):
|
| 137 |
output = bookAgent(question_text)
|
| 138 |
print(f"๐น bookAgent: {output}")
|
| 139 |
elif semantically_similar(question_text, "how to govern"):
|
|
|
|
| 140 |
output = bookAgent(question_text)
|
| 141 |
print(f"๐น bookAgent: {output}")
|
| 142 |
else: # reasoning agents
|
|
|
|
| 127 |
def agentController(question_text, model_name):
|
| 128 |
output = ""
|
| 129 |
|
| 130 |
+
# deterministic
|
| 131 |
if is_magic(question_text, LOCAL_MAGIC_TOKENS):
|
| 132 |
output = salesAgent(question_text)
|
| 133 |
print(f"๐น salesAgent: {output}")
|
| 134 |
elif is_magic(question_text, DIGITAL_MAGIC_TOKENS):
|
| 135 |
output = chinookAgent(question_text, model_name)
|
| 136 |
print(f"๐น chinookAgent: {output}")
|
| 137 |
+
# semantic similarity search
|
| 138 |
elif semantically_similar(question_text, "fight a war"):
|
| 139 |
output = bookAgent(question_text)
|
| 140 |
print(f"๐น bookAgent: {output}")
|
| 141 |
elif semantically_similar(question_text, "how to govern"):
|
| 142 |
+
# for illustration: use same bookAgent -- should/could be something else
|
| 143 |
output = bookAgent(question_text)
|
| 144 |
print(f"๐น bookAgent: {output}")
|
| 145 |
else: # reasoning agents
|
models.py
CHANGED
|
@@ -86,7 +86,7 @@ def load_sales_agent(verbose=True):
|
|
| 86 |
'''
|
| 87 |
Hard-coded agent that gates an internal sales CSV file for demo
|
| 88 |
'''
|
| 89 |
-
chat = createLLM(
|
| 90 |
df = pd.read_csv("data/sales_data.csv")
|
| 91 |
agent = create_pandas_dataframe_agent(chat, df, verbose=verbose)
|
| 92 |
return agent
|
|
|
|
| 86 |
'''
|
| 87 |
Hard-coded agent that gates an internal sales CSV file for demo
|
| 88 |
'''
|
| 89 |
+
chat = createLLM(model_name='text-davinci-003')
|
| 90 |
df = pd.read_csv("data/sales_data.csv")
|
| 91 |
agent = create_pandas_dataframe_agent(chat, df, verbose=verbose)
|
| 92 |
return agent
|