[Feature Request] Increase the calculation of tokens
Context / Scenario
When using Kernel Memory, whether it is Import or Ask, I hope to increase the consumption of returning tokens, so that I can analyze the cost of question and answer scenarios
The problem
Increase the return value of token consumption
Proposed solution
Increase the return value of token consumption
Importance
would be great to have
https://github.com/microsoft/kernel-memory/issues/277#issuecomment-1912520930
I found this solution, try to set MaxTokenTotal
}).WithAzureOpenAITextGeneration(new AzureOpenAIConfig()
{
Endpoint = azureOpenAi.SummarizationModel.Endpoint,
APIKey = azureOpenAi.SummarizationModel.ApiKey,
Deployment = azureOpenAi.SummarizationModel.DeploymentOrModelId,
Auth = AzureOpenAIConfig.AuthTypes.APIKey,
// try this
MaxTokenTotal = 25000,
MaxRetries = 1230
}, httpClient: httpClient)
我找到了这个解决方案,尝试设置 MaxTokenTotal
}).WithAzureOpenAITextGeneration(new AzureOpenAIConfig() { Endpoint = azureOpenAi.SummarizationModel.Endpoint, APIKey = azureOpenAi.SummarizationModel.ApiKey, Deployment = azureOpenAi.SummarizationModel.DeploymentOrModelId, Auth = AzureOpenAIConfig.AuthTypes.APIKey, // try this MaxTokenTotal = 25000, MaxRetries = 1230 }, httpClient: httpClient)
What I hope to know is how many tokens are consumed per request Example
"usage": {
"completion_tokens": 207,
"prompt_tokens": 15,
"total_tokens": 222
}
Please feel free to use the poll at https://github.com/microsoft/kernel-memory/discussions/532 to vote for this feature