patharanor commited on
Commit
5b26209
·
1 Parent(s): 82c68b9

fix: request schema

Browse files
Files changed (2) hide show
  1. app.py +5 -4
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from http import HTTPStatus
2
  import os, io, base64
 
3
  import uvicorn
4
  import logging
5
  from fastapi import FastAPI, File, Form, HTTPException, Header, UploadFile
@@ -101,10 +102,10 @@ async def upload(
101
  async def upload2(
102
  x_request_user: str = Header(...),
103
  x_api_key: str = Header(...),
104
- job_no: str = Form(...),
105
- s3key: str = Form(...),
106
- ref: str = Form(...),
107
- file: UploadFile = File(...)
108
  ):
109
  res = Response()
110
  logging.info("--------------------------------")
 
1
  from http import HTTPStatus
2
  import os, io, base64
3
+ from typing_extensions import Annotated
4
  import uvicorn
5
  import logging
6
  from fastapi import FastAPI, File, Form, HTTPException, Header, UploadFile
 
102
  async def upload2(
103
  x_request_user: str = Header(...),
104
  x_api_key: str = Header(...),
105
+ job_no: Annotated[str, Form()] = '',
106
+ s3key: Annotated[str, Form()] = '',
107
+ ref: Annotated[str, Form()] = '',
108
+ file: Annotated[bytes, File()] = File(...)
109
  ):
110
  res = Response()
111
  logging.info("--------------------------------")
requirements.txt CHANGED
@@ -4,5 +4,6 @@ gradio
4
  pillow
5
  pydantic
6
  python-dotenv
 
7
  fastapi[standard]
8
  uvicorn
 
4
  pillow
5
  pydantic
6
  python-dotenv
7
+ python-multipart
8
  fastapi[standard]
9
  uvicorn