Hello everyone I have one query, How to implement a Gemini API in .net core (c#). I have try but I couldn't implement the API..
Loading
Hello everyone I have one query, How to implement a Gemini API in .net core (c#). I have try but I couldn't implement the API..
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Md SarfarajPosted Mar 17, 2024, 2:33 PM
You can checkout this documentation https://ai.google.dev/tutorials/rest_quickstart#multi-turn_conversations_chat
Tuhin PaulPosted Mar 17, 2024, 6:45 PM
Use
HttpClientto send authenticated requests to Gemini API endpoints. Refer to the Gemini API documentation for specific authentication mechanisms and endpoint URLs.Remember to replace placeholders (_apiUrl, _apiKey, _apiSecret) with your actual values and implement the
GenerateSignaturemethod based on Gemini's API documentation.Sourabh DhimanPosted Mar 15, 2024, 4:24 AM
I am talking about Google Bard (Gemini API).
Tuhin PaulPosted Mar 14, 2024, 7:50 PM
1. Placeholder Replacement:
"YOUR_API_KEY"and"YOUR_API_SECRET"with your actual API credentials before running the code.2. Error Handling in Signature Calculation:
CalculateSignaturefunction currently returns an empty string. Implement the actual signature calculation logic based on the Gemini API documentation. This likely involves using HMAC-SHA384 with the API secret and payload as inputs. Consider throwing an exception if signature calculation fails.3. Handling Additional Payload Parameters:
Jayraj ChhayaPosted Mar 14, 2024, 11:53 AM
you can follow these steps
Read the Gemini API Documentation for more details