-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove old openapi.json spec * add autogenerated file to gitignore * script to generate openai.json spec * add HTTP API sub section in reference section
- Loading branch information
Showing
6 changed files
with
71 additions
and
3 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
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,61 @@ | ||
|
||
|
||
|
||
from functools import partial | ||
from multiprocessing import Process | ||
|
||
from inference.core.cache import cache | ||
from inference.core.interfaces.http.http_api import HttpInterface | ||
from inference.core.interfaces.stream_manager.manager_app.app import start | ||
from inference.core.managers.active_learning import ( | ||
ActiveLearningManager, | ||
BackgroundTaskActiveLearningManager, | ||
) | ||
from inference.core.managers.base import ModelManager | ||
from inference.core.managers.decorators.fixed_size_cache import WithFixedSizeCache | ||
from inference.core.registries.roboflow import ( | ||
RoboflowModelRegistry, | ||
) | ||
|
||
|
||
from inference.models.utils import ROBOFLOW_MODEL_TYPES | ||
|
||
|
||
|
||
model_registry = RoboflowModelRegistry(ROBOFLOW_MODEL_TYPES) | ||
|
||
|
||
model_manager = ModelManager(model_registry=model_registry) | ||
|
||
model_manager = WithFixedSizeCache(model_manager, max_size=1) | ||
model_manager.init_pingback() | ||
interface = HttpInterface(model_manager) | ||
app = interface.app | ||
|
||
|
||
|
||
|
||
from fastapi.openapi.utils import get_openapi | ||
import json | ||
import os | ||
|
||
DOCS_ROOT_DIR = os.path.abspath( | ||
os.path.join( | ||
os.path.dirname(__file__), | ||
"..", | ||
"..", | ||
"docs", | ||
) | ||
) | ||
|
||
filename = os.path.join(DOCS_ROOT_DIR, "openapi.json") | ||
|
||
with open(filename, 'w') as f: | ||
json.dump(get_openapi( | ||
title=app.title, | ||
version=app.version, | ||
openapi_version=app.openapi_version, | ||
description=app.description, | ||
routes=app.routes, | ||
|
||
), f) |
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,5 +1,5 @@ | ||
The Roboflow Inference Server provides OpenAPI documentation at the `/docs` endpoint for use in development. | ||
When the Inference Server is running, it provides OpenAPI documentation at the `/docs` endpoint for use in development. | ||
|
||
Below is the OpenAPI specification for the Inference Server, rendered with Swagger. | ||
Below is the OpenAPI specification for the Inference Server for the current release version. | ||
|
||
<swagger-ui src="./openapi.json"/> |
This file was deleted.
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