-
-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DDG Provider - 429 ERR_INPUT_LIMIT #2586
Comments
Hey, you could check message lengths in Python like this, see? |
I'm calling the API from C#. Btw the issue is very inconsistent. |
@BlyZeDev It gives is an approximate number of the characters. However, models usually rely more on the number of tokens in their language model. Please note that the models add and process all previous messages to the input length. If you do not want this, you must omit the old messages in your request. Or you start simply a new conversation. |
I'm currently doing it like this. Without specifying conversation or conversation_id a new conversation is created? var model = _config.GetAIChatModel();
var provider = _config.GetAIChatProvider();
HttpResponseMessage? response = null;
try
{
var messages = new List<AIChatMessage>
{
new AIChatMessage
{
Role = "system",
Content = SystemMessage
}
};
await foreach (var message in history)
{
messages.Add(message);
}
messages.Add(new AIChatMessage
{
Role = "user",
Content = prompt
});
var postJson = JsonConvert.SerializeObject(new AIChatRequest
{
Messages = messages,
Model = model,
Provider = provider,
WebSearch = true,
Temperature = 0.5f,
HistoryDisabled = true,
Stream = false,
MaxTokens = 400,
AutoContinue = true,
Timeout = (int)(_http.Timeout.TotalSeconds * 0.75)
}); |
Yes, some providers offer an internal conversation instance. Conversation reuse is facilitated by including the |
How do I know which providers offer this. |
Hey, I don't have a list of providers that support if "return_conversation" in g4f.Provider.Gemini.get_paramters(): Yeah, the RetryProvider doesn't support it yet. |
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again. |
Bug description
How can I find out the max conversation history character limit?
Environment
The text was updated successfully, but these errors were encountered: