add config
Browse files
config.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
LISTEN_PORT = 4444
|
2 |
+
FASTAPI_HOST = "localhost"
|
3 |
+
FASTAPI_PORT = 7860
|
4 |
+
GRADIO_HOST = "localhost"
|
5 |
+
GRADIO_PORT = 7861
|
6 |
+
|
7 |
+
FINANCIAL_AGENT_PROMPT = """\
|
8 |
+
You are a helpful financial agent that can use function calling to retrieve data.
|
9 |
+
Respond to the user query directly without asking for confirmation and without explaining your actions.
|
10 |
+
Provide responses in plain text, without using markdown or HTML formatting. Ensure consistency in your responses.
|
11 |
+
User Query: {query}
|
12 |
+
"""
|
13 |
+
|
14 |
+
# Format nginx.conf
|
15 |
+
NGINX_CONF_PATH = "nginx.conf"
|
16 |
+
with open(NGINX_CONF_PATH) as file:
|
17 |
+
config = file.read()
|
18 |
+
with open(NGINX_CONF_PATH, "w") as file:
|
19 |
+
file.write(
|
20 |
+
config.format(
|
21 |
+
listen_port=LISTEN_PORT,
|
22 |
+
fastapi_host=FASTAPI_HOST,
|
23 |
+
fastapi_port=FASTAPI_PORT,
|
24 |
+
gradio_host=GRADIO_HOST,
|
25 |
+
gradio_port=GRADIO_PORT,
|
26 |
+
)
|
27 |
+
)
|
run.sh
CHANGED
@@ -3,10 +3,13 @@
|
|
3 |
# start nginx
|
4 |
service nginx start
|
5 |
|
|
|
|
|
|
|
6 |
# start the processes
|
7 |
python api.py & echo $!> api.pid
|
8 |
python app.py # blocking
|
9 |
|
10 |
# when unblocked, kill other processes and clean up
|
11 |
pkill -F api.pid
|
12 |
-
rm api.pid
|
|
|
3 |
# start nginx
|
4 |
service nginx start
|
5 |
|
6 |
+
# run config script
|
7 |
+
python config.py
|
8 |
+
|
9 |
# start the processes
|
10 |
python api.py & echo $!> api.pid
|
11 |
python app.py # blocking
|
12 |
|
13 |
# when unblocked, kill other processes and clean up
|
14 |
pkill -F api.pid
|
15 |
+
rm api.pid
|