-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ttpss930141011/development
Development
- Loading branch information
Showing
32 changed files
with
575 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
""" Flask PostgreSQL Process Handler | ||
""" | ||
|
||
|
||
from src.app.flask_postgresql.configs import Config | ||
from src.app.flask_postgresql.create_flask_postgresql_app import ( | ||
create_flask_postgresql_app, | ||
) | ||
from src.infrastructure.loggers.logger_default import LoggerDefault | ||
|
||
logger = LoggerDefault() | ||
|
||
from src.app.flask_postgresql.create_flask_postgresql_app import create_flask_postgresql_app | ||
|
||
if __name__ == "__main__": | ||
app = create_flask_postgresql_app(Config, logger) | ||
app = create_flask_postgresql_app(Config) | ||
app.run(host="0.0.0.0", port=Config.PORT, debug=True) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from flask import Flask, g | ||
from src.infrastructure.container.container import Container | ||
from src.infrastructure.repositories.agent_chain.agent_chain_in_memory_repository import ( | ||
AgentExecutorInMemoryRepository, | ||
) | ||
from src.infrastructure.repositories.window import WindowPostgresqlRepository | ||
from src.infrastructure.loggers.logger_default import LoggerDefault | ||
|
||
|
||
def setup_container(app: Flask) -> Flask: | ||
"""Setup Container for the app""" | ||
container = Container() | ||
|
||
container.register("agent_repository", AgentExecutorInMemoryRepository()) | ||
container.register("window_repository", WindowPostgresqlRepository()) | ||
container.register("logger", LoggerDefault()) | ||
|
||
app.config["container"] = container | ||
|
||
return app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Container: | ||
def __init__(self): | ||
self._dependencies = {} | ||
|
||
def register(self, key, dependency): | ||
self._dependencies[key] = dependency | ||
|
||
def resolve(self, key): | ||
return self._dependencies[key] | ||
|
||
def __getitem__(self, key): | ||
return self.resolve(key) | ||
|
||
def __setitem__(self, key, dependency): | ||
self.register(key, dependency) |
Oops, something went wrong.