Improve typing around AI prompts.
This commit is contained in:
parent
b9fb4416bb
commit
7d6b822b8a
|
@ -1 +1 @@
|
||||||
Subproject commit 45f5b6fe9bbdbdf502581740ab43b82e8153260f
|
Subproject commit 788173a024fd5ef98d3122b26dbc06d39fb51349
|
|
@ -163,11 +163,6 @@ export async function finaliseRow(
|
||||||
contextRows: [enrichedRow],
|
contextRows: [enrichedRow],
|
||||||
})
|
})
|
||||||
|
|
||||||
const flag1 = await features.isEnabled(FeatureFlag.BUDIBASE_AI)
|
|
||||||
const flag2 = await pro.features.isBudibaseAIEnabled()
|
|
||||||
const flag3 = await features.isEnabled(FeatureFlag.AI_CUSTOM_CONFIGS)
|
|
||||||
const flag4 = await pro.features.isAICustomConfigsEnabled()
|
|
||||||
|
|
||||||
const aiEnabled =
|
const aiEnabled =
|
||||||
((await features.isEnabled(FeatureFlag.BUDIBASE_AI)) &&
|
((await features.isEnabled(FeatureFlag.BUDIBASE_AI)) &&
|
||||||
(await pro.features.isBudibaseAIEnabled())) ||
|
(await pro.features.isBudibaseAIEnabled())) ||
|
||||||
|
|
|
@ -118,16 +118,59 @@ export interface FormulaFieldMetadata extends BaseFieldSchema {
|
||||||
responseType?: FormulaResponseType
|
responseType?: FormulaResponseType
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AIFieldMetadata extends BaseFieldSchema {
|
interface AITranslateFieldMetadata extends BaseFieldSchema {
|
||||||
type: FieldType.AI
|
type: FieldType.AI
|
||||||
operation: AIOperationEnum
|
operation: AIOperationEnum.TRANSLATE
|
||||||
columns?: string[]
|
column: string
|
||||||
column?: string
|
language: string
|
||||||
categories?: string
|
|
||||||
prompt?: string
|
|
||||||
language?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AICleanDataFieldMetadata extends BaseFieldSchema {
|
||||||
|
type: FieldType.AI
|
||||||
|
operation: AIOperationEnum.CLEAN_DATA
|
||||||
|
column: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AICategoriseTextFieldMetadata extends BaseFieldSchema {
|
||||||
|
type: FieldType.AI
|
||||||
|
operation: AIOperationEnum.CATEGORISE_TEXT
|
||||||
|
columns: string[]
|
||||||
|
categories: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AISentimentAnalysisFieldMetadata extends BaseFieldSchema {
|
||||||
|
type: FieldType.AI
|
||||||
|
operation: AIOperationEnum.SENTIMENT_ANALYSIS
|
||||||
|
column: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AISearchWebFieldMetadata extends BaseFieldSchema {
|
||||||
|
type: FieldType.AI
|
||||||
|
operation: AIOperationEnum.SEARCH_WEB
|
||||||
|
columns: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AIPromptFieldMetadata extends BaseFieldSchema {
|
||||||
|
type: FieldType.AI
|
||||||
|
operation: AIOperationEnum.PROMPT
|
||||||
|
prompt: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AISummariseTextFieldMetadata extends BaseFieldSchema {
|
||||||
|
type: FieldType.AI
|
||||||
|
operation: AIOperationEnum.SUMMARISE_TEXT
|
||||||
|
columns: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AIFieldMetadata =
|
||||||
|
| AITranslateFieldMetadata
|
||||||
|
| AICleanDataFieldMetadata
|
||||||
|
| AICategoriseTextFieldMetadata
|
||||||
|
| AISentimentAnalysisFieldMetadata
|
||||||
|
| AIPromptFieldMetadata
|
||||||
|
| AISearchWebFieldMetadata
|
||||||
|
| AISummariseTextFieldMetadata
|
||||||
|
|
||||||
export interface BBReferenceFieldMetadata
|
export interface BBReferenceFieldMetadata
|
||||||
extends Omit<BaseFieldSchema, "subtype"> {
|
extends Omit<BaseFieldSchema, "subtype"> {
|
||||||
type: FieldType.BB_REFERENCE
|
type: FieldType.BB_REFERENCE
|
||||||
|
|
Loading…
Reference in New Issue