PawanOsman / ChatGPT.Net

C# library for ChatGPT using official OpenAI API
https://www.nuget.org/packages/ChatGPT.Net
MIT License
379 stars 71 forks source link

How to define user message size limit for particlular prompt? #45

Open lofti198 opened 8 months ago

lofti198 commented 8 months ago

My case is content summarization: I provide text and chatgpt to summarize it. How can define user message size limit for this particular prompt, ideally considering language of the user message (as I assume it can also affect)? I mean, I want to identify limit before sending the request, to be able to reduce the content (user message) in advance if it is needed. I can do that using just assumable token based calculation , but maye chatgpt.net itself has some special methods for this purpose?

Another question is - is the token size the same for different requests (with the samу physical amount of symbols)? For example I can ask to summarize text, which is (as I guess) more complicated operation, than lets say to extract first sentence for each text paragraph.