Skip to content

Commit 2291e53

Browse files
alvarezmelissa87elasticmachinekibanamachine
authored
[ML][AI Connector] Add support for headers in the OpenAI integration: update schema (elastic#239002)
## Summary This PR is the first part of an effort to add custom header support for OpenAI in the AI Connector. Because adding new properties to connector schema require a 2 step deployment (see elastic#228371 (comment)), 2 PRs are needed for this. - step one - the schema changes, and anything else that does NOT set the config property - done in this PR - step two - things that can set the config property (so here, the UI) done here elastic#238710 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]>
1 parent e71e401 commit 2291e53

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

x-pack/platform/plugins/shared/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/platform/plugins/shared/stack_connectors/common/inference/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const ConfigSchema = schema.object({
1919
providerConfig: schema.object({}, { unknowns: 'allow', defaultValue: {} }),
2020
taskTypeConfig: schema.object({}, { unknowns: 'allow', defaultValue: {} }),
2121
contextWindowLength: schema.maybe(schema.number({})),
22+
headers: schema.maybe(schema.recordOf(schema.string(), schema.string())),
2223
});
2324

2425
export const SecretsSchema = schema.object({

x-pack/platform/plugins/shared/stack_connectors/server/connector_types/inference/inference.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class InferenceConnector extends SubActionConnector<Config, Secrets> {
119119
}
120120

121121
/**
122-
* responsible for making a esClient inference method to perform chat completetion task endpoint and returning the service response data
122+
* responsible for making a esClient inference method to perform chat completion task endpoint and returning the service response data
123123
* @param input the text on which you want to perform the inference task.
124124
* @signal abort signal
125125
*/
@@ -182,7 +182,7 @@ export class InferenceConnector extends SubActionConnector<Config, Secrets> {
182182
}
183183

184184
/**
185-
* responsible for making a esClient inference method to perform chat completetion task endpoint and returning the service response data
185+
* responsible for making a esClient inference method to perform chat completion task endpoint and returning the service response data
186186
* @param input the text on which you want to perform the inference task.
187187
* @signal abort signal
188188
*/

0 commit comments

Comments
 (0)