
    h!              	          d Z ddlZddlmZmZmZmZmZmZm	Z	m
Z
 ddlmZmZmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'  e       Z( e       Z)dee   de!fdZ*e(jW                  ddg ee      ge!      d        Z,e(jW                  ddg ee      ge!      d        Z- G d de      Z.e(j_                  ddg ee      g      de.fd       Z0 G d de      Z1e(je                  ddg ee      g      de3de1fd       Z4e(jk                  ddg ee      g      de3fd       Z6e(jo                  ddg ee      g      de3de#fd        Z8e(jW                  ddg ee      g      e(jW                  d!dg ee      g      de3fd"              Z9e(jW                  d#dg ee      g      d$        Z:d%ede3fd&Z;d'edee3   fd(Z<d%edeee3      fd)Z=d%ede3fd*Z>d%edeee3      fd+Z?	 d3d,ee   d-e@dee3ef   fd.ZAd/ee   dee3ef   fd0ZBe(jW                  d1dg ee      g      d2        ZCy)4z
CRUD ENDPOINTS FOR GUARDRAILS
    N)AnyDictListOptionalTypeTypeVarUnioncast)	APIRouterDependsHTTPException)	BaseModel)verbose_proxy_logger)DEFAULT_MAX_RECURSE_DEPTH)user_api_key_auth)GuardrailRegistry)PII_ENTITY_CATEGORIES_MAPBedrockGuardrailConfigModel	GuardrailGuardrailEventHooksGuardrailInfoResponseGuardrailUIAddGuardrailSettingsLakeraV2GuardrailConfigModelListGuardrailsResponseLitellmParamsPatchGuardrailRequest	PiiActionPiiEntityType(PresidioPresidioConfigModelUserInterfaceSupportedGuardrailIntegrationsguardrails_configreturnc           
          g }| D ]L  }|j                  t        |j                  d      |j                  d      |j                  d                   N t        |      S )z=
    Helper function to get the guardrails list response
    guardrail_namelitellm_paramsguardrail_info)r$   r%   r&   
guardrails)appendr   getr   )r!   guardrail_configs	guardrails      h/var/www/Befach/backend/env/lib/python3.12/site-packages/litellm/proxy/guardrails/guardrail_endpoints.py_get_guardrails_list_responser.   &   s_     68&	  !(}}-=>(}}-=>(}}-=>	
 ' "->??    z/guardrails/list
Guardrails)tagsdependenciesresponse_modelc                     K   ddl m}  | j                  }t        t        t
        t              |j                  d            }|t        g       S t        |      S w)ur  
    List the guardrails that are available on the proxy server

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    Example Request:
    ```bash
    curl -X GET "http://localhost:4000/guardrails/list" -H "Authorization: Bearer <your_api_key>"
    ```

    Example Response:
    ```json
    {
        "guardrails": [
            {
            "guardrail_name": "bedrock-pre-guard",
            "guardrail_info": {
                "params": [
                {
                    "name": "toxicity_score",
                    "type": "float",
                    "description": "Score between 0-1 indicating content toxicity level"
                },
                {
                    "name": "pii_detection",
                    "type": "boolean"
                }
                ]
            }
            }
        ]
    }
    ```
    r   )proxy_configr(   )	litellm.proxy.proxy_serverr5   configr
   r   listdictr*   r.   )r5   r7   _guardrails_configs      r-   list_guardrailsr;   8   sS     R 8  FhtDz2FJJ|4LM!,R00();<<s   AAz/v2/guardrails/listc                    K   ddl m}  ddlm} |t	        dd      	 t
        j                  |       d{   }g }t               }|D ]  }|j                  t        |j                  d      |j                  d	      |j                  d
      |j                  d      |j                  d      |j                  d      d             |j                  |j                  d              | j                         }|D ]  }|j                  d      |vs|j                  t        |j                  d      |j                  d	      t        |j                  d
      xs i       t        |j                  d      xs i       d             |j                  |j                  d              t        |      S 7 # t        $ r3}t!        j"                  d|        t	        dt%        |            d}~ww xY ww)u  
    List the guardrails that are available in the database using GuardrailRegistry

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    Example Request:
    ```bash
    curl -X GET "http://localhost:4000/v2/guardrails/list" -H "Authorization: Bearer <your_api_key>"
    ```

    Example Response:
    ```json
    {
        "guardrails": [
            {
                "guardrail_id": "123e4567-e89b-12d3-a456-426614174000",
                "guardrail_name": "my-bedrock-guard",
                "litellm_params": {
                    "guardrail": "bedrock",
                    "mode": "pre_call",
                    "guardrailIdentifier": "ff6ujrregl1q",
                    "guardrailVersion": "DRAFT",
                    "default_on": true
                },
                "guardrail_info": {
                    "description": "Bedrock content moderation guardrail"
                }
            }
        ]
    }
    ```
    r   IN_MEMORY_GUARDRAIL_HANDLERprisma_clientN  Prisma client not initializedstatus_codedetailguardrail_idr$   r%   r&   
