Skip to content

Cherry pick #110449 to 26.5: AI functions: send X-ClickHouse-AI-Function header from OpenAI provider - #112936

Merged
robot-ch-test-poll3 merged 7 commits into
backport/26.5/110449from
cherrypick/26.5/110449
Aug 1, 2026
Merged

robot-ch-test-poll3 merged 7 commits into
backport/26.5/110449from
cherrypick/26.5/110449

Conversation

@robot-ch-test-poll4

Copy link
Copy Markdown
Contributor

Original pull-request #110449

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-pick locally.
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:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

george-larionov and others added 6 commits July 27, 2026 23:39
Tag every OpenAI-format request with the SQL name of the calling AI
function so an upstream endpoint can identify it. Header only; other
providers ignore the new AIRequest/AIEmbeddingRequest field.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The AI functions already expose their SQL name via IFunction::getName.
Use it for the X-ClickHouse-AI-Function header and drop the duplicate
functionName virtual and its four overrides.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Both request construction sites populate function_name via getName, so
drop the empty check and assert the invariant in the provider.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Note in the docs that requiring `model` as a positional argument enforces
reproducible embeddings, and trim redundant comments in aiEmbed.cpp.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
aiEmbed now takes model as a required positional argument, so the
header test must pass it explicitly like every other aiEmbed call.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…on-name-header

AI functions: send X-ClickHouse-AI-Function header from OpenAI provider
@robot-ch-test-poll4 robot-ch-test-poll4 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels Aug 1, 2026
The only conflict was `tests/integration/test_ai_functions/test.py`:
26.5 never got the directory. Added it from the PR so the new
`X-ClickHouse-AI-Function` header test comes with it.
@robot-ch-test-poll3
robot-ch-test-poll3 merged commit cd8134f into backport/26.5/110449 Aug 1, 2026
1 check passed
@robot-ch-test-poll3
robot-ch-test-poll3 deleted the cherrypick/26.5/110449 branch August 1, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants