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)
| Field | Type | Required | Indexed | Notes |
|---|
id | String | yes | PK | MongoDB document ID |
name | String | yes | | @NotNull |
description | String | no | | |
type | NLPType | yes | | @JsonTypeInfo discriminator |
includeTrainingTags | List<String> | no | | Default empty. Tags to include in training |
excludeTrainingTags | List<String> | no | | Default empty. Tags to exclude from training |
language | String | yes | | @NotNull on create, @Null on update |
secondaryLanguages | Set<LanguageCode> | no | | |
organization | Organization | yes | | @DBRef lazy, @JsonIgnore |
organizationRef | String | no | | @Transient |
tenant | Tenant | yes | | @DBRef lazy, @JsonIgnore. Compound index on tenant.$id |
tenantRef | String | no | | @Transient |
status | NLPStatus | no | | |
failedReason | String | no | | Error message if status is FAILED |
lastTrainedAt | Date | no | | |
predictionConfidenceThreshold | Double | no | | @DecimalMin(0, exclusive), @Max(1) |
createdAt | Date | yes | | @CreatedDate |
updatedAt | Date | yes | | @LastModifiedDate |
trainCount | Int | no | | @Empty, not persisted |
trainingGroup | String | no | | |
nlpService | NLPService | no | | Default: HBF_CORE |
Subtypes
LuisNLP (type: LUIS_NLP)
| Field | Type | Notes |
|---|
appId | String | @NotNull on update. Agent application ID |
appName | String | @NotNull on create |
authoringKey | String | |
appVersion | String | |
host | String | Authoring host base URL |
predictionHost | String | |
predictionKey | String | |
OpenAINLP (type: OPENAI_NLP)
Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/OpenAINLP.kt
| Field | Type | Notes |
|---|
model | String | @NotNull on create. Model ID |
apiKey | String | @NotNull on create |
temperature | Double | Range 0-1 |
maxTokens | Int | |
logprobs | Int | @Max(5) |
numberOfExamples | Int | @Min(2) |
presencePenalty | Double | Range -2 to 2 |
frequencyPenalty | Double | Range -2 to 2 |
stop | List<String> | @Size(max=4). Stop sequences |
prompt | OpenAIPrompt | @JsonIgnore, internal training state |
trainingType | OpenAIType | @NotNull on create |
modelCategory | OpenAIModelCategory | @NotNull on create. COMPLETION or CHAT |
DialogflowNLP (type: DIALOGFLOW_NLP)
Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/DialogflowNLP.kt
| Field | Type | Notes |
|---|
projectId | String | |
privateKey | String | Service account private key |
privateKeyId | String | |
clientId | String | |
clientEmail | String | |
tokenServerUri | String | |
region | DialogFlowRegion | |
trainingOperationName | String | |
createOperationName | String | @JsonIgnore, @Null |
HelviaNLPSpecification (type: HELVIA_NLP_SPECIFICATION)
| Field | Type | Notes |
|---|
serviceUrl | String | @NotNull |
bearerToken | String | @NotNull |
HelviaGPT (type: HELVIA_GPT, extends HelviaNLPSpecification)
| Field | Type | Notes |
|---|
serviceUrl | String | Inherited |
bearerToken | String | Inherited |
pipelineId | String | @NotNull |
HelviaRAGPipeline (type: HELVIA_RAG_PIPELINE, extends HelviaNLPSpecification)
| Field | Type | Notes |
|---|
serviceUrl | String | Inherited |
bearerToken | String | Inherited |
pipelineId | String | @NotNull |
settings | RAGPipelineSettings | Default values |
RAGPipelineSettings
| Field | Type | Notes |
|---|
includeHistory | Boolean | Default: false |
maxHistoryTurns | Int | Default: 4. Range 1-30 |
Enums
NLPType
| Value | Description |
|---|
LUIS_NLP | Microsoft LUIS |
OPENAI_NLP | OpenAI text/chat completion |
HELVIA_NLP_SPECIFICATION | Helvia custom NLP service |
HELVIA_RAG_PIPELINE | Helvia RAG pipeline |
DIALOGFLOW_NLP | Google Dialogflow |
HELVIA_GPT | Helvia GPT pipeline |
NLPStatus
| Value | Description |
|---|
CREATED | Newly created, not trained |
OUTDATED | Training data changed, needs retrain |
TRAINING | Currently training |
FAILED | Training failed |
READY | Trained and ready for predictions |
INITIALIZING | Being initialized |
OpenAIType
| Value | Description |
|---|
ZERO_SHOT | No examples in prompt |
ONE_SHOT | One example per category |
FEW_SHOT | Multiple examples per category |
CUSTOM_PROMPT | User-defined prompt |
FINE_TUNED | Fine-tuned model (not yet supported) |
OpenAIModelCategory
| Value | Description |
|---|
COMPLETION | Text completion API |
CHAT | Chat completion API |
DialogFlowRegion
| Value | Region ID |
|---|
EU_W1 | europe-west1 |
EU_W2 | europe-west2 |
AU_SE1 | australia-southeast1 |
AS_NE1 | asia-northeast1 |
GLOBAL | global |
US | us |
NLPService
| Value | Description |
|---|
HBF_CORE | NLP processing in hbf-core |
HBF_NLP | External 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 |
|---|
| NLPPipeline | NLPPipeline | TS omits includeTrainingTags, excludeTrainingTags, secondaryLanguages |
| LuisNLP | LuisNLP | Aligned |
| DialogflowNLP | DialogflowNLP | Aligned |
| HelviaNLPSpecification | HelviaNLP | Different naming. TS uses modelId instead of Kotlin's implicit |
| HelviaGPT | HelviaGPT | TS 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 |
| NLPType | NLPType | TS uses HELVIA_NLP instead of HELVIA_NLP_SPECIFICATION |
| NLPStatus | NLPStatus | Aligned |
| DialogFlowRegion | DialogFlowRegion | Aligned |
| OpenAIType | OpenAIType (in tenantSettings.ts) | TS omits FEW_SHOT |