Spaces:
Sleeping
Sleeping
Dmytro Bobrenko
commited on
Commit
·
151d1dc
1
Parent(s):
60fe698
Sort imports
Browse files
server.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import asyncio
|
| 2 |
-
import common.utils as utils
|
| 3 |
import bittensor as bt
|
| 4 |
from aiohttp import web
|
| 5 |
from aiohttp_apispec import (
|
|
@@ -11,6 +10,7 @@ from aiohttp_apispec import (
|
|
| 11 |
)
|
| 12 |
|
| 13 |
from validators import S1ValidatorAPI, QueryValidatorParams, ValidatorAPI
|
|
|
|
| 14 |
from common.middlewares import api_key_middleware, json_parsing_middleware
|
| 15 |
from common.schemas import QueryChatSchema, StreamChunkSchema, StreamErrorSchema
|
| 16 |
|
|
@@ -18,7 +18,7 @@ from common.schemas import QueryChatSchema, StreamChunkSchema, StreamErrorSchema
|
|
| 18 |
@docs(
|
| 19 |
tags=["Prompting API"],
|
| 20 |
summary="Chat",
|
| 21 |
-
description="Chat endpoint."
|
| 22 |
)
|
| 23 |
@request_schema(QueryChatSchema)
|
| 24 |
@response_schema(StreamChunkSchema, 200)
|
|
@@ -37,7 +37,7 @@ async def chat(request: web.Request) -> web.StreamResponse:
|
|
| 37 |
@docs(
|
| 38 |
tags=["Prompting API"],
|
| 39 |
summary="Echo test",
|
| 40 |
-
description="Echo endpoint for testing purposes."
|
| 41 |
)
|
| 42 |
@request_schema(QueryChatSchema)
|
| 43 |
@response_schema(StreamChunkSchema, 200)
|
|
|
|
| 1 |
import asyncio
|
|
|
|
| 2 |
import bittensor as bt
|
| 3 |
from aiohttp import web
|
| 4 |
from aiohttp_apispec import (
|
|
|
|
| 10 |
)
|
| 11 |
|
| 12 |
from validators import S1ValidatorAPI, QueryValidatorParams, ValidatorAPI
|
| 13 |
+
from common import utils
|
| 14 |
from common.middlewares import api_key_middleware, json_parsing_middleware
|
| 15 |
from common.schemas import QueryChatSchema, StreamChunkSchema, StreamErrorSchema
|
| 16 |
|
|
|
|
| 18 |
@docs(
|
| 19 |
tags=["Prompting API"],
|
| 20 |
summary="Chat",
|
| 21 |
+
description="Chat endpoint."
|
| 22 |
)
|
| 23 |
@request_schema(QueryChatSchema)
|
| 24 |
@response_schema(StreamChunkSchema, 200)
|
|
|
|
| 37 |
@docs(
|
| 38 |
tags=["Prompting API"],
|
| 39 |
summary="Echo test",
|
| 40 |
+
description="Echo endpoint for testing purposes."
|
| 41 |
)
|
| 42 |
@request_schema(QueryChatSchema)
|
| 43 |
@response_schema(StreamChunkSchema, 200)
|