diff --git a/app/service/productDescriptionService/google_out.txt b/app/service/productDescriptionService/google_out.txt new file mode 100644 index 0000000..f17a720 --- /dev/null +++ b/app/service/productDescriptionService/google_out.txt @@ -0,0 +1,8 @@ +

The use of rehabilitation rollers in various exercises and treatments has a positive impact on reducing injuries and increasing the patient's chances of returning to full physical fitness. They are used in physical rehabilitation, during corrective gymnastics, and traditional and sports massage, as they are ideal for lifting and separating limbs. They can also be used to support the patient's knees, feet, arms, and shoulders. Rehabilitation rollers are also recommended for children; using them during play significantly supports the development of gross motor skills.

Thanks to the wide range of colors and sizes, it is possible to compose an exercise set necessary in every physiotherapy office, massage room, school or kindergarten.

The rehabilitation roller is a medical device in accordance with the essential requirements for medical devices and within the meaning of the Act on Medical Devices, registered in the Register of Medical Devices maintained by the Office for Registration of Medicinal Products, Medical Devices and Biocidal Products, equipped with the manufacturer's declaration of conformity and bearing the CE mark.

Medical device

Recommended use:

Material specifications:

Cover: PVC-coated material intended for medical devices, making it very easy to clean and disinfect:

REACHOeko Tex Standard 100 certificateDoes not contain phthalatesFireproofAlcohol resistantUV resistantDesigned for outdoor useScratch resistantOil-resistant

Filling: medium-hard polyurethane foam with increased resistance to deformation:

Oeko Tex Standard 100 certificateHygienic certificateHygienic certificate

+

Rehabilitation rollers are used in a variety of exercises. They are used in physical rehabilitation, corrective gymnastics, and traditional and sports massage, as they are ideal for lifting and separating limbs. They can also be used to support the patient's knees, feet, arms, and shoulders. Rehabilitation rollers are also recommended for children, as using them during play significantly supports the development of gross motor skills. The product is certified as a medical device.

+ + +Rehabilitation roller 10 x 30 cm + available + on order +

I. Cleaning and maintenance

The upholstery should be surface cleaned using permitted agents:

Type of dirt

Permitted means

Procedure

Everyday dirt

A mild detergent, preferably a gray soap solution

Clean regularly using a sponge or soft brush. Finally, wipe the area with a damp cloth and then wipe dry (to remove any detergent residue).

Local, heavier stains

25% ethyl alcohol solution

Gently wipe with a damp gauze pad. Finally, wipe the area with a damp cloth and then wipe dry (to remove any detergent residue).

Disinfection

Publicly available disinfectants containing:

- active chlorine – sodium dichloroisocyanurate, max concentration 10,000 ppm

- active chlorine - chlorine dioxide in solution up to 20,000 ppm

- isopropyl alcohol max concentration 70%

Disinfect according to the manufacturer's recommendations for the agent used.

Before using any product other than a mild detergent, test the effect in an inconspicuous area and clean very carefully.


II. Information

Shampoo with a sponge

Do not wash!!! (delicate products)

Do not chlorinate!!! (do not use compounds that release free chlorine for bleaching)

Do not iron!!! (do not allow contact with hot surfaces, e.g. radiator)

Do not dry clean!!!

III. Warranty Terms

The warranty does not cover:

diff --git a/app/service/productDescriptionService/openai_out.txt b/app/service/productDescriptionService/openai_out.txt new file mode 100644 index 0000000..a55c25b --- /dev/null +++ b/app/service/productDescriptionService/openai_out.txt @@ -0,0 +1,165 @@ +

The use of rehabilitation rollers in various types of exercises and treatments positively affects the alleviation of injuries and increases the chances for the patient to return to full physical fitness. They are used in movement rehabilitation, during corrective gymnastics, traditional and sports massages, as they are ideal for lifting and separating limbs. They can also be used to support the knees, feet, arms, and shoulders of the patient. Rehabilitation rollers are also recommended for children; using them during play significantly supports the development of gross motor skills.

+

Thanks to a wide range of colors and varied sizes, it is possible to compose a set for exercises necessary in every physiotherapy office, massage salon, as well as in schools and kindergartens.

+

