mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
* feat: per-feature and workspace-level AI model settings Baserow could only point every AI feature at one instance-wide model. An administrator can now register provider models, declare which AI features each model may serve, and pick the default model per feature; a workspace admin can inherit that choice, override it, or disable the feature locally. The assistant resolves its model once per logical request and threads that snapshot through its nested agents and tools, so a single run can no longer re-read settings repeatedly or pick a model other than the one it validated. The scoped provider state is memoized for the duration of a request, keeping workspace serialization from loading it once per workspace. Also: - add Google and Groq provider types, and keep these database-only providers out of the legacy workspace settings they cannot round-trip through; - prune orphaned feature selections so an unloaded feature type's RESTRICT FK no longer blocks provider and model deletion; - record whether a configured model answers text and tool-calling probes, and invalidate that result when its credentials or identifier change; - broadcast provider and availability changes over the existing realtime channel so open clients update without reloading; - read the assistant model from the shared configmap, so frontend pods no longer miss it on Helm installs. Manual test instructions live in docs/testing/kuma-model-settings-test-plan.md. * fix: address AI provider settings review feedback
70 lines
2.1 KiB
JavaScript
70 lines
2.1 KiB
JavaScript
import { getUndoRedoActionRequestConfig } from '@baserow/modules/database/utils/action'
|
|
import { getRealtimeRecoveryRequestConfig } from '@baserow/modules/core/plugins/realtimeProtocol'
|
|
|
|
export default (client) => {
|
|
return {
|
|
fetchAll(tableId, viewId, realtimeRecovery = false) {
|
|
const config = {
|
|
params: {},
|
|
...(realtimeRecovery ? getRealtimeRecoveryRequestConfig() : {}),
|
|
}
|
|
|
|
if (viewId) {
|
|
config.params.view = viewId
|
|
}
|
|
|
|
return client.get(`/database/fields/table/${tableId}/`, config)
|
|
},
|
|
create(tableId, values, undoRedoActionGroupId = null) {
|
|
const config = getUndoRedoActionRequestConfig({ undoRedoActionGroupId })
|
|
return client.post(`/database/fields/table/${tableId}/`, values, config)
|
|
},
|
|
get(fieldId) {
|
|
return client.get(`/database/fields/${fieldId}/`)
|
|
},
|
|
getUniqueRowValues(fieldId, limit = 10, splitCommaSeparated = false) {
|
|
const config = {
|
|
params: {
|
|
limit,
|
|
},
|
|
}
|
|
|
|
if (splitCommaSeparated) {
|
|
config.params.split_comma_separated = 'true'
|
|
}
|
|
|
|
return client.get(
|
|
`/database/fields/${fieldId}/unique_row_values/`,
|
|
config
|
|
)
|
|
},
|
|
update(fieldId, values, undoRedoActionGroupId = null) {
|
|
const config = getUndoRedoActionRequestConfig({ undoRedoActionGroupId })
|
|
return client.patch(`/database/fields/${fieldId}/`, values, config)
|
|
},
|
|
delete(fieldId) {
|
|
return client.delete(`/database/fields/${fieldId}/`)
|
|
},
|
|
asyncDuplicate(
|
|
fieldId,
|
|
duplicateData = false,
|
|
undoRedoActionGroupId = null
|
|
) {
|
|
const config = getUndoRedoActionRequestConfig({ undoRedoActionGroupId })
|
|
return client.post(
|
|
`/database/fields/${fieldId}/duplicate/async/`,
|
|
{ duplicate_data: duplicateData },
|
|
config
|
|
)
|
|
},
|
|
changePrimary(tableId, newPrimaryFieldId) {
|
|
return client.post(
|
|
`/database/fields/table/${tableId}/change-primary-field/`,
|
|
{
|
|
new_primary_field_id: newPrimaryFieldId,
|
|
}
|
|
)
|
|
},
|
|
}
|
|
}
|