Spaces:
Sleeping
Sleeping
Patrick Walukagga
commited on
Commit
·
1ca62db
1
Parent(s):
6c0d7ee
update api
Browse files- api.py +2 -2
- commands.md +1 -1
api.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import logging
|
2 |
import os
|
3 |
from enum import Enum
|
4 |
-
from typing import List, Optional
|
5 |
|
6 |
from dotenv import load_dotenv
|
7 |
from fastapi import FastAPI, HTTPException
|
@@ -50,7 +50,7 @@ class PromptType(str, Enum):
|
|
50 |
|
51 |
|
52 |
class StudyVariableRequest(BaseModel):
|
53 |
-
study_variable: StudyVariables
|
54 |
prompt_type: PromptType
|
55 |
text: constr(min_length=1, strip_whitespace=True) # type: ignore
|
56 |
|
|
|
1 |
import logging
|
2 |
import os
|
3 |
from enum import Enum
|
4 |
+
from typing import List, Optional, Union
|
5 |
|
6 |
from dotenv import load_dotenv
|
7 |
from fastapi import FastAPI, HTTPException
|
|
|
50 |
|
51 |
|
52 |
class StudyVariableRequest(BaseModel):
|
53 |
+
study_variable: Union[StudyVariables, str]
|
54 |
prompt_type: PromptType
|
55 |
text: constr(min_length=1, strip_whitespace=True) # type: ignore
|
56 |
|
commands.md
CHANGED
@@ -47,7 +47,7 @@ aws ecr create-repository \
|
|
47 |
export ECR_BACKEND_FASTAPI_URL="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/fastapi-api-prod"
|
48 |
echo $ECR_BACKEND_FASTAPI_URL
|
49 |
|
50 |
-
docker build -f Dockerfile.api.prod -t fastapi-api-prod .
|
51 |
docker tag fastapi-api-prod:latest "${ECR_BACKEND_FASTAPI_URL}:latest"
|
52 |
docker push "${ECR_BACKEND_FASTAPI_URL}:latest"
|
53 |
|
|
|
47 |
export ECR_BACKEND_FASTAPI_URL="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/fastapi-api-prod"
|
48 |
echo $ECR_BACKEND_FASTAPI_URL
|
49 |
|
50 |
+
docker build --build-arg AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID -f Dockerfile.api.prod -t fastapi-api-prod .
|
51 |
docker tag fastapi-api-prod:latest "${ECR_BACKEND_FASTAPI_URL}:latest"
|
52 |
docker push "${ECR_BACKEND_FASTAPI_URL}:latest"
|
53 |
|