Dmytro Bobrenko commited on
Commit
e842043
Β·
1 Parent(s): 65526b0

Move middlewares, schemas, utils to common module

Browse files
README.md CHANGED
@@ -124,11 +124,10 @@ Final JSON:
124
  ```
125
  After verifying that the server is responding to requests locally, you can test the server on a remote machine.
126
 
127
- ## Accessing OpenAPI Documentation
128
  To access OpenAPI documentation, go to:
129
  [http://localhost:10000/docs](http://localhost:10000/docs)
130
 
131
-
132
  ### Troubleshooting
133
 
134
  If you do not receive a response from the server, check that the server is running and that the port is open on the server. You can open the port using the following commands:
 
124
  ```
125
  After verifying that the server is responding to requests locally, you can test the server on a remote machine.
126
 
127
+ ## OpenAPI
128
  To access OpenAPI documentation, go to:
129
  [http://localhost:10000/docs](http://localhost:10000/docs)
130
 
 
131
  ### Troubleshooting
132
 
133
  If you do not receive a response from the server, check that the server is running and that the port is open on the server. You can open the port using the following commands:
common/__init__.py ADDED
File without changes
middlewares.py β†’ common/middlewares.py RENAMED
File without changes
schemas.py β†’ common/schemas.py RENAMED
File without changes
utils.py β†’ common/utils.py RENAMED
File without changes
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  git+https://github.com/opentensor/prompting.git@features/move-validator-into-prompting
2
  aiohttp
3
  deprecated
4
- aiohttp_apispec>=2.3.3
 
1
  git+https://github.com/opentensor/prompting.git@features/move-validator-into-prompting
2
  aiohttp
3
  deprecated
4
+ aiohttp_apispec>=2.3.3
server.py CHANGED
@@ -1,5 +1,5 @@
1
  import asyncio
2
- import utils
3
  import bittensor as bt
4
  from aiohttp import web
5
  from aiohttp_apispec import (
@@ -9,16 +9,16 @@ from aiohttp_apispec import (
9
  request_schema,
10
  response_schema,
11
  )
12
- from validators import S1ValidatorAPI, QueryValidatorParams, ValidatorAPI
13
- from middlewares import api_key_middleware, json_parsing_middleware
14
 
15
- from schemas import QueryValidatorParamsSchema, StreamChunkSchema, StreamErrorSchema
 
 
16
 
17
 
18
  @docs(
19
  tags=["Prompting API"],
20
- summary="Chat with the network",
21
- description="Chat endpoint for the validator.",
22
  )
23
  @request_schema(QueryValidatorParamsSchema)
24
  @response_schema(StreamChunkSchema, 200)
 
1
  import asyncio
2
+ import common.utils as utils
3
  import bittensor as bt
4
  from aiohttp import web
5
  from aiohttp_apispec import (
 
9
  request_schema,
10
  response_schema,
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 QueryValidatorParamsSchema, StreamChunkSchema, StreamErrorSchema
16
 
17
 
18
  @docs(
19
  tags=["Prompting API"],
20
+ summary="Chat",
21
+ description="Chat endpoint.",
22
  )
23
  @request_schema(QueryValidatorParamsSchema)
24
  @response_schema(StreamChunkSchema, 200)