| 671 | class context_manager { |
| 672 | public: |
| 673 | context_manager(size_t max_context_tokens = 1024, size_t min_prompt_tokens = 100, |
| 674 | int padding_token = -1) : max_context_size_(max_context_tokens), |
| 675 | min_prompt_size_(min_prompt_tokens), padding_token_(padding_token) { |
| 676 | |
| 677 | if (min_prompt_tokens >= max_context_tokens) |
| 678 | throw std::invalid_argument("Minimum prompt size must be smaller than maximum context size"); |
| 679 | |
| 680 | if (min_prompt_tokens < 10) |
| 681 | throw std::invalid_argument("Minimum prompt size must be at least 10"); |
| 682 | } |
| 683 | |
| 684 | // Add a single token to the context |
| 685 | void add_token(int token) { |
nothing calls this directly
no outgoing calls
no test coverage detected