Repository navigation
Cherry pick #109232 to 26.5: AI functions parameter map - #112520
Merged
robot-clickhouse-ci-2 merged 17 commits intoJul 31, 2026
Merged
Conversation
Move the named collection out of the positional arguments. Credentials now come from a `credentials` key in an optional trailing `Map(String, String)` argument, or from `ai_function_text_default_credentials` (chat functions) / `ai_function_embedding_default_credentials` (aiEmbed) when the map omits it. The map also carries tunables (`model`, `max_tokens`, `temperature`, `system_prompt`, `instructions`, `dimensions`); each function declares its params, defaults, and required-ness via a small spec resolved centrally. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Reject duplicate keys in the parameter map instead of silently keeping the last value, matching the unknown-key rejection. - AIParams::getString/getFloat/getUInt throw a DB::Exception on a missing key rather than std::map::at's std::out_of_range. - Drop the unnecessary ColumnMap.h include. - Tests: negative / out-of-range max_tokens and duplicate map key. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Parse UInt map values (max_tokens, dimensions) with overflow checking so a value above UInt64 max is rejected instead of silently wrapping (e.g. "18446744073709551616" -> 0). Add a test for the wrap boundary. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Expand each function's `params` documentation with per-key meaning and defaults. - Clarify the `AIParamKind` and parameter-parsing comments. - Parse parameters via exhaustive `switch` over `AIParamKind` so a new kind is a compile error rather than a silent fallthrough; guard `getResolvedAIParam` with `chassert`. - Add a test rejecting a parameter map passed in the prompt position. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Style check: give the small AI-parameter `std::vector`/`std::map` config containers `STYLE_CHECK_ALLOW_STD_CONTAINERS`-marked aliases instead of raw std containers. - clang-tidy (cppcoreguidelines-init-variables): initialize `value` in the UInt parameter parser. - Fast test: update 04142_ai_functions_named_collection_access to the new signature (credentials via the parameter map); reference unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Add `ai_function_text_default_credentials` and `ai_function_embedding_default_credentials` to the reference settings docs (session-settings.mdx and the experimental-features list) so the links from the AI functions page resolve and the Mintlify docs check passes. - SettingsChangesHistory: use a terse "New setting" reason for both. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ntials-params-map AI functions parameter map
Member
|
Heads-up: the cherry-pick of #110619 to 26.5 (#112515) has been resolved by adapting it onto the current 26.5 API, making |
Resolved the conflicts onto the 26.5 AI-function code, with `aiEmbed` converged to the current master signature `aiEmbed(text, model[, params])` per the review comment: `model` is a required positional argument and is rejected in the parameter map and in the named collection. 26.5-specific deviations from master: `api_key` stays a required named-collection field, the two new default-credentials settings are registered in the 26.5 block of `SettingsChangesHistory.cpp`, `aiEmbed`'s `introduced_in` stays 26.5, and the parts that do not exist in 26.5 are dropped (`docs/reference/**`, `tests/integration/test_ai_functions/test.py`, the `QueryFuzzer` AI swap groups and the `04142` default-credentials access helper). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
george-larionov
added a commit
that referenced
this pull request
Jul 31, 2026
26.6 carries #106881 (credentials from `ai_function_credentials`), which master reverted and re-landed as #109232, so that setting is replaced by the two default-credentials settings. Keep 26.6's retry handling and converge `aiEmbed` to `aiEmbed(text, model[, params])` so the #110619 backport is not undone. Related: #112520 (comment) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #109232
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job