Follow up from #144 (comment)
I am using Mscc.GenerativeAI.Microsoft to be able to map Gemini calls via the Microsoft.Extension.AI package and I am getting severely delayed responses due to the timeouts. Here is what I am doing per the sample
try
{
var chatClient = new GeminiChatClient(apiKey: settings.GoogleApiKey, model: settings.GoogleApiModel);
var messages = new List<Microsoft.Extensions.AI.ChatMessage>
{
new(ChatRole.User, "Hi")
};
var options = new ChatOptions
{
MaxOutputTokens = 10
};
var response = await chatClient.GetResponseAsync(messages, options);
var text = response.Text;
}
catch (GeminiApiTimeoutException ex)
{
var error = $"Google Gemini API error: {ex.Message}";
}
catch (TimeoutException ex)
{
var error = $"Google Gemini API error: {ex.Message}";
}
catch (GeminiApiException ex)
{
var error = $"Google Gemini API error: {ex.Message}";
}
catch (Exception ex)
{
var error = $"Google Gemini API error: {ex.Message}";
}
My question is how can I control the RequestOptions property if I am using IChatClient? Do I need to build a custom wrapper for GetResponseAsync() and etc? I would have assumed I can add RequestOptions directly to GeminiChatClient
Follow up from #144 (comment)
I am using
Mscc.GenerativeAI.Microsoftto be able to map Gemini calls via theMicrosoft.Extension.AIpackage and I am getting severely delayed responses due to the timeouts. Here is what I am doing per the sampleMy question is how can I control the
RequestOptionsproperty if I am usingIChatClient? Do I need to build a custom wrapper forGetResponseAsync()and etc? I would have assumed I can addRequestOptionsdirectly toGeminiChatClient