created_at
updated_atdb)rF   r$   r%   r&   rG   rH   guardrail_definition_locationr7   )rF   r$   r%   r&   rJ   r'   z"Error getting guardrails from db: )+litellm.proxy.guardrails.guardrail_registryr>   r6   r@   r   GUARDRAIL_REGISTRYget_all_guardrails_from_dbsetr)   r   r*   addlist_in_memory_guardrailsr9   r   	Exceptionr   	exceptionstr)r>   r@   r(   r+   seen_guardrail_idsr,   in_memory_guardrailses           r-   list_guardrails_v2rW   m   s    N X84STT(<-HH' I 
 

 :< U#I$$%!*~!>#,==1A#B#,==1A#B#,==1A#B(}}\:(}}\:26
 ""9==#@A $  ;TTV-I}}^,4FF!(()%.]]>%B'0}}5E'F'+IMM:J,K,Qr'R'+IMM:J,K,Qr'R6> #&&y}}^'DE . &1BCCI
J  <&&)KA3'OPCF;;<s@   G9F: F7CF: B"F: 6G97F: :	G6.G11G66G9c                       e Zd ZU eed<   y)CreateGuardrailRequestr,   N__name__
__module____qualname__r   __annotations__ r/   r-   rY   rY          r/   rY   z/guardrails)r1   r2   requestc                   K   ddl m} |t        dd      	 t        j	                  | j
                  |       d{   }|S 7 # t        $ r3}t        j                  d|        t        dt        |            d}~ww xY ww)	u  
    Create a new guardrail

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    Example Request:
    ```bash
    curl -X POST "http://localhost:4000/guardrails" \
        -H "Authorization: Bearer <your_api_key>" \
        -H "Content-Type: application/json" \
        -d '{
            "guardrail": {
                "guardrail_name": "my-bedrock-guard",
                "litellm_params": {
                    "guardrail": "bedrock",
                    "mode": "pre_call",
                    "guardrailIdentifier": "ff6ujrregl1q",
                    "guardrailVersion": "DRAFT",
                    "default_on": true
                },
                "guardrail_info": {
                    "description": "Bedrock content moderation guardrail"
                }
            }
        }'
    ```

    Example Response:
    ```json
    {
        "guardrail_id": "123e4567-e89b-12d3-a456-426614174000",
        "guardrail_name": "my-bedrock-guard",
        "litellm_params": {
            "guardrail": "bedrock",
            "mode": "pre_call",
            "guardrailIdentifier": "ff6ujrregl1q",
            "guardrailVersion": "DRAFT",
            "default_on": true
        },
        "guardrail_info": {
            "description": "Bedrock content moderation guardrail"
        },
        "created_at": "2023-11-09T12:34:56.789Z",
        "updated_at": "2023-11-09T12:34:56.789Z"
    }
    ```
    r   r?   NrA   rB   rC   )r,   r@   zError adding guardrail to db: )
