redis缓存替换+pgvector向量替换
This commit is contained in:
23
ai-chat-backend/services/ai-chat-service/ai-chat-service.go
Normal file
23
ai-chat-backend/services/ai-chat-service/ai-chat-service.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package ai_chat_service
|
||||
|
||||
import (
|
||||
"ai-chat-backend/pkg/config"
|
||||
grpc_client "ai-chat-backend/services/grpc-client"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var pool grpc_client.ClientPool
|
||||
var once sync.Once
|
||||
|
||||
type client struct {
|
||||
grpc_client.DefaultClient
|
||||
}
|
||||
|
||||
func GetAiChatServiceClientPool() grpc_client.ClientPool {
|
||||
once.Do(func() {
|
||||
cnf := config.GetConfig()
|
||||
c := &client{}
|
||||
pool = c.GetPool(cnf.DependOn.AiChatService.Address)
|
||||
})
|
||||
return pool
|
||||
}
|
||||
Reference in New Issue
Block a user