You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked the logs of the k8s-sample pod and found the following error:
Request failed. Failed while calling AI provider Google: googleapi: Error 400: * GenerateContentRequest.generation_config.max_output_tokens: max_output_tokens must be positive.
k8sgpt-sample-7c58bdb9d6-b5j2n {"level":"info","ts":1728763974.447422,"caller":"server/server.go:146","msg":"binding metrics to 8081"}
k8sgpt-sample-7c58bdb9d6-b5j2n {"level":"info","ts":1728763974.4475062,"caller":"server/server.go:105","msg":"binding api to 8080"}
k8sgpt-sample-7c58bdb9d6-b5j2n {"level":"info","ts":1728763986.0204685,"caller":"server/log.go:50","msg":"request failed. failed while calling AI provider google: googleapi: Error 400: * GenerateContentRequest.generation_config.max_output_tokens: max_output_tokens must be positive.","duration_ms":4564,"method":"/schema.v1.ServerAnalyzerService/Analyze","request":"backend:\"google\" explain:true anonymize:true language:\"english\" max_concurrency:10 output:\"json\"","remote_addr":"10.244.0.27:58998","status_code":2}
Upon investigation, I discovered that maxOutputTokens is not being set in the K8sGPT manifest, which causes the c.maxTokens here in k8sGPT to default to 0, leading to the error.
Proposal:
Add an optional spec.ai.maxOutputToken field with a default value on kind: K8sGPT, which will then be passed to the schemav1.AnalyzeRequest.
If this proposal is acceptable, I would be happy to submit a PR to implement this change.
The text was updated successfully, but these errors were encountered:
Checklist
Affected Components
K8sGPT Version
v0.3.41
Kubernetes Version
v1.30.0
Host OS and its Version
No response
Steps to reproduce
k8sGPT Operator
.google
as the backend:Expected behaviour
The
spec.details
field in the generatedResult
manifest should contain information about the error, not an empty string. Example:Actual behaviour
k8s-sample
deployment and its pod are created successfully, andk8sGPT
is running without issues.Result
manifests are also created, but thespec.details
field is empty. Here’s an example manifest:Additional Information
I checked the logs of the
k8s-sample
pod and found the following error:Upon investigation, I discovered that
maxOutputTokens
is not being set in theK8sGPT
manifest, which causes the c.maxTokens here in k8sGPT to default to0
, leading to the error.Proposal:
Add an optional
spec.ai.maxOutputToken
field with a default value on kind: K8sGPT, which will then be passed to the schemav1.AnalyzeRequest.If this proposal is acceptable, I would be happy to submit a PR to implement this change.
The text was updated successfully, but these errors were encountered: