Spaces:
Runtime error
Runtime error
Upload bot.py
Browse files
bot.py
CHANGED
@@ -63,7 +63,25 @@ def load_bot(
|
|
63 |
|
64 |
# === Bot Runners ===
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
def run_local(
|
69 |
about_me: str,
|
|
|
63 |
|
64 |
# === Bot Runners ===
|
65 |
|
66 |
+
@financial_bot.rest_api(keep_warm_seconds=300, loader=load_bot)
|
67 |
+
def run(**inputs):
|
68 |
+
"""
|
69 |
+
Run the bot under the Beam RESTful API endpoint.
|
70 |
+
|
71 |
+
Args:
|
72 |
+
inputs (dict): A dictionary containing the following keys:
|
73 |
+
- context: The bot instance.
|
74 |
+
- about_me (str): Information about the user.
|
75 |
+
- question (str): The user's question.
|
76 |
+
- history (list): A list of previous conversations (optional).
|
77 |
|
78 |
+
Returns:
|
79 |
+
str: The bot's response to the user's question.
|
80 |
+
"""
|
81 |
+
|
82 |
+
response = _run(**inputs)
|
83 |
+
|
84 |
+
return response
|
85 |
|
86 |
def run_local(
|
87 |
about_me: str,
|