Add default model population for AI Connector service providers#250506
Add default model population for AI Connector service providers#250506saikatsarkar056 merged 19 commits intoelastic:mainfrom
Conversation
| export const MAX_NUMBER_OF_ALLOCATIONS = 'max_number_of_allocations'; | ||
| export const CONTEXT_WINDOW_LENGTH = 'contextWindowLength'; | ||
|
|
||
| export const DEFAULT_MODELS: Partial<Record<ServiceProviderKeys, string>> = { |
There was a problem hiding this comment.
I think it makes more sense to add these default models to the INTERNAL_OVERRIDE_FIELDS. These are used in the mapProviderFields helper function where we already set a default_value if the field config has one. The model id default could be set there. It also keeps these internal changes that are service specific in one place and easier to track.
| * @param providerService - the service provider identifier | ||
| * @returns the default model string if available, otherwise null | ||
| */ | ||
| function getDefaultModelValue( |
There was a problem hiding this comment.
A function like this should go in helpers.ts to keep this file size manageable.
alvarezmelissa87
left a comment
There was a problem hiding this comment.
Thanks so much for your work on this! 🙏 Left a couple of comments.
|
@elasticmachine merge upstream |
|
@saikatsarkar056 - gave this a test and there's an issue with trying to delete the model id to input something else. Just keeps resetting. Likely need to add some logic to add default value only once. Just checked some other providers and looks like this is a bug that's been around and unrelated to your changes. 🤔 Would be good to get that bug fixed prior to merging this as the modelId is very important for the user to be able to edit. (Link to kibana issue) modelIdDefaultBug.mov |
|
@elasticmachine merge upstream |
@alvarezmelissa87 This PR will fix the issue. |
|
@elasticmachine merge upstream |
alvarezmelissa87
left a comment
There was a problem hiding this comment.
Tested and working as expected. (Once this fix is in).
LGTM ⚡
|
@elasticmachine merge upstream |
@alvarezmelissa87 The fix is added into this PR. The CI was green. Could you please review once more? Thank you. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
|
Summary
Users currently have to manually search for and enter model names when configuring AI connectors, which is error-prone and time-consuming. This change auto-populates the model field with recommended defaults, eliminating the need to look up model identifiers.
Screen.Recording.2026-01-27.at.10.28.36.AM.mov
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.
Release note
Improves AI connector setup by auto-populating the model field with recommended defaults, so users no longer need to search for and manually enter model identifiers.