forked from victordibia/autogen-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli support and pip install via typer
- Loading branch information
1 parent
f67bb4c
commit 4aa0d62
Showing
2 changed files
with
98 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import typer | ||
import uvicorn | ||
import os | ||
from typing_extensions import Annotated | ||
|
||
app = typer.Typer() | ||
|
||
|
||
@app.command() | ||
def main(host: str = "127.0.0.1", | ||
port: int = 8081, | ||
workers: int = 1, | ||
reload: Annotated[bool, typer.Option("--reload")] = True, | ||
docs: bool = False): | ||
""" | ||
Launch the Autogen UI CLI .Pass in parameters host, port, workers, and reload to override the default values. | ||
""" | ||
|
||
os.environ["AUTOGENUI_API_DOCS"] = str(docs) | ||
|
||
uvicorn.run( | ||
"autogenui.web.app:app", | ||
host=host, | ||
port=port, | ||
workers=workers, | ||
reload=reload, | ||
) | ||
|
||
|
||
@app.command() | ||
def models(): | ||
print("A list of supported providers:") | ||
|
||
|
||
def run(): | ||
app() | ||
|
||
|
||
if __name__ == "__main__": | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[build-system] | ||
requires = ["setuptools", "setuptools-scm"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "autogenui" | ||
authors = [ | ||
{ name="Victor Dibia", email="[email protected]" }, | ||
] | ||
description = "autogen ui: a ui interface for the autogen library " | ||
readme = "README.md" | ||
license = { file="LICENSE" } | ||
requires-python = ">=3.9" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
|
||
dependencies = [ | ||
"pydantic", | ||
"fastapi", | ||
"uvicorn", | ||
] | ||
optional-dependencies = {web = ["fastapi", "uvicorn"]} | ||
|
||
dynamic = ["version"] | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "autogenui.version.VERSION"} | ||
readme = {file = ["README.md"]} | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["autogenui*"] | ||
exclude = ["*.tests*"] | ||
namespaces = false | ||
|
||
[tool.setuptools.package-data] | ||
"autogenui" = ["*.*"] | ||
|
||
[tool.pytest.ini_options] | ||
filterwarnings = [ | ||
"ignore:Deprecated call to `pkg_resources\\.declare_namespace\\('.*'\\):DeprecationWarning", | ||
"ignore::DeprecationWarning:google.rpc", | ||
] | ||
|
||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/victordibia/autogenui" | ||
"Bug Tracker" = "https://github.com/victordibia/autogenui/issues" | ||
|
||
[project.scripts] | ||
autogenui = "autogenui.cli:run" |