File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
packages/backend/src/apps/aisay/common Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ export const DOCUMENT_TYPES = [
88
99export const DEFAULT_GENERALISED_MODEL_TYPE = 'standard'
1010export const GENERALISED_MODEL_OPTIONS = [
11- { label : 'Standard' , value : DEFAULT_GENERALISED_MODEL_TYPE } ,
12- { label : 'Vision' , value : 'DOC_EXTRACTION_V2' } ,
11+ { label : 'Standard' , value : DEFAULT_GENERALISED_MODEL_TYPE } , // LLM
12+ { label : 'Vision' , value : 'DOC_EXTRACTION_V2' } , // VLM
1313]
Original file line number Diff line number Diff line change @@ -40,17 +40,23 @@ export const generalisedModelSchema = z.object({
4040 } )
4141 return result
4242 } ) ,
43+ /**
44+ * NOTE: the custom model type is indicated by the 'additonal_features' field in the request body
45+ * 1. this function returns null when using the standard model as it is not required by default.
46+ * 2. it is only included when using the vision generalised model.
47+ * API doc: https://app.swaggerhub.com/apis-docs/DAMIENSKTWORK/bgp-aisay_document_extraction_api/1.0.11#/DocumentParserRequestS3GenericV2
48+ */
4349 modelType : z
4450 . string ( )
4551 . optional ( )
4652 . transform ( ( value ) => {
47- if ( ! value ) {
53+ if ( ! value || value === DEFAULT_GENERALISED_MODEL_TYPE ) {
4854 return null
4955 }
5056
5157 const allowedValues = GENERALISED_MODEL_OPTIONS . map (
5258 ( option ) => option . value ,
53- ) . filter ( ( value ) => value !== DEFAULT_GENERALISED_MODEL_TYPE )
59+ )
5460
5561 if ( ! allowedValues . includes ( value ) ) {
5662 return null
You can’t perform that action at this time.
0 commit comments