upd client

This commit is contained in:
Pasha 2025-05-10 13:22:36 +03:00
parent 171d31fe80
commit 5d781ec1e2
3 changed files with 8 additions and 2 deletions

@ -45,7 +45,11 @@ func NewGigaChatClient(ctx context.Context, deps Deps) (*GigaChatClient, error)
}
func (r *GigaChatClient) SendMsg(ctx context.Context, audience model.GigaChatAudience, question model.Question) (string, error) {
userInput := fmt.Sprintf(model.ReworkQuestionPrompt, audience.Age, audience.Gender, question.Title, question.Description)
gender := "женский"
if audience.Sex {
gender = "мужской"
}
userInput := fmt.Sprintf(model.ReworkQuestionPrompt, audience.Age, gender, question.Title, question.Description)
token, err := r.redisClient.Get(ctx, "gigachat_token").Result()
if err != nil {

2
go.mod

@ -5,7 +5,7 @@ go 1.23.2
toolchain go1.23.4
require (
gitea.pena/SQuiz/common v0.0.0-20250508202149-db480bff7ce7
gitea.pena/SQuiz/common v0.0.0-20250510092156-3fd4a05ccf84
github.com/go-redis/redis/v8 v8.11.5
github.com/go-resty/resty/v2 v2.16.5
github.com/gofiber/fiber/v2 v2.52.4

2
go.sum

@ -4,6 +4,8 @@ gitea.pena/SQuiz/common v0.0.0-20250507155516-52e5575d622b h1:BP5e88wii45OVhdgLp
gitea.pena/SQuiz/common v0.0.0-20250507155516-52e5575d622b/go.mod h1:rQRjqLlLyM71FZcvbM95Nv3ciq44F9DFtUHPZmDK3T8=
gitea.pena/SQuiz/common v0.0.0-20250508202149-db480bff7ce7 h1:HKR4ju51xWJOA9FEV5JhvG4QrNyLerj38pDsjecbkoo=
gitea.pena/SQuiz/common v0.0.0-20250508202149-db480bff7ce7/go.mod h1:/YR+uo4RouZshuHPkguk7nAJVKuFt3Z0mTFxUPdlzxQ=
gitea.pena/SQuiz/common v0.0.0-20250510092156-3fd4a05ccf84 h1:r1l+LNXItv3PQILX6GRGNCayjiJPV/Bv5DkD4fL1MJQ=
gitea.pena/SQuiz/common v0.0.0-20250510092156-3fd4a05ccf84/go.mod h1:/YR+uo4RouZshuHPkguk7nAJVKuFt3Z0mTFxUPdlzxQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=