Skip to content

Commit

Permalink
chore: set status code appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Sep 23, 2024
1 parent f6a3718 commit 107d655
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server/api/debug/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from litestar import Controller, post
from litestar.response import ServerSentEvent
from litestar.status_codes import HTTP_200_OK

from server.features.chat.types import Message
from server.schemas.v1 import Benchmark, Query
Expand All @@ -17,7 +18,7 @@ class LLMController(Controller):

path = '/llm'

@post(sync_to_thread=True)
@post(status_code=HTTP_200_OK, sync_to_thread=True)
def generate(self, state: AppState, data: Query) -> ServerSentEvent:
"""
Summary
Expand Down
3 changes: 2 additions & 1 deletion server/api/v1/files_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
from litestar.enums import RequestEncodingType
from litestar.params import Body
from litestar.response import ServerSentEvent
from litestar.status_codes import HTTP_200_OK

from server.features.extraction import file_to_text


@post('/files/text')
@post('/files/text', status_code=HTTP_200_OK)
async def files_to_text(
data: Annotated[list[UploadFile], Body(media_type=RequestEncodingType.MULTI_PART)],
) -> ServerSentEvent:
Expand Down

0 comments on commit 107d655

Please sign in to comment.