refactor: Make Agent Protocol server DB URL configurable
- Refactor the `run_auto_gpt_server` function to make the Agent Protocol server database URL configurable. - Use the `os.getenv` method to retrieve the database URL from the environment variable `AP_SERVER_DB_URL`.pull/6461/head
parent
ca6e9e5e34
commit
99fe114502
|
@ -2,6 +2,7 @@
|
|||
import enum
|
||||
import logging
|
||||
import math
|
||||
import os
|
||||
import re
|
||||
import signal
|
||||
import sys
|
||||
|
@ -342,7 +343,7 @@ async def run_auto_gpt_server(
|
|||
config.plugins = scan_plugins(config)
|
||||
|
||||
# Set up & start server
|
||||
database = AgentDB("sqlite:///data/ap_server.db", debug_enabled=False)
|
||||
database = AgentDB(os.getenv("AP_SERVER_DB_URL", "sqlite:///data/ap_server.db"))
|
||||
server = AgentProtocolServer(
|
||||
app_config=config, database=database, llm_provider=llm_provider
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue