Fix browser closure timing in search agent
Move defer statement to ensure browser closure occurs only after assigning the browser to the context. This prevents potential issues of premature resource release.
This commit is contained in:
@@ -92,7 +92,7 @@ func (a Agent) SearchAndUseTools(ctx context.Context, searchQuery string, questi
|
||||
|
||||
var lock sync.Mutex
|
||||
var analyzed []int
|
||||
var converted []*gollm.Function
|
||||
var converted []gollm.Function
|
||||
|
||||
for _, t := range tools {
|
||||
fn := gollm.NewFunction(t.Name, t.Description,
|
||||
|
Reference in New Issue
Block a user