diff --git a/helm/kagent/templates/modelconfig.yaml b/helm/kagent/templates/modelconfig.yaml index 7004aeec03..3a806a75fc 100644 --- a/helm/kagent/templates/modelconfig.yaml +++ b/helm/kagent/templates/modelconfig.yaml @@ -21,6 +21,9 @@ spec: {{- with $model }} provider: {{ .provider | quote }} model: {{ .model | quote }} + {{- if hasKey $model "stream" }} + stream: {{ $model.stream }} + {{- end }} {{- if $model.apiKeySecretRef }} apiKeySecret: {{.apiKeySecretRef}} {{- end }} diff --git a/helm/kagent/tests/modelconfig_test.yaml b/helm/kagent/tests/modelconfig_test.yaml index 1362c086dc..f5338001a2 100644 --- a/helm/kagent/tests/modelconfig_test.yaml +++ b/helm/kagent/tests/modelconfig_test.yaml @@ -2,6 +2,36 @@ suite: test modelconfig templates: - modelconfig.yaml tests: + - it: should preserve the API streaming default when unspecified + asserts: + - notExists: + path: spec.stream + + - it: should preserve an explicit false streaming option + set: + providers.openAI.stream: false + asserts: + - equal: + path: spec.stream + value: false + + - it: should preserve an explicit true streaming option + set: + providers.openAI.stream: true + asserts: + - equal: + path: spec.stream + value: true + + - it: should use the selected provider streaming option + set: + providers.default: anthropic + providers.anthropic.stream: false + asserts: + - equal: + path: spec.stream + value: false + - it: should render modelconfig with default provider asserts: - hasDocuments: diff --git a/helm/kagent/values.yaml b/helm/kagent/values.yaml index 7d4b2adedc..023e644638 100644 --- a/helm/kagent/values.yaml +++ b/helm/kagent/values.yaml @@ -640,6 +640,8 @@ ui: # https://kagent.dev/docs/getting-started/configuring-providers providers: + # Each provider can set `stream: false` to disable LLM response streaming. + # When omitted, ModelConfig uses its API default (true). default: openAI # -- Annotations added to the metadata of the generated default ModelConfig # (the one derived from `providers.default`). Omitted from the resource when empty.