Open VaibhavMalik4187 opened 2 months ago
@AlexsJones, @JuHyung-Son, where do we intend to use the responses obtained from repeatedly calling the AI backend?
what do you mean repeatedly calling the AI backend
?
what do you mean
repeatedly calling the AI backend
?
Sorry if it's a naive question, I referred to the results obtained when the AI backend is called outside the reconciler loop (at set intervals). How do we plan to use them?
I'm sorry, but I don't think I understand the situation very well. what is the situation that ai backend is called outside the reconciler loop? do we have that situation?
I'm sorry, but I don't think I understand the situation very well. what is the situation that ai backend is called outside the reconciler loop? do we have that situation?
No problem, I'll try again. So we're working on this feature to support calling the AI backend at set intervals independent of the reconciler loop.
I approached this feature in the following manner:
k8sgptConfig.Spec.AI.Interval
field and its duration is greater than k8sgptClient.ProcessAnalysis(k8sgptConfig, allowBackendAIRequest)
. If yes, then call repeatBackendRequest
.repeatBackendRequest
will call time.AfterFunc
to call k8sgptClient.ProcessAnalysis(k8sgptConfig, allowBackendAIRequest)
and obtain the results outside the reconciler loop at set intervals.
📑 Description
This commit introduces the ability to send the requests to the backend AI server at set intervals, independent of the reconciler's requeue requests.
To utilize this feature, the
Interval
field in theAI
settings must be set in the k8sgpt configuration object. Also, the specified interval must be greater than or equal to the reconciler's requeue interval as the llm requests should be called after the reconciler executes k8sgpt analyze.Fixes: https://github.com/k8sgpt-ai/k8sgpt-operator/issues/419
✅ Checks