(content: str)
| 136 | |
| 137 | |
| 138 | def check_context_limit(content: str): |
| 139 | content = content.lower() |
| 140 | and_words = [ |
| 141 | ["prompt", "context", "tokens"], |
| 142 | [ |
| 143 | "limit", |
| 144 | "exceed", |
| 145 | "max", |
| 146 | "long", |
| 147 | "much", |
| 148 | "many", |
| 149 | "reach", |
| 150 | "over", |
| 151 | "up", |
| 152 | "beyond", |
| 153 | ], |
| 154 | ] |
| 155 | rule = AndRule( |
| 156 | [ |
| 157 | OrRule([ContainRule(word) for word in and_words[i]]) |
| 158 | for i in range(len(and_words)) |
| 159 | ] |
| 160 | ) |
| 161 | return rule.check(content) |
| 162 | |
| 163 | |
| 164 | class HTTPAgent(AgentClient): |
no test coverage detected