diff --git a/app/Config/Routes.php b/app/Config/Routes.php index d35f2951..ac723e59 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -46,6 +46,7 @@ $routes->get("frontend_content", "AppContentManagementController::frontend_conte // $routes->get('/', 'LoginController::index'); $routes->get('/test', 'Home::index'); +$routes->get('/check_gemini', 'Home::check_Gemini'); $routes->get('/login', 'LoginController::index'); ///auth/google $routes->get('/loginPos', 'LoginController::loginPos'); //login POS team $routes->post('/getVerifyPosMobileNo', 'LoginController::getVerifyPosMobileNo'); //Verify POS team mobile no diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 9f76bf77..09d3dc19 100755 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -2,6 +2,12 @@ namespace App\Controllers; + +use GeminiAPI\Client; +use GeminiAPI\Resources\ModelName; +use GeminiAPI\Resources\Parts\TextPart; + + class Home extends PublicController { public function index(): string @@ -28,4 +34,26 @@ class Home extends PublicController return $payload['a'] + $payload['b']; } + public function check_Gemini() + { + try { + $apiKey = 'AIzaSyBbx-uotRBqkYhqLpmD60420E_a0G0duP8'; + // Initialize the Gemini client + $client = new Client($apiKey); + + // Send a prompt to the Gemini Pro model + $response = $client->generativeModel(ModelName::GEMINI_PRO)->generateContent( + new TextPart('Write a short, creative story about a knight and a dragon.') + ); + + // Display the generated text + $data['gemini_response'] = $response->text(); + } catch (\Exception $e) { + // Handle any errors that occur during the API call + $data['gemini_response'] = 'An error occurred: ' . $e->getMessage(); + } + + print_rr($data); + } + } diff --git a/app/Controllers/ICICILombardController.php b/app/Controllers/ICICILombardController.php index e1c09e30..9433f7f1 100644 --- a/app/Controllers/ICICILombardController.php +++ b/app/Controllers/ICICILombardController.php @@ -62,9 +62,15 @@ class ICICILombardController extends AdminController //'Scope: esbgpabatchcreation' ]; + #old policy info start + #"PolicyNumber" => "4016/A/51974976/00/000", + # "CDBGAccountNumber" => "CD-MUM-3344", + #"CorrelationId" => "86383c78-4c67-4e4d-9aa0-8f926fb0d55f", + #old policy inf end + $body = [ - "PolicyNumber" => "4016/A/51974976/00/000", - "CDBGAccountNumber" => "CD-MUM-3344", + "PolicyNumber" => "4016/A/O/53077718/00/000", + "CDBGAccountNumber" => "CD-MUM-0026", "CorrelationId" => "86383c78-4c67-4e4d-9aa0-8f926fb0d55f", "MemberDetails" => [ [ @@ -74,8 +80,8 @@ class ICICILombardController extends AdminController "DOB" => "7-JUL-1983", "Relationship" => "SELF", "Gender" => "MALE", - "DOC" => "20-JAN-2020", - "SumInsured" => "600000", + "DOC" => "08-JUL-2025", + "SumInsured" => "400000", "EmailId" => "ABC@GMAIL.COM", "FlagStatus" => "A" ], @@ -86,8 +92,8 @@ class ICICILombardController extends AdminController "DOB" => "8-AUG-1970", "Relationship" => "MOTHER", "Gender" => "FEMALE", - "DOC" => "20-JAN-2020", - "SumInsured" => "600000", + "DOC" => "08-JUL-2025", + "SumInsured" => "400000", "EmailId" => "ABC@GMAIL.COM", "FlagStatus" => "A" ], @@ -97,13 +103,13 @@ class ICICILombardController extends AdminController "InsuredName" => "ABC28142", "DOB" => "8-SEP-1970", "Gender" => "MALE", - "SumInsured" => "600000", + "SumInsured" => "400000", "EmailId" => "ABC@GMAIL.COM", "FlagStatus" => "M" ], [ "UHID" => "IL00688842552", - "DOL" => "20-JAN-2020", + "DOL" => "08-JUL-2025", "FlagStatus" => "D" ] ] diff --git a/app/Libraries/Gemini.php b/app/Libraries/Gemini.php new file mode 100644 index 00000000..da610e96 --- /dev/null +++ b/app/Libraries/Gemini.php @@ -0,0 +1,46 @@ +myLogger = \Config\Services::mylogger(); + // $this->client = new Google_Client(); + // $this->client->setAuthConfig(ROOTPATH . 'nhance-app-google-drive.json'); // App credentials + // // putenv('GOOGLE_APPLICATION_CREDENTIALS=' . ROOTPATH . 'nhance-app-google-drive.json'); + // $this->client->useApplicationDefaultCredentials(); + + // $this->client->addScope(Google_Service_Drive::DRIVE); // Full access to Google Drive + } + + public function check() + { + try { + // Initialize the Gemini client + $client = new Client($apiKey); + + // Send a prompt to the Gemini Pro model + $response = $client->generativeModel(ModelName::GEMINI_PRO)->generateContent( + new TextPart('Write a short, creative story about a knight and a dragon.') + ); + + // Display the generated text + $data['gemini_response'] = $response->text(); + } catch (\Exception $e) { + // Handle any errors that occur during the API call + $data['gemini_response'] = 'An error occurred: ' . $e->getMessage(); + } + } + +} diff --git a/app/Views/chatbot.php b/app/Views/chatbot.php index 5fd18fae..b6e09688 100644 --- a/app/Views/chatbot.php +++ b/app/Views/chatbot.php @@ -6,12 +6,40 @@ Insurance ChatBot + + -

Loading...Please wait

+

Loading...