r6   r@   r   rL   add_guardrail_to_dbr,   rQ   r   rR   rS   )ra   r@   resultrV   s       r-   create_guardrailre      s     j 94STT<)==''} > 
 
 
  <&&)Gs'KLCF;;<s8   B$A AA BA 	B.A==BBc                       e Zd ZU eed<   y)UpdateGuardrailRequestr,   NrZ   r_   r/   r-   rg   rg     r`   r/   rg   z/guardrails/{guardrail_id}rF   c                 d  K   ddl m} |t        dd      	 t        j	                  | |       d{   }|t        dd	|  d
      t        j                  | |j                  |       d{   }|S 7 C7 # t        $ r}|d}~wt        $ r}t        dt        |            d}~ww xY ww)u  
    Update an existing guardrail

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    Example Request:
    ```bash
    curl -X PUT "http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \
        -H "Authorization: Bearer <your_api_key>" \
        -H "Content-Type: application/json" \
        -d '{
            "guardrail": {
                "guardrail_name": "updated-bedrock-guard",
                "litellm_params": {
                    "guardrail": "bedrock",
                    "mode": "pre_call",
                    "guardrailIdentifier": "ff6ujrregl1q",
                    "guardrailVersion": "1.0",
                    "default_on": true
                },
                "guardrail_info": {
                    "description": "Updated Bedrock content moderation guardrail"
                }
            }
        }'
    ```

    Example Response:
    ```json
    {
        "guardrail_id": "123e4567-e89b-12d3-a456-426614174000",
        "guardrail_name": "updated-bedrock-guard",
        "litellm_params": {
            "guardrail": "bedrock",
            "mode": "pre_call",
            "guardrailIdentifier": "ff6ujrregl1q",
            "guardrailVersion": "1.0",
            "default_on": true
        },
        "guardrail_info": {
            "description": "Updated Bedrock content moderation guardrail"
        },
        "created_at": "2023-11-09T12:34:56.789Z",
        "updated_at": "2023-11-09T13:45:12.345Z"
    }
    ```
    r   r?   NrA   rB   rC   rF   r@     Guardrail with ID 
 not foundrF   r,   r@   )	r6   r@   r   rL   get_guardrail_by_id_from_dbupdate_guardrail_in_dbr,   rQ   rS   )rF   ra   r@   existing_guardrailrd   rV   s         r-   update_guardrailrq     s     j 94STT<#5#Q#Q%] $R $
 
 %*<\N*(U  *@@%''' A 
 

 

   <CF;;<sV   B0A; A7<A; 0A91A; 6B07A; 9A; ;	B-BB-B((B--B0c                 ~  K   ddl m} ddlm} |t	        dd      	 t
        j                  | |       d{   }|t	        d	d
|  d      t
        j                  | |       d{   }|j                  |        |S 7 J7 # t        $ r}|d}~wt        $ r}t	        dt        |            d}~ww xY ww)u  
    Delete a guardrail

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    Example Request:
    ```bash
    curl -X DELETE "http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \
        -H "Authorization: Bearer <your_api_key>"
    ```

    Example Response:
    ```json
    {
        "message": "Guardrail 123e4567-e89b-12d3-a456-426614174000 deleted successfully"
    }
    ```
    r   r=   r?   NrA   rB   rC   ri   rj   rk   rl   rF   )rK   r>   r6   r@   r   rL   rn   delete_guardrail_from_dbdelete_in_memory_guardrailrQ   rS   )rF   r>   r@   rp   rd   rV   s         r-   delete_guardrailrv   b  s     0 X84STT<#5#Q#Q%] $R $
 
 %*<\N*(U  *BB%] C 
 

 	$>>% 	? 	
 #

   <CF;;<sV   B=B B1B +B,B B=B B 	B:BB:B55B::B=c           
      t  K   ddl m} ddlm} |t	        dd      	 t
        j                  | |       d{   }|t	        d	d
|  d      |j                  |j                  n|j                  d      }t        di t        |j                  di             }|j                  J|j                  j                  d      }|j                  d      }|j                  |       t        di |}|j                  |j                  n|j                  di       }	t        | |xs d||	      }
t
        j!                  | |
|       d{   }|j#                  | |
       |S 7 -7 # t        $ r}|d}~wt$        $ r3}t'        j(                  d|        t	        dt+        |            d}~ww xY ww)u  
    Partially update an existing guardrail

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    This endpoint allows updating specific fields of a guardrail without sending the entire object.
    Only the following fields can be updated:
    - guardrail_name: The name of the guardrail
    - default_on: Whether the guardrail is enabled by default
    - guardrail_info: Additional information about the guardrail

    Example Request:
    ```bash
    curl -X PATCH "http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000" \
        -H "Authorization: Bearer <your_api_key>" \
        -H "Content-Type: application/json" \
        -d '{
            "guardrail_name": "updated-name",
            "default_on": true,
            "guardrail_info": {
                "description": "Updated description"
            }
        }'
    ```

    Example Response:
    ```json
    {
        "guardrail_id": "123e4567-e89b-12d3-a456-426614174000",
        "guardrail_name": "updated-name",
        "litellm_params": {
            "guardrail": "bedrock",
            "mode": "pre_call",
            "guardrailIdentifier": "ff6ujrregl1q",
            "guardrailVersion": "DRAFT",
            "default_on": true
        },
        "guardrail_info": {
            "description": "Updated description"
        },
        "created_at": "2023-11-09T12:34:56.789Z",
        "updated_at": "2023-11-09T14:22:33.456Z"
    }
    ```
    r   r=   r?   NrA   rB   rC   ri   rj   rk   rl   r$   r%   T)exclude_unsetr&    )rF   r$   r%   r&   rm   )rF   r,   zError updating guardrail: r_   )rK   r>   r6   r@   r   rL   rn   r$   r*   r   r9   r%   
model_dumpupdater&   r   ro   update_in_memory_guardrailrQ   r   rR   rS   )rF   ra   r>   r@   rp   r$   r%   requested_litellm_paramslitellm_params_dictr&   r,   rd   rV   s                r-   patch_guardrailr     s    f X84STT<<#5#Q#Q%] $R $
 
 %*<\N*(U  %%1 ""#''(89 	 ' 
%))*:B?@
 !!-'.'='='H'H" (I ($ #1";";$";"O&&'?@*A-@AN
 %%1 ""#''(8"= 	 %)/R))	
	 *@@%' A 
 
 	$>>% 	? 	
 k
T
   <&&)CA3'GHCF;;<sW   F8E+ E&DE+ E)E+ %F8&E+ )E+ +	F54E66F5.F00F55F8z/guardrails/{guardrail_id}/infoc           
        K   ddl m} ddlm} ddlm} |t        dd      	 t        j                  | |	       d{   }||j                  | 
      }|t        dd|  d      |j                  d      }t        |t              r|j                  d      n|xs i } ||dd      }t        |j                  d      |j                  d      |t        |j                  d      xs i       |j                  d      |j                  d            S 7 # t        $ r}|d}~wt         $ r}t        dt#        |            d}~ww xY ww)u  
    Get detailed information about a specific guardrail by ID

    👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)

    Example Request:
    ```bash
    curl -X GET "http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000/info" \
        -H "Authorization: Bearer <your_api_key>"
    ```

    Example Response:
    ```json
    {
        "guardrail_id": "123e4567-e89b-12d3-a456-426614174000",
        "guardrail_name": "my-bedrock-guard",
        "litellm_params": {
            "guardrail": "bedrock",
            "mode": "pre_call",
            "guardrailIdentifier": "ff6ujrregl1q",
            "guardrailVersion": "DRAFT",
            "default_on": true
        },
        "guardrail_info": {
            "description": "Bedrock content moderation guardrail"
        },
        "created_at": "2023-11-09T12:34:56.789Z",
        "updated_at": "2023-11-09T12:34:56.789Z"
    }
    ```
    r   )_get_masked_valuesr=   r?   NrA   rB   rC   ri   rs   rj   rk   rl   r%   T)exclude_none   )unmasked_lengthnumber_of_asterisksrF   r$   r&   rG   rH   )rF   r$   r%   r&   rG   rH   )*litellm.litellm_core_utils.litellm_loggingr   rK   r>   r6   r@   r   rL   rn   get_guardrail_by_idr*   
isinstancer   rz   r   r9   rQ   rS   )	rF   r   r>   r@   rd   r%   result_litellm_params_dictmasked_litellm_params_dictrV   s	            r-   get_guardrail_infor     s|    V NW84STT'<)EE%] F 
 
 >0DD) E F >*<\N*(U  @Fzz@

 .-8 %%4%8& 	 	#
 &8& !&
" %N3!::&675

+; < BCzz,/zz,/
 	
7
F   <CF;;<sF   "ED D CD ED 	E#D%%E1EEEz%/guardrails/ui/add_guardrail_settingsc                     K   g } t        j                         D ]  \  }}| j                  ||d        t        t	        t
              t	        t              t	        t              |       S w)z
    Get the UI settings for the guardrails

    Returns:
    - Supported entities for guardrails
    - Supported modes for guardrails
    - PII entity categories for UI organization
    )categoryentities)supported_entitiessupported_actionssupported_modespii_entity_categories)r   itemsr)   r   r8   r   r   r   )category_mapsr   r   s      r-   get_guardrail_ui_settingsr   n  sc      M7==?((IJ @ +.y/01+	 s   A)A+field_annotationc                 *   t        | d      rN| j                  t        u r<t        | d      r0| j                  }|D cg c]  }|t	        d      us| }}|r|d   } t        | d      r| j                  t
        u ryt        | d      r| j                  t        u ryt        | d      r4t        | d      r(| j                  }t        |d      r|j                  dk(  ry	| t        u ry
| t        u ry| t        u ry| t        u ry| t        u ry| t
        u ryy
c c}w )zG
    Convert a Python type annotation to a UI-friendly type string
    
__origin____args__Nr   arrayr9   r[   Literalselectstringnumberbooleanobject)hasattrr   r	   r   typer8   r9   r[   rS   intfloatbool)r   argsargnon_none_argsorigins        r-   _get_field_type_from_annotationr     s-    	 ,/''50$j1  (((,F4:0EFF,Q/ .3C3N3NRV3V .3C3N3NRV3V .7*4 ",,6:&6??i+G 3	S	 	U	"	T	!	T	!	T	! I Gs   DD
annotationc                     t        | d      rHt        | d      r<| j                  }t        |d      r$|j                  dk(  rt        | j                        S g S )z?
    Extract literal values from a Literal type annotation
    r   r   r[   r   )r   r   r[   r8   r   )r   r   s     r-   _extract_literal_valuesr     sM     z<(WZ-L&&6:&6??i+G
++,,Ir/   c                     t        | d      rH| j                  t        u r6t        | d      r*| j                  }t	        |      dk\  r|d   }t        |      S y)z>
    Extract key options from Dict[Literal[...], T] types
    r   r      r   N)r   r   r9   r   lenr   )r   r   key_types      r-   _get_dict_key_optionsr     sU    
 	 ,/''4/$j1((t9>AwH*844r/   c                     t        | d      rH| j                  t        u r6t        | d      r*| j                  }t	        |      dk\  r|d   }t        |      S y)z2
    Get the value type from Dict[K, V] types
    r   r   r      r   )r   r   r9   r   r   r   )r   r   
value_types      r-   _get_dict_value_typer     sU    
 	 ,/''4/$j1((t9>aJ2:>>r/   c                     t        | d      rH| j                  t        u r6t        | d      r*| j                  }t	        |      dk\  r|d   }t        |      S y)z?
    Extract element options from List[Literal[...]] types
    r   r   r   r   N)r   r   r8   r   r   r   )r   r   element_types      r-   _get_list_element_optionsr     sU    
 	 ,/''4/$j1((t9>7L*<88r/   modeldepthc                    |t         kD  rt        ddt          d      i }| j                  j                         D ]  \  }}|dk(  rY|j                  }|t        |t              st        |d      r|j                  t        u rJt        |d      r|j                  dv re|j                  xs |}|j                         }|j                  }|t        |d      rN|j                  t        u r<t        |d	      r0|j                  }|D 	cg c]  }	|	t        d       us|	 }
}	|
r|
d
   }t        j                   |      xr t#        |t$              xr |t$        u}|r0t'        t)        t*        t$           |      |dz         }||d|d||<   Qt-        |      }t/        |di       }|rd|v r|d   j0                  }n|r	d|v r|d   }|||d}|dk(  r#t3        |      }|r||d<   t5        |      }||d<   n|dk(  rt7        |      }|r
||d<   d|d<   |rd|v r|d   |d<   |j8                  |j8                  dur|j8                  |d<   |||<    |S c c}	w )Ni  zMax depth of z` exceeded while processing model fields. Please check the model structure for excessive nesting.rC   optional_paramsr   r[   )Tr   r   r   r   nested)descriptionrequiredr   fieldsjson_schema_extraui_typer   )r   r   r   r9   dict_key_optionsdict_value_typer   optionsmultiselect.default_value)r   r   model_fieldsr   r   r   r   r   r   r[   r   is_requiredr	   r   r   inspectisclass
issubclassr   _extract_fields_recursiver
   r   r   getattrvaluer   r   r   default)r   r   r   
field_namefieldr   r   r   r   r   r   is_basemodel_subclassnested_fields
field_typefield_json_schema_extra
field_dictr   r   list_element_optionss                      r-   r   r     s    (("#<"=  >^  _
 	

 F"//557
E**$//'*G4(,7$//7: '49I9R9R W :  ''5: $$& !++ # $l3 ++u4(*5 $,,D,0JSCtDz4ISJMJ#0#3  OO,- 2+Y72 	1 	 !5T)_&67M  +$ '	"F: 99IJJ '.e5H"&M#&98O+O4Y?EE
(V7N-N4V<
  +$"J V##89I#J #5EJ12 #77G"H0?
,-w&'@AQ'R$',@Jy))6Jv& '98O+O(?	(J
9% }}(U]]#-E.3mm
?+!+F:U 8X MI Ks   	IImodel_classc                     t        | d      S )zO
    Get the fields from a Pydantic model as a nested dictionary structure
    r   )r   )r   )r   s    r-   _get_fields_from_modelr   t  s    
 %[::r/   z'/guardrails/ui/provider_specific_paramsc                    K   t        t              } t        t              }t        t              }t        j
                  j                  | t        j                  j                  |t        j                  j                  |i}ddl	m
} |j                         D ]=  \  }}|j                         }|st        |      }|j                         }	|	|d<   |||<   ? |S w)a  
    Get provider-specific parameters for different guardrail types.

    Returns a dictionary mapping guardrail providers to their specific parameters,
    including parameter names, descriptions, and whether they are required.

    Example Response:
    ```json
    {
        "bedrock": {
            "guardrailIdentifier": {
                "description": "The ID of your guardrail on Bedrock",
                "required": true,
                "type": null
            },
            "guardrailVersion": {
                "description": "The version of your Bedrock guardrail (e.g., DRAFT or version number)",
                "required": true,
                "type": null
            }
        },
        "azure_content_safety_text_moderation": {
            "api_key": {
                "description": "API key for the Azure Content Safety Text Moderation guardrail",
                "required": false,
                "type": null
            },
            "optional_params": {
                "description": "Optional parameters for the Azure Content Safety Text Moderation guardrail",
                "required": true,
                "type": "nested",
                "fields": {
                    "severity_threshold": {
                        "description": "Severity threshold for the Azure Content Safety Text Moderation guardrail across all categories",
                        "required": false,
                        "type": null
                    },
                    "categories": {
                        "description": "Categories to scan for the Azure Content Safety Text Moderation guardrail",
                        "required": false,
                        "type": "multiselect",
                        "options": ["Hate", "SelfHarm", "Sexual", "Violence"],
                        "default_value": None
                    }
                }
            }
        }
    }
    ```
    r   )guardrail_class_registryui_friendly_name)r   r   r   r   r    BEDROCKr   PRESIDIO	LAKERA_V2rK   r   r   get_config_modelr   )
bedrock_fieldspresidio_fieldslakera_v2_fieldsprovider_paramsr   r$   guardrail_classguardrail_config_modelr   r   s
             r-   get_provider_specific_paramsr   |  s     r ,,GHN,-UVO-.JK 	'..44n&//55&00668HO U+C+I+I+K'!0!A!A!C!+,BCF5FFH)9F%&.4ON+ ,L s   B,C/)C)r   )D__doc__r   typingr   r   r   r   r   r   r	   r
   fastapir   r   r   pydanticr   litellm._loggingr   litellm.constantsr   $litellm.proxy.auth.user_api_key_authr   rK   r   litellm.types.guardrailsr   r   r   r   r   r   r   r   r   r   r   r   r   r    routerrL   r.   r*   r;   rW   rY   postre   rg   putrS   rq   deleterv   patchr   r   r   r   r   r   r   r   r   r   r   r   r_   r/   r-   <module>r      s    H H H 5 5  1 7 B I   & 
&( @Dz@@$ 
+,-)	  ,=,=^ 
+,-)	  O<O<dY  
+,-  
<<$: <<
<<~Y   
+,-  
I< I<7M I<
I<X  
+,-  
0< 0<
0<f  
+,-  
p< p<6K p<
p<f  
+,-  
 %
+,-  
O<3 O<O<d +
+,-  

,0c 0c 0f S	 C HT#Y4G  3 3   c8K $ z	?zz 
#s(^zz;Y ;DcN ; -
+,-  
K
Kr/   