feat: allow the agent to perform things concurrently

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-04-22 12:06:20 +02:00
parent 9e52438877
commit 7fcd5b86b9
4 changed files with 57 additions and 15 deletions

View File

@@ -54,7 +54,8 @@ type options struct {
newConversationsSubscribers []func(openai.ChatCompletionMessage)
observer Observer
observer Observer
parallelJobs int
}
func (o *options) SeparatedMultimodalModel() bool {
@@ -138,6 +139,13 @@ func EnableKnowledgeBaseWithResults(results int) Option {
}
}
func WithParallelJobs(jobs int) Option {
return func(o *options) error {
o.parallelJobs = jobs
return nil
}
}
func WithNewConversationSubscriber(sub func(openai.ChatCompletionMessage)) Option {
return func(o *options) error {
o.newConversationsSubscribers = append(o.newConversationsSubscribers, sub)