Skip to content

Commit 7bc291c

Browse files
committed
configure http server running
1 parent e7e309f commit 7bc291c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

autointent/server/http.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class Settings(BaseSettings):
1919

2020
model_config = SettingsConfigDict(env_file=".env", env_prefix="AUTOINTENT_")
2121
path: str = Field(..., description="Path to the optimized pipeline assets")
22+
host: str = "127.0.0.1"
23+
port: int = 8013
2224

2325

2426
class PredictRequest(BaseModel):
@@ -98,3 +100,15 @@ async def predict(request: PredictRequest) -> PredictResponse:
98100
predictions = current_pipeline.predict(request.utterances)
99101

100102
return PredictResponse(predictions=predictions)
103+
104+
105+
def main() -> None:
106+
"""Main entry point for the HTTP server."""
107+
import uvicorn
108+
109+
uvicorn.run(
110+
"autointent.server.http:app",
111+
host=settings.host,
112+
port=settings.port,
113+
reload=False,
114+
)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Documentation = "https://deeppavlov.github.io/AutoIntent/"
117117
"basic-aug" = "autointent.generation.utterances.basic.cli:main"
118118
"evolution-aug" = "autointent.generation.utterances.evolution.cli:main"
119119
"autointent-mcp" = "autointent.server.mcp:main"
120+
"autointent-http" = "autointent.server.http:main"
120121

121122
[tool.ruff]
122123
line-length = 120

0 commit comments

Comments
 (0)