Skip to content

@sqlrooms/ai / createAiSlice

Function: createAiSlice()

createAiSlice<PC>(__namedParameters): StateCreator<AiSliceState>

Type Parameters

Type Parameter
PC extends object & object

Parameters

ParameterTypeDescription
__namedParameters{ getApiKey: (modelProvider) => string; initialAnalysisPrompt: string; customTools: Record<string, AiSliceTool>; getInstructions: (tablesSchema) => string; }-
__namedParameters.getApiKey(modelProvider) => string-
__namedParameters.initialAnalysisPrompt?string-
__namedParameters.customTools?Record<string, AiSliceTool>-
__namedParameters.getInstructions?(tablesSchema) => stringFunction to get custom instructions for the AI assistant

Returns

StateCreator<AiSliceState>