The rehabilitation roller is a medical device in accordance with the essential requirements for medical devices and within the meaning of the Medical Devices Act, registered in the Register of Medical Devices maintained by the Office for Registration of Medicinal Products, Medical Devices, and Biocidal Products, equipped with the manufacturer's declaration of conformity and marked with the CE mark.

+

+

Medical device

+

Recommended use:

+ +

+

Material specification:

+

Cover: material with a PVC coating intended for medical devices, making it very easy to clean and disinfect:

+ +

REACHOeko Tex Standard 100 CertificatePhthalate-FreeFire-ResistantAlcohol-ResistantUV-ResistantSuitable for Outdoor UseScratch-ResistantOil-Resistant

+

Filling: medium-hard polyurethane foam with enhanced resistance to deformation:

+ +

Oeko Tex Standard 100 CertificateHygienic CertificateHygienic Certificate

+

+

+ +

Rehabilitation rollers find their use in various types of exercises. They are used in movement rehabilitation, during corrective gymnastics, traditional and sports massages, as they are ideal for lifting and separating limbs. They can also be used to support the knees, feet, arms, and shoulders of the patient. Rehabilitation rollers are also recommended for children; using them during play significantly supports the development of gross motor skills. The product is certified as a medical device.

+ + + + + +Rehabilitation Roller 10 x 30 cm + +available + +on order + +

I. Cleaning and maintenance

+

The upholstery should be cleaned superficially using permitted agents:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Type of dirt

+
+

Permitted agents

+
+

Procedure

+
+

Everyday dirt

+

+
+

Mild detergent, preferably gray soap solution

+
+

Clean regularly using a sponge or soft brush. Finally, wipe the cleaned area with a damp cloth and then dry it (to remove detergent residues).

+
+

Local, stronger dirt

+
+

25% ethyl alcohol solution

+
+

Gently wipe with a gauze tampon soaked in the solution. Finally, wipe the cleaned area with a damp cloth and then dry it (to remove detergent residues).

+
+

Disinfection

+
+

Widely available disinfectants containing:

+

- active chlorine – sodium dichloroisocyanurate, max concentration 10000 ppm

+

- active chlorine - chlorine dioxide in solution up to 20,000 ppm

+

- isopropyl alcohol max concentration 70 %

+

+
+

Disinfect according to the recommendations of the manufacturer of the used agent.

+
+

Before using any agent other than mild detergent, test the effect in an inconspicuous place, and perform cleaning very carefully.

+
+



II. Information

+

+ + + + + + + + + + + + + + + + + + + + + + + +
+

Shampoo using a sponge

+
+

+
+

Do not wash!!! (delicate products)

+
+

+
+

Do not bleach!!! (do not use bleaching agents that release free chlorine)

+
+

+
+

Do not iron!!! (avoid contact with hot surfaces e.g., radiators)

+
+

+
+

Do not dry clean!!!

+
+

+

III. Warranty conditions

+

Warranty does not cover:

