MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / context_overflow_message

Function context_overflow_message

server/src/server/http_server.cpp:89–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87#endif
88
89namespace dflash::common {
90
91static 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

Callers 2

route_requestMethod · 0.85
worker_loopMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected