From aef1c193dcf131764e422aebfaad4c01261874e0 Mon Sep 17 00:00:00 2001 From: ARYA SINGH Date: Thu, 3 Oct 2024 18:50:23 +0530 Subject: [PATCH] syncfusion-stablility --- .github/workflows/main.yml | 8 +-- README.md | 4 +- .../infrastructure/geminiai/geminiService.js | 52 ++++++++++++------- 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d78a5a..351d5bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,12 +26,12 @@ jobs: uses: ncipollo/release-action@v1 with: artifacts: "build/app/outputs/apk/release/*" - tag: v2.0.3 + tag: v2.0.3.1 token: ${{ secrets.TOKEN }} - release_name: "stable-build-v2" + release_name: "stable-build-v2.0.3.1" body: | - ## What's New in v2.0.3 - - **Bug Fixes**: Resolved an issue where all three quotes would display at the same time. + ## What's New in v2.0.3.1 + - **Bug Fixes**: Resolved an issue where all quotes & mood would become repetitive. - **Performance Improvements**: Optimized API response times. - **UI Enhancements**: Updated the home UI and improved navigation for a smoother experience. diff --git a/README.md b/README.md index 8fdc502..f2b35a4 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ **NEW** -## What's New in v2.0.2 - - **Bug Fixes**: Resolved an issue where all three quotes would display at the same time. +## What's New in v2.0.3.1 + - **Bug Fixes**: Resolved an issue where all quotes & mood would become repetitive. - **Performance Improvements**: Optimized API response times. - **UI Enhancements**: Updated the home UI and improved navigation for a smoother experience. diff --git a/server/Mental Health api/infrastructure/geminiai/geminiService.js b/server/Mental Health api/infrastructure/geminiai/geminiService.js index 73fa3d8..515ce3d 100644 --- a/server/Mental Health api/infrastructure/geminiai/geminiService.js +++ b/server/Mental Health api/infrastructure/geminiai/geminiService.js @@ -62,8 +62,12 @@ class GeminiApi extends QuoteRepository{ "You are doing great! Keep up the good work and stay positive" + if mood is "sad", the response could be: + "It's okay to feel sad sometimes. Remember to take care of yourself and reach out to someone you trust for support" - so the mood is : ${mood} + so the mood of the user is : ${mood} + + onrefresh provide new advice on each request return only the string no brackets no keyword no JSON nothing @@ -99,11 +103,29 @@ class GeminiApi extends QuoteRepository{ // const result = generateText(prompt); + - const result = await model.generateContent(prompt); - const response = await result.response; - const text = response.text(); - return text; + const res = await groq.chat.completions.create({ + messages: [ + { + role: "user", + content: prompt, + }, + ], + model: "llama3-8b-8192", + + temperature: 1, + max_tokens: 2048, + + + }); + + return res.choices[0].message.content; + + // const result = await model.generateContent(prompt); + // const response = await result.response; + // const text = response.text(); + // return text; } async getDailyQuotes(){ @@ -116,22 +138,9 @@ class GeminiApi extends QuoteRepository{ noonQuote: "Your noon quote here", eveningQuote: "Your evening quote here" } + Provide concise and precise quotes that are inspirational and motivational. The quotes should be different for each part of the day. - return only those values for the quotes in which the current INDIAN STANDARD TIME falls. For example, if the IST (INDIAN STANDARD TIME) is 05:00:00 then the response is: - - { - morningQuote: "Your morning quote here", - noonQuote: "To be provided at noon", - eveningQuote: "To be provided in the evening" - } - - - reference for time , do not include any source code in the response and omit the word json in the response: - 00:00:00 to 11:59:59 - morning - 12:00:00 to 17:59:59 - noon - 18:00:00 to 23:59:59 - evening - - provide new quotes on each request + do not include any source code in the response and omit the word json in the response also provide new quotes on each request `; @@ -145,6 +154,9 @@ class GeminiApi extends QuoteRepository{ ], model: "llama3-8b-8192", response_format: { type: "json_object" }, + temperature: 1, + max_tokens: 2048, + });