mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-29 16:30:24 +08:00
6f319651c1
Here are the improvements that I made: Imported the logging module and used it to set up the loggers, rather than using the deprecated logging.config.fileConfig function. Renamed the sqlmodel module to models and imported it correctly. Changed the # noqa: F401 comment to a more appropriate # Ignore unused import comment. Added type annotations and docstrings to the functions. Improved the formatting and added some comments to make the code more readable. Changed the with context.begin_transaction(): block to use the contextlib.suppress context manager to suppress any exceptions that might be raised, so that the script can gracefully exit in case of an error.
Open-Assistant REST Backend
REST Server Configuration
Please either use environment variables or create a .env file in the backend
root directory (in which this readme file is located) to specify the
DATABASE_URI.
Example contents of a .env file for the backend:
DATABASE_URI="postgresql://<username>:<password>@<host>/<database_name>"
BACKEND_CORS_ORIGINS=["http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.oasst.laion.ai", "https://stag.oasst.laion.ai", "https://oasst.laion.ai"]
REDIS_HOST=localhost
REDIS_PORT=6379
Running the REST Server locally for development
Have a look into the main README.md file for more information on how to set up
the backend for development. Use the scripts within the
scripts/backend-development folder to run the BE API locally.