Enha (rag): async writes

This commit is contained in:
Grail Finder
2026-03-06 18:58:23 +03:00
parent edfd43c52a
commit 17b68bc21f
4 changed files with 483 additions and 72 deletions

View File

@@ -11,6 +11,7 @@ import (
"net/http"
"os"
"sync"
"time"
"github.com/sugarme/tokenizer"
"github.com/sugarme/tokenizer/pretrained"
@@ -33,8 +34,10 @@ type APIEmbedder struct {
func NewAPIEmbedder(l *slog.Logger, cfg *config.Config) *APIEmbedder {
return &APIEmbedder{
logger: l,
client: &http.Client{},
cfg: cfg,
client: &http.Client{
Timeout: 30 * time.Second,
},
cfg: cfg,
}
}