Ë
    uPêjÈ  ã                   óp  — U d Z ddlZddlmZ ddlmZ ddlmZ  ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  d	ej                  «      ej                  f ej                  d
ej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  f ej                  dej                  «      ej                  fgZeeeee   ef         ed<   dedefd„Zy)a  
Rule-based classifier mapping a user prompt to a RequestType.

V0 design choice: deterministic regex over the FIRST user message in a session.
Result is cached per session (caller's responsibility, not ours).

Order matters: we check more specific types first, falling back to GENERAL.
é    N)ÚPattern)ÚFinal)ÚRequestTypez„\b(write|create|generate|implement|build)\s+(?:a |an |the |me )?(?:python|javascript|typescript|java|rust|go|c\+\+|sql|bash|shell)\bzw\b(write|create|implement|build)\b(?:\s+\w+){0,4}?\s+(function|class|method|script|program|api|endpoint|microservice)\bzo\b(explain|describe|understand|walk me through|what does)\b.*\b(code|function|method|class|algorithm|snippet)\bzt\b(debug|fix|why (?:is|does|isn't)|what.s wrong|trace)\b.*\b(error|bug|exception|stacktrace|stack trace|traceback)\bzN\b(review|critique)\s+(?:this |my |the )?(?:code|pr|pull request|diff|patch)\bzf\b(design|architect|plan|architecture)\b.*\b(system|service|api|database|schema|module|microservice)\bz²\b(should i (?:use|choose|pick)|tradeoffs? between|compare)\b.*\b(library|framework|language|database|protocol|postgres|postgresql|mongodb|dynamodb|mysql|redis|kafka|sql|nosql)\bz;\bhow (?:should|do) i (?:design|structure|organize|model)\bzd\b(solve|compute|calculate|prove|derive)\b.*\b(equation|integral|derivative|theorem|proof|problem)\bz-\b(if .+ then|given .+ find|suppose|assume)\bz?\b(probability|statistics|combinatorics|optimization problem)\bz€\b(write|draft|compose|rewrite|edit|proofread|polish)\b.*\b(email|essay|blog|post|article|letter|memo|copy|paragraph|sentence)\bzb\b(make (?:this|it)|help me)\s+(?:more |less )?(?:concise|formal|casual|professional|persuasive)\bz7^\s*(who|what|when|where|which)\s+(?:is|was|were|are)\bz'^\s*(define|definition of|meaning of)\bz=^\s*how (?:do you spell|to spell|many .* are there|tall is)\bÚ_RULESÚtextÚreturnc                 ó¶   — | r| j                  «       st        j                  S | dd }t        D ]  \  }}|j	                  |«      sŒ|c S  t        j                  S )z‰
    Classify a single user prompt.

    Falls back to GENERAL when no rule matches. Empty/whitespace-only also
    returns GENERAL.
    NiÐ  )Ústripr   ÚGENERALr   Úsearch)r   Ú	truncatedÚpatternÚrequest_types       úw/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/router_strategy/adaptive_router/classifier.pyÚclassify_promptr   {   sZ   € ñ �t—z‘z”|Ü×"Ñ"Ð"à˜E˜T�{€Iä!'ò  Ñˆ�Ø�>‰>˜)Õ$ØÒð ô ×ÑÐó    )Ú__doc__Úrer   Útypingr   Úlitellm.types.routerr   ÚcompileÚ
IGNORECASEÚCODE_GENERATIONÚCODE_UNDERSTANDINGÚTECHNICAL_DESIGNÚANALYTICAL_REASONINGÚWRITINGÚFACTUAL_LOOKUPr   ÚlistÚtupleÚstrÚ__annotations__r   © r   r   ú<module>r$      sõ  ðòó 
Ý Ý å ,ð 	ˆ�
‰
ð TØ�M‰Mó	
ð 	×#Ñ#ðð 	ˆ�
‰
ð GØ�M‰Mó	
ð 	×#Ñ#ðð 	ˆ�
‰
Ø~Ø�M‰Mó	
ð 	×&Ñ&ðð 	ˆ�
‰
ð DØ�M‰Mó	
ð 	×&Ñ&ðð 	ˆ�
‰
Ø]Ø�M‰Mó	
ð 	×&Ñ&ðð 	ˆ�
‰
ØuØ�M‰Mó	
ð 	×$Ñ$ðð 	ˆ�
‰
ð BØ�M‰Mó	
ð 	×$Ñ$ðð 	ˆ�
‰
ØJØ�M‰Mó	
ð 	×$Ñ$ðð 	ˆ�
‰
ØsØ�M‰Mó	
ð 	×(Ñ(ðð 	ˆ�
‰
ÐCÀRÇ]Á]ÓSØ×(Ñ(ðð
 	ˆ�
‰
ØNØ�M‰Mó	
ð 	×(Ñ(ðð 	ˆ�
‰
ð PØ�M‰Mó	
ð 	×Ñðð 	ˆ�
‰
ØqØ�M‰Mó	
ð 	×Ñðð 	ˆ�
‰
ÐMÈrÏ}É}Ó]Ø×"Ñ"ðð
 	ˆ�
‰
Ð=¸r¿}¹}ÓMØ×"Ñ"ðð
 	ˆ�
‰
ØLØ�M‰Mó	
ð 	×"Ñ"ððCh9€ˆˆd�5˜ ™ {Ð2Ñ3Ñ4Ñ5ó hðV˜#ð  +ô r   