
    LKi                     ^    S SK JrJrJrJr  S SKJr  S SKr\(       a  S SKJ	r	   " S S5      r
g)    )TYPE_CHECKINGOptionalDictAny)UUIDN)	ServerAPIc                   P   \ rS rSrSrSSS\S\S\S\S	\S
\\\\	4      S\S\4S jr
\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       r\S\\\\	4      4S j5       r\S
\\	   S\\\	4   4S j5       rS\4S jrS\S\4S jrS\4S jrSrg)AttachedFunction	   z/Represents a function attached to a collection.clientr   idnamefunction_nameinput_collection_idoutput_collectionparamstenantdatabasec
                 p    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        g)a  Initialize an AttachedFunction.

Args:
    client: The API client
    id: Unique identifier for this attached function
    name: Name of this attached function instance
    function_name: The function name (e.g., "record_counter", "statistics")
    input_collection_id: ID of the input collection
    output_collection: Name of the output collection
    params: Function-specific parameters
    tenant: The tenant name
    database: The database name
N)	_client_id_name_function_name_input_collection_id_output_collection_params_tenant	_database)
selfr   r   r   r   r   r   r   r   r   s
             f/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/chromadb/api/models/AttachedFunction.py__init__AttachedFunction.__init__   s4    2 
+$7!"3!    returnc                     U R                   $ )z0The unique identifier of this attached function.)r   r   s    r    r   AttachedFunction.id/   s     xxr#   c                     U R                   $ )z,The name of this attached function instance.)r   r&   s    r    r   AttachedFunction.name4   s     zzr#   c                     U R                   $ )zThe function name.)r   r&   s    r    r   AttachedFunction.function_name9   s     """r#   c                     U R                   $ )zThe ID of the input collection.)r   r&   s    r    r   $AttachedFunction.input_collection_id>   s     (((r#   c                     U R                   $ )z"The name of the output collection.)r   r&   s    r    r   "AttachedFunction.output_collectionC   s     &&&r#   c                     U R                   $ )zThe function parameters.)r   r&   s    r    r   AttachedFunction.paramsH   s     ||r#   c                    U c  0 $ [        U [        5      (       a9   U (       a  [        R                  " U 5      O0 n[        U[        5      (       a  U$ 0 $ [        U [        5      (       a  U $ 0 $ ! [        R
                   a    0 s $ f = f)zeNormalize params to a consistent dict format.

Handles None, empty strings, JSON strings, and dicts.
)
isinstancestrjsonloadsdictJSONDecodeError)r   results     r    _normalize_params"AttachedFunction._normalize_paramsM   s~     >Ifc""/5F+2!+FD!9!9vArA fd##M		 '' 	s   5A- A- -BBc                     SU R                    SU R                   SU R                   SU R                   SU R                   S3$ )NzAttachedFunction(id=z, name='z', function_name='z', input_collection_id=z, output_collection='z'))r   r   r   r   r   r&   s    r    __repr__AttachedFunction.__repr___   sW    "488*HTZZL A"112 3##'#<#<"= >""&"9"9!:">	
r#   otherc                 b   [        U[        5      (       d  gU R                  U R                  5      nU R                  UR                  5      nU R                  UR                  :H  =(       a    U R
                  UR
                  :H  =(       a    U R                  UR                  :H  =(       a    U R                  UR                  :H  =(       ad    U R                  UR                  :H  =(       aD    X#:H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ )z2Compare two AttachedFunction objects for equality.F)r3   r
   r:   r   r   r   r   r   r   r   r   )r   r?   self_paramsother_paramss       r    __eq__AttachedFunction.__eq__g   s    %!122 ,,T\\:--emm< HH		! 2

ekk)2##u';';;2 ))U-G-GG2 ''5+C+CC	2
 +2 -2 %//1		
r#   c           
      @   U R                  U R                  5      nU(       a"  [        [        UR	                  5       5      5      OSn[        U R                  U R                  U R                  U R                  U R                  UU R                  U R                  45      $ )z$Return hash of the AttachedFunction. )r:   r   tuplesorteditemshashr   r   r   r   r   r   r   )r   normalized_paramsparams_tuples      r    __hash__AttachedFunction.__hash__{   s     !224<<@8IE&*00234r 	 

##))''	
 	
r#   )	r   r   r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r4   r   r   r   r!   propertyr   r   r   r   r   r   staticmethodr:   r=   objectboolrC   intrM   __static_attributes__rF   r#   r    r
   r
   	   sx   9!"!" !" 	!"
 !" "!" !" c3h(!" !" !"F D   c   #s # # )T ) ) '3 ' ' c3h0   (3- DcN  "
# 

F 
t 
(
# 
r#   r
   )typingr   r   r   r   uuidr   r5   chromadb.apir   r
   rF   r#   r    <module>r]      s#    5 5  &E
 E
r#   