| 87 | #endif |
| 88 | |
| 89 | namespace dflash::common { |
| 90 | |
| 91 | static std::string context_overflow_message(int max_ctx, int prompt_tokens, int max_output) { |
| 92 | const int requested_tokens = prompt_tokens + max_output; |
| 93 | return "This model's maximum context length is " + std::to_string(max_ctx) + |
| 94 | " tokens. However, you requested " + std::to_string(requested_tokens) + |
| 95 | " tokens (" + std::to_string(prompt_tokens) + " in the messages, " + |
| 96 | std::to_string(max_output) + |
| 97 | " in the completion). Please reduce the length of the messages or completion."; |
| 98 | } |
| 99 |
no outgoing calls
no test coverage detected