Skip to main content

NLPPipeline

Polymorphic NLP/NLU engine configuration. Uses @JsonTypeInfo for JSON serialization discriminator. Subtypes cover LUIS, OpenAI, Dialogflow, Helvia NLP, Helvia GPT, and Helvia RAG. Collection: nlp-pipelines | DB: MongoDB Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/NLPPipeline.kt TypeScript: hbf-core-api/src/datamodel/nlp.ts

Base Fields (all subtypes inherit these)

FieldTypeRequiredIndexedNotes
idStringyesPKMongoDB document ID
nameStringyes@NotNull
descriptionStringno
typeNLPTypeyes@JsonTypeInfo discriminator
includeTrainingTagsList<String>noDefault empty. Tags to include in training
excludeTrainingTagsList<String>noDefault empty. Tags to exclude from training
languageStringyes@NotNull on create, @Null on update
secondaryLanguagesSet<LanguageCode>no
organizationOrganizationyes@DBRef lazy, @JsonIgnore
organizationRefStringno@Transient
tenantTenantyes@DBRef lazy, @JsonIgnore. Compound index on tenant.$id
tenantRefStringno@Transient
statusNLPStatusno
failedReasonStringnoError message if status is FAILED
lastTrainedAtDateno
predictionConfidenceThresholdDoubleno@DecimalMin(0, exclusive), @Max(1)
createdAtDateyes@CreatedDate
updatedAtDateyes@LastModifiedDate
trainCountIntno@Empty, not persisted
trainingGroupStringno
nlpServiceNLPServicenoDefault: HBF_CORE

Subtypes

LuisNLP (type: LUIS_NLP)

FieldTypeNotes
appIdString@NotNull on update. Agent application ID
appNameString@NotNull on create
authoringKeyString
appVersionString
hostStringAuthoring host base URL
predictionHostString
predictionKeyString

OpenAINLP (type: OPENAI_NLP)

Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/OpenAINLP.kt

FieldTypeNotes
modelString@NotNull on create. Model ID
apiKeyString@NotNull on create
temperatureDoubleRange 0-1
maxTokensInt
logprobsInt@Max(5)
numberOfExamplesInt@Min(2)
presencePenaltyDoubleRange -2 to 2
frequencyPenaltyDoubleRange -2 to 2
stopList<String>@Size(max=4). Stop sequences
promptOpenAIPrompt@JsonIgnore, internal training state
trainingTypeOpenAIType@NotNull on create
modelCategoryOpenAIModelCategory@NotNull on create. COMPLETION or CHAT

DialogflowNLP (type: DIALOGFLOW_NLP)

Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/DialogflowNLP.kt

FieldTypeNotes
projectIdString
privateKeyStringService account private key
privateKeyIdString
clientIdString
clientEmailString
tokenServerUriString
regionDialogFlowRegion
trainingOperationNameString
createOperationNameString@JsonIgnore, @Null

HelviaNLPSpecification (type: HELVIA_NLP_SPECIFICATION)

FieldTypeNotes
serviceUrlString@NotNull
bearerTokenString@NotNull

HelviaGPT (type: HELVIA_GPT, extends HelviaNLPSpecification)

FieldTypeNotes
serviceUrlStringInherited
bearerTokenStringInherited
pipelineIdString@NotNull

HelviaRAGPipeline (type: HELVIA_RAG_PIPELINE, extends HelviaNLPSpecification)

FieldTypeNotes
serviceUrlStringInherited
bearerTokenStringInherited
pipelineIdString@NotNull
settingsRAGPipelineSettingsDefault values

RAGPipelineSettings

FieldTypeNotes
includeHistoryBooleanDefault: false
maxHistoryTurnsIntDefault: 4. Range 1-30

Enums

NLPType

ValueDescription
LUIS_NLPMicrosoft LUIS
OPENAI_NLPOpenAI text/chat completion
HELVIA_NLP_SPECIFICATIONHelvia custom NLP service
HELVIA_RAG_PIPELINEHelvia RAG pipeline
DIALOGFLOW_NLPGoogle Dialogflow
HELVIA_GPTHelvia GPT pipeline

NLPStatus

ValueDescription
CREATEDNewly created, not trained
OUTDATEDTraining data changed, needs retrain
TRAININGCurrently training
FAILEDTraining failed
READYTrained and ready for predictions
INITIALIZINGBeing initialized

OpenAIType

ValueDescription
ZERO_SHOTNo examples in prompt
ONE_SHOTOne example per category
FEW_SHOTMultiple examples per category
CUSTOM_PROMPTUser-defined prompt
FINE_TUNEDFine-tuned model (not yet supported)

OpenAIModelCategory

ValueDescription
COMPLETIONText completion API
CHATChat completion API

DialogFlowRegion

ValueRegion ID
EU_W1europe-west1
EU_W2europe-west2
AU_SE1australia-southeast1
AS_NE1asia-northeast1
GLOBALglobal
USus

NLPService

ValueDescription
HBF_CORENLP processing in hbf-core
HBF_NLPExternal Helvia NLP service

Relationships

  • Belongs to: Organization (via @DBRef), Tenant (via @DBRef)
  • Referenced by: Tenant (via nlpMap: language code to pipeline ID)

TypeScript Mapping

hbf-core (Kotlin)hbf-core-api (TypeScript)Notes
NLPPipelineNLPPipelineTS omits includeTrainingTags, excludeTrainingTags, secondaryLanguages
LuisNLPLuisNLPAligned
DialogflowNLPDialogflowNLPAligned
HelviaNLPSpecificationHelviaNLPDifferent naming. TS uses modelId instead of Kotlin's implicit
HelviaGPTHelviaGPTTS adds currentMonthGptTokens, primaryLanguage, lastUsedAt
HelviaRAGPipeline(not in TS)Gap: RAG pipeline not in hbf-core-api
OpenAINLP(not in TS)Gap: not exported as NLPPipeline subtype. TS has separate OpenAIConfiguration
NLPTypeNLPTypeTS uses HELVIA_NLP instead of HELVIA_NLP_SPECIFICATION
NLPStatusNLPStatusAligned
DialogFlowRegionDialogFlowRegionAligned
OpenAITypeOpenAIType (in tenantSettings.ts)TS omits FEW_SHOT