Update main.py
Browse files
main.py
CHANGED
|
@@ -145,8 +145,12 @@ details = {
|
|
| 145 |
def image_detail(detail_id: int = Path(None, description="The ID of 1.model id and 2.sampler id", gt=0, lt=3)):
|
| 146 |
return details[detail_id]
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
@app.post("/test")
|
| 150 |
-
def test(request:
|
| 151 |
-
return {'data': f'Prompt is {request.prompt} Model is {request.model}'}
|
| 152 |
|
|
|
|
| 145 |
def image_detail(detail_id: int = Path(None, description="The ID of 1.model id and 2.sampler id", gt=0, lt=3)):
|
| 146 |
return details[detail_id]
|
| 147 |
|
| 148 |
+
class Test(BaseModel):
|
| 149 |
+
prompt: str
|
| 150 |
+
model: str = 'gpt-3.5-turbo'
|
| 151 |
+
neg: str = False
|
| 152 |
|
| 153 |
@app.post("/test")
|
| 154 |
+
def test(request: Test):
|
| 155 |
+
return {'data': f'Prompt is {request.prompt} Model is {request.model} Neg is {request.neg}'}
|
| 156 |
|