+
diff --git a/app/service/productDescriptionService/productDescriptionService.go b/app/service/productDescriptionService/productDescriptionService.go index c8da6b3..810bd46 100644 --- a/app/service/productDescriptionService/productDescriptionService.go +++ b/app/service/productDescriptionService/productDescriptionService.go @@ -17,9 +17,10 @@ import ( "git.ma-al.com/goc_daniel/b2b/app/model" "git.ma-al.com/goc_daniel/b2b/app/service/langsService" "git.ma-al.com/goc_daniel/b2b/app/utils/responseErrors" - "github.com/openai/openai-go/responses" "github.com/openai/openai-go/v3" - "google.golang.org/api/option" + "github.com/openai/openai-go/v3/option" + "github.com/openai/openai-go/v3/responses" + googleopt "google.golang.org/api/option" "gorm.io/gorm" // [START translate_v3_import_client_library] @@ -70,7 +71,7 @@ func New() *ProductDescriptionService { log.Fatalf("productDescriptionService: cannot build Google credentials: %v", err) } - googleCli, err := translate.NewTranslationClient(ctx, option.WithAuthCredentials(creds)) + googleCli, err := translate.NewTranslationClient(ctx, googleopt.WithAuthCredentials(creds)) if err != nil { log.Fatalf("productDescriptionService: cannot create Translation client: %v", err) } @@ -161,7 +162,7 @@ func (s *ProductDescriptionService) SaveProductDescription(userID uint, productI // // The Google Cloud project must have the Cloud Translation API enabled and the // service account must hold the "Cloud Translation API User" role. -func (s *ProductDescriptionService) TranslateProductDescription(userID uint, productID uint, productShopID uint, productFromLangID uint, productToLangID uint, model string) (*model.ProductDescription, error) { +func (s *ProductDescriptionService) TranslateProductDescription(userID uint, productID uint, productShopID uint, productFromLangID uint, productToLangID uint, aiModel string) (*model.ProductDescription, error) { var ProductDescription model.ProductDescription err := s.db. @@ -199,7 +200,7 @@ func (s *ProductDescriptionService) TranslateProductDescription(userID uint, pro } request := "" - if model == "OpenAI" { + if aiModel == "OpenAI" { request = "Translate to " + lang.ISOCode + " without changing the html structure.\n" } for i := 0; i < len(keys); i++ { @@ -207,11 +208,11 @@ func (s *ProductDescriptionService) TranslateProductDescription(userID uint, pro request += *fields[i] request += "\n" } - if model == "OpenAI" { + if aiModel == "OpenAI" { request = cleanForPrompt(request) } - if model == "OpenAI" { + if aiModel == "OpenAI" { openai_response, _ := s.client.Responses.New(context.Background(), responses.ResponseNewParams{ Input: responses.ResponseNewParamsInputUnion{OfString: openai.String(request)}, Model: openai.ChatModelGPT4_1Mini, @@ -228,9 +229,11 @@ func (s *ProductDescriptionService) TranslateProductDescription(userID uint, pro return nil, responseErrors.ErrAIBadOutput } *fields[i] = resolution + + fmt.Println(resolution) } - } else if model == "Google" { + } else if aiModel == "Google" { // TranslateText is the standard Cloud Translation v3 endpoint. req := &translatepb.TranslateTextRequest{ Parent: fmt.Sprintf("projects/%s/locations/global", s.projectID), @@ -255,6 +258,8 @@ func (s *ProductDescriptionService) TranslateProductDescription(userID uint, pro return nil, responseErrors.ErrAIBadOutput } *fields[i] = match + + fmt.Println(match) } } diff --git a/app/service/productDescriptionService/test_in.txt b/app/service/productDescriptionService/test_in.txt index e69de29..72af759 100644 --- a/app/service/productDescriptionService/test_in.txt +++ b/app/service/productDescriptionService/test_in.txt @@ -0,0 +1,167 @@ +Translate to en without changing the html structure. + +

Zastosowanie wałków rehabilitacyjnych w różnego rodzaju ćwiczeniach oraz zabiegach wpływa pozytywnie na łagodzenie urazów oraz zwiększa szanse na powrót pacjenta do pełnej sprawności fizycznej. Stosowane są w rehabilitacji ruchowej, podczas gimnastyki korekcyjnej, masaży tradycyjnych i sportowych, gdyż idealnie nadają się do unoszenia i separacji kończyn. Można je wykorzystać także do podpierania kolan, stóp, ramion, a także barków pacjenta. Wałki rehabilitacyjne polecane są także dla dzieci, wykorzystanie ich podczas zabawy znacznie wspiera rozwój dużej motoryki.

+

Dzięki szerokiej ofercie kolorystycznej oraz zróżnicowanym rozmiarom, możliwe jest skomponowanie zestawu do ćwiczeń niezbędnego w każdym gabinecie fizjoterapeutycznym, gabinecie masażu czy też szkole i przedszkolu.

+

Wałek rehabilitacyjny jest wyrobem medycznym zgodnie z wymaganiami zasadniczymi dla wyrobów medycznych i w rozumieniu ustawy o wyrobach medycznych, zgłoszonym do Rejestru Wyrobów Medycznych prowadzonego przez Urząd Rejestracji Produktów Leczniczych, Wyrobów Medycznych i Produktów Biobójczych, wyposażonym w deklarację zgodności producenta i opatrzonym znakiem CE.

+

+

Wyrób medyczny

+

Polecane zastosowanie:

+ +

+

Specyfikacja materiału:

+

Pokrowiec: materiał z powłoką PCV przeznaczony dla wyrobów medycznych, dzięki czemu jest bardzo łatwy w czyszczeniu oraz dezynfekcji:

+ +

REACHCertyfikat Oeko Tex Standard 100Nie zwiera ftalanówOgnioodpornyOdporny na alkoholOdporny na UVPrzeznaczony na zewnątrzOdporny na zadrapaniaOlejoodporny

+

Wypełnienie: średnio twarda pianka poliuretanowa o podwyższonej odporności na odkształcenia:

+ +

Certyfikat Oeko Tex Standard 100Atest higienicznyAtest higieniczny

+

+

+ +

Wałki rehabilitacyjne znajdują swoje zastosowanie w różnego rodzaju ćwiczeniach. Stosowane są w rehabilitacji ruchowej, podczas gimnastyki korekcyjnej, masaży tradycyjnych i sportowych, gdyż idealnie nadają się do unoszenia i separacji kończyn. Można je wykorzystać także do podpierania kolan, stóp, ramion, a także barków pacjenta. Wałki rehabilitacyjne polecane są także dla dzieci, wykorzystanie ich podczas zabawy, znacznie wspiera rozwój dużej motoryki. Produkt posiada certyfikację jako wyrób medyczny.

+ + + + + +Wałek rehabilitacyjny 10 x 30 cm + +dostępny + +na zamówienie + +

I. Czyszczenie i konserwacja

+

Tapicerkę należy czyścić powierzchniowo stosując dozwolone środki:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Rodzaj zabrudzenia

+
+

Dozwolone środki

+
+

Postępowanie

+
+

Codzienne zabrudzenia

+

+
+

Łagodny detergent najlepiej roztwór szarego mydła

+
+

Czyścić regularnie z użyciem gąbki lub miękkiej szczotki. Na koniec przetrzeć czyszczone miejsce wilgotną szmatką po czym wytrzeć do sucha (w celu usunięcia pozostałości detergentu).

+
+

Miejscowe, silniejsze zabrudzenia

+
+

25% roztwór alkoholu etylowego

+
+

Delikatnie przecierać nasączonym tamponem z gazy. Na koniec przetrzeć czyszczone miejsce wilgotną szmatką po czym wytrzeć do sucha (w celu usunięcia pozostałości detergentu).

+
+

Dezynfekcja

+
+

Ogólnodostępne środki do dezynfekcji zawierające:

+

- aktywny chlor – dichloroizocyjanuran sodu, max stężenie 10000 ppm

+

- aktywny chlor - dwutlenek chloru w roztworze do 20 000 ppm

+

- alkohol izopropylowy max stężenie 70 %

+

+
+

Dezynfekować zgodnie z zaleceniami producenta używanego środka.

+
+

Przed użyciem środka innego niż łagodny detergent trzeba sprawdzić efekt w niewidocznym miejscu, a samo czyszczenie wykonać bardzo ostrożnie.

+
+



II. Informacje

+

+ + + + + + + + + + + + + + + + + + + + + + + +
+

Szamponować przy użyciu gąbki

+
+

+
+

Nie prać!!! (delikatne wyroby)

+
+

+
+

Nie chlorować!!! (nie stosować do bielenia związków wydzielających wolny chlor)

+
+

+
+

Nie prasować!!! (nie dopuszczać do kontaktu z nagrzanymi powierzchniami np. kaloryfer)

+
+

+
+

Nie czyścić chemicznie!!!

+
+

+

III. Warunki gwarancji

+

Gwarancji nie podlegają:

+
diff --git a/app/service/productDescriptionService/test_out.txt b/app/service/productDescriptionService/test_out.txt deleted file mode 100644 index 350eff5..0000000 --- a/app/service/productDescriptionService/test_out.txt +++ /dev/null @@ -1,158 +0,0 @@ -

The use of rehabilitation rollers in various exercises and treatments positively affects the alleviation of injuries and increases the chances of the patient returning to full physical fitness. They are used in motor rehabilitation, during corrective gymnastics, traditional and sports massages, as they are ideal for lifting and separating limbs. They can also be used to support knees, feet, arms, and the patient’s shoulders. Rehabilitation rollers are also recommended for children; using them during play greatly supports the development of gross motor skills.

-

Thanks to a wide color range and varied sizes, it is possible to compose an exercise set necessary in every physiotherapy office, massage room, as well as in schools and kindergartens.

-

The rehabilitation roller is a medical device in accordance with the essential requirements for medical devices and the understanding of the Medical Devices Act, registered in the Medical Devices Register maintained by the Office for Registration of Medicinal Products, Medical Devices and Biocidal Products, equipped with the manufacturer's declaration of conformity and marked with the CE mark.

-

-

Medical device

-

Recommended uses:

- -

-

Material specification:

-

Cover: material with a PVC coating intended for medical devices, making it very easy to clean and disinfect:

- -

REACHOEKO-TEX Standard 100 CertificatePhthalate-freeFire-resistantAlcohol-resistantUV-resistantSuitable for outdoor useScratch-resistantOil-resistant

-

Filling: medium-hard polyurethane foam with increased resistance to deformation:

- -

OEKO-TEX Standard 100 CertificateHygienic certificateHygienic certificate

-

-

-

Rehabilitation rollers are used in various types of exercises. They are used in motor rehabilitation, during corrective gymnastics, traditional and sports massages, as they are ideal for lifting and separating limbs. They can also be used to support knees, feet, arms, and the patient’s shoulders. Rehabilitation rollers are also recommended for children; using them during play significantly supports the development of gross motor skills. The product is certified as a medical device.

- - -Rehabilitation roller 10 x 30 cm -available -on order -

I. Cleaning and maintenance

-

The upholstery should be cleaned superficially using permitted agents:

- - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Type of dirt

-
-

Permitted agents

-
-

Procedure

-
-

Everyday dirt

-

-
-

Mild detergent, preferably a solution of gray soap

-
-

Clean regularly using a sponge or soft brush. Finally, wipe the cleaned area with a damp cloth and then dry it (to remove detergent residues).

-
-

Local, stronger dirt

-
-

25% ethyl alcohol solution

-
-

Gently wipe with a gauze tampon soaked with the solution. Finally, wipe the cleaned area with a damp cloth and then dry it (to remove detergent residues).

-
-

Disinfection

-
-

Commercially available disinfectants containing:

-

- active chlorine – sodium dichloroisocyanurate, max concentration 10000 ppm

-

- active chlorine - chlorine dioxide in a solution up to 20000 ppm

-

- isopropyl alcohol max concentration 70%

-

-
-

Disinfect according to the recommendations of the product manufacturer.

-
-

Before using any agent other than a mild detergent, test the effect in an inconspicuous area, and perform cleaning very carefully.

-
-


II. Information

-

- - - - - - - - - - - - - - - - - - - - - - - -
-

Shampoo using a sponge

-
-

-
-

Do not wash!!! (delicate products)

-
-

-
-

Do not bleach!!! (do not use bleaching agents that release free chlorine)

-
-

-
-

Do not iron!!! (avoid contact with hot surfaces such as radiators)

-
-

-
-

Do not dry clean!!!

-
-

-

III. Warranty conditions

-

The warranty does not cover:

-
diff --git a/go.mod b/go.mod index 88c0b41..d11abf3 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/gofiber/fiber/v3 v3.1.0 github.com/golang-jwt/jwt/v5 v5.3.1 github.com/joho/godotenv v1.5.1 - github.com/openai/openai-go v1.12.0 github.com/openai/openai-go/v3 v3.28.0 golang.org/x/crypto v0.48.0 golang.org/x/oauth2 v0.36.0 diff --git a/go.sum b/go.sum index ca0cef2..9bef9b6 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= -github.com/openai/openai-go v1.12.0 h1:NBQCnXzqOTv5wsgNC36PrFEiskGfO5wccfCWDo9S1U0= -github.com/openai/openai-go v1.12.0/go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y= github.com/openai/openai-go/v3 v3.28.0 h1:2+FfrCVMdGXSQrBv1tLWtokm+BU7+3hJ/8rAHPQ63KM= github.com/openai/openai-go/v3 v3.28.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo= github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM=