Skip to content

Commit 63481b8

Browse files
committed
#107 api - model set to optional instead of required (llm-based strategies doesn't need it to convert data to specified format)
1 parent 5264a00 commit 63481b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

text_extract_api/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def ocr_endpoint(
7878
async def ocr_upload_endpoint(
7979
strategy: str = Form(...),
8080
prompt: str = Form(None),
81-
model: str = Form(...),
81+
model: str = Form(None),
8282
file: UploadFile = File(...),
8383
ocr_cache: bool = Form(...),
8484
storage_profile: str = Form('default'),
@@ -104,7 +104,7 @@ class OllamaPullRequest(BaseModel):
104104
class OcrRequest(BaseModel):
105105
strategy: str = Field(..., description="OCR strategy to use")
106106
prompt: Optional[str] = Field(None, description="Prompt for the Ollama model")
107-
model: str = Field(..., description="Model to use for the Ollama endpoint")
107+
model: Optional[str] = Field(None, description="Model to use for the Ollama endpoint")
108108
file: FileField = Field(..., description="Base64 encoded document file")
109109
ocr_cache: bool = Field(..., description="Enable OCR result caching")
110110
storage_profile: Optional[str] = Field('default', description="Storage profile to use")
@@ -126,7 +126,7 @@ def validate_storage_profile(cls, v):
126126
class OcrFormRequest(BaseModel):
127127
strategy: str = Field(..., description="OCR strategy to use")
128128
prompt: Optional[str] = Field(None, description="Prompt for the Ollama model")
129-
model: str = Field(..., description="Model to use for the Ollama endpoint")
129+
model: Optional[str] = Field(None, description="Model to use for the Ollama endpoint")
130130
ocr_cache: bool = Field(..., description="Enable OCR result caching")
131131
storage_profile: Optional[str] = Field('default', description="Storage profile to use")
132132
storage_filename: Optional[str] = Field(None, description="Storage filename to use")

0 commit comments

Comments
 (0)