+
    Pj^'                     :   R t ^ RIt^ RIHtHt ^ RIHtHt ^RIH	t	H
t
HtHt ^RIHtHt ^RIHtHt ]! ]4      t]P(                  ! R] U u/ uF  q V bK  	  up ]R7      t]! ]4      t]P(                  ! R	] Uu/ uF  qVbK  	  up]R7      t]! R
R7      t]P5                  R. R*OR7      R+R R ll4       t]P5                  RR.R7      R,R R ll4       t]P5                  R. R-OR7      R.R R ll4       t]P5                  R. R/OR7      R0R R ll4       t]P5                  RRR.R7      R1R R ll4       t]P5                  R. R2OR7      R3R  R! ll4       t ]P5                  R"R#R$.R7      R4R% R& ll4       t!]P5                  R'4      R1R( R) ll4       t"R# u up i u upi )5zGContains commands to interact with collections on the Hugging Face Hub.N)	Annotatedget_args)CollectionItemType_TCollectionSort_T)LimitOptTokenOpt
get_hf_apityper_factory)ArgumentOption)_dataclass_to_dictoutCollectionItemType)typeCollectionSortz%Interact with collections on the Hub.helpz	list | ls)examplesc                   V ^8  d   QhR\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R	\        R
\
        RR/# )   ownerNz)Filter by owner username or organization.r   itemzkFilter collections containing a specific item (e.g., "models/gpt2", "datasets/squad", "papers/2311.12983").sortz4Sort results by last modified, trending, or upvotes.limittokenreturn)r   strr   r   r   r   )formats   "x/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/huggingface_hub/cli/collections.py__annotate__r   -   s      d
?@	B
 d
~	
	 JK	M   !" 
#    c                    \        VR7      pV'       d   VP                  MRpVP                  V VVVR7       Uu. uF  p\        V4      NK  	  pp\        P
                  ! V4       R# u upi )zList collections on the Hub.r   N)r   r   r   r   )r   valuelist_collectionsr   r   table)	r   r   r   r   r   apisort_key
collectionresultss	   &&&&&    r   collections_lsr*   %   su    6 5
!C!tzztH ..	 / 

J 	:&
   IIgs   A(infoz/hf collections info username/my-collection-slugc                b    V ^8  d   QhR\         \        \        RR7      3,          R\        RR/# )r   collection_slug7The collection slug (e.g., 'username/collection-slug').r   r   r   N)r   r   r
   r   )r   s   "r   r   r   T   s6      sH2k$llm 
r    c                l    \        VR7      pVP                  V 4      p\        P                  ! V4       R# )z'Get info about a collection on the Hub.r"   N)r   get_collectionr   dict)r-   r   r&   r(   s   &&  r   collections_infor2   N   s*     5
!C##O4JHHZr    createc                f   V ^8  d   QhR\         \        \        RR7      3,          R\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R	\         \        \        R
R7      3,          R\         \        \        RR7      3,          R\
        RR/# )r   titlezThe title of the collection.r   	namespaceNzMThe namespace (username or organization). Defaults to the authenticated user.descriptionz!A description for the collection.privatezCreate a private collection.	exists_okz7Do not raise an error if the collection already exists.r   r   )r   r   r
   r   boolr   )r   s   "r   r   r   f   s     O OS((FGGHOd
cd	fO d
78	:O 23	5O MN	PO$ %O& 
'Or    c                    \        VR7      pVP                  V VVVVR7      p\        P                  ! RVP                  VP
                  R7       R# )z#Create a new collection on the Hub.r"   )r5   r6   r7   r8   r9   zCollection createdslugurlN)r   create_collectionr   resultr=   r>   )r5   r6   r7   r8   r9   r   r&   r(   s   &&&&&&  r   collections_createrA   ^   sM    : 5
!C&& ' J JJ#*//z~~Nr    updatec                   V ^8  d   QhR\         \        \        RR7      3,          R\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R	\         \        R,          \        R
R7      3,          R\         \
        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R\        RR/# )r   r-   r.   r   r5   Nz!The new title for the collection.r7   z'The new description for the collection.positionz7The new position of the collection in the owner's list.r8   z)Whether the collection should be private.themez;The theme color for the collection (e.g., 'green', 'blue').r   r   )r   r   r
   r   intr:   r   )r   s   "r   r   r      s     "O "OsH2k$llm"Od
78	:"O d
=>	@"O d
MN	P"O t?@	B"O$ d
QR	T%"O, -"O. 
/"Or    c           	         \        VR7      pVP                  V VVVVVR7      p\        P                  ! RVP                  VP
                  R7       R# )z*Update a collection's metadata on the Hub.r"   )r-   r5   r7   rD   r8   rE   zCollection updatedr<   N)r   update_collection_metadatar   r@   r=   r>   )	r-   r5   r7   rD   r8   rE   r   r&   r(   s	   &&&&&&&  r   collections_updaterI      sQ    B 5
!C//' 0 J JJ#*//z~~Nr    deletez,hf collections delete username/my-collectionz9hf collections delete username/my-collection --missing-okc          	          V ^8  d   QhR\         \        \        RR7      3,          R\         \        \	        RR7      3,          R\
        RR/# )	r   r-   r.   r   
missing_okz6Do not raise an error if the collection doesn't exist.r   r   Nr   r   r
   r:   r   r   )r   s   "r   r   r      sW     ; ;sH2k$llm;LM	O; ; 
;r    c                r    \        VR7      pVP                  WR7       \        P                  ! RV R7       R# )z!Delete a collection from the Hub.r"   )rL   zCollection deletedr=   N)r   delete_collectionr   r@   )r-   rL   r   r&   s   &&& r   collections_deleterQ      s.      5
!C/AJJ#/:r    zadd-itemc                X   V ^8  d   QhR\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        R	,          \	        R
R7      3,          R\         \
        \	        RR7      3,          R\        RR	/# )r   r-   r.   r   item_idzCThe ID of the item to add (repo_id for repos, paper ID for papers).	item_typezGThe type of item (model, dataset, space, paper, collection, or bucket).noteNz2A note to attach to the item (max 500 characters).r9   z?Do not raise an error if the item is already in the collection.r   r   )r   r   r
   r   r   r:   r   )r   s   "r   r   r      s     U UsH2k$llmUsH*oppqU _`	bU d
HI	KU UV	XU U  
!Ur    c                    \        VR7      pVP                  V VVP                  VVR7      p\        P                  ! RWP
                  R7       R# )zAdd an item to a collection.r"   )r-   rS   rT   rU   r9   zItem added to collectionr<   N)r   add_collection_itemr#   r   r@   r>   )r-   rS   rT   rU   r9   r   r&   r(   s   &&&&&&  r   collections_add_itemrX      sK    4 5
!C(('// ) J JJ)^^Tr    zupdate-itemzVhf collections update-item username/my-collection ITEM_OBJECT_ID --note "Updated note"zMhf collections update-item username/my-collection ITEM_OBJECT_ID --position 0c                ,   V ^8  d   QhR\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        R,          \        RR7      3,          R	\         \        R,          \        R
R7      3,          R\
        RR/# )r   r-   r.   r   item_object_idzTThe ID of the item in the collection (from 'item_object_id' field, not the repo_id).rU   Nz-A new note for the item (max 500 characters).rD   z/The new position of the item in the collection.r   r   )r   r   r
   r   rF   r   )r   s   "r   r   r      s     C CsH2k$llmClm	oC d
CD	FC d
EF	HC C 
Cr    c                x    \        VR7      pVP                  V VVVR7       \        P                  ! RV R7       R# )zUpdate an item in a collection.r"   )r-   rZ   rU   rD   zItem updated in collectionrO   N)r   update_collection_itemr   r@   )r-   rZ   rU   rD   r   r&   s   &&&&& r   collections_update_itemr]      s>    0 5
!C'%	   JJ+/Br    zdelete-itemc                    V ^8  d   QhR\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        \	        RR7      3,          R\
        R	R
/# )r   r-   r.   r   rZ   znThe ID of the item in the collection (retrieved from `item_object_id` field returned by 'hf collections info'.rL   z0Do not raise an error if the item doesn't exist.r   r   NrM   )r   s   "r   r   r     s     E EsH2k$llmE B	
	E FG	IE E 
Er    c                v    \        VR7      pVP                  V VVR7       \        P                  ! RV R7       R# )z!Delete an item from a collection.r"   )r-   rZ   rL   zItem deleted from collectionrO   N)r   delete_collection_itemr   r@   )r-   rZ   rL   r   r&   s   &&&& r   collections_delete_itemra     s;      5
!C'%  
 JJ-ODr    )zhf collections lsz hf collections ls --owner nvidiazLhf collections ls --item models/teknium/OpenHermes-2.5-Mistral-7B --limit 10)NNN
   N)N)z!hf collections create "My Models"z^hf collections create "My Models" --description "A collection of my favorite models" --privatez9hf collections create "Org Collection" --namespace my-org)NNFFN)z@hf collections update username/my-collection --title "New Title"zPhf collections update username/my-collection --description "Updated description"zDhf collections update username/my-collection --private --theme green)NNNNNN)FN)zGhf collections add-item username/my-collection moonshotai/kimi-k2 modelz`hf collections add-item username/my-collection Qwen/DeepPlanning dataset --note "Useful dataset"zGhf collections add-item username/my-collection Tongyi-MAI/Z-Image space)NFN)NNN)#__doc__enumtypingr   r   huggingface_hub.hf_apir   r   
_cli_utilsr   r   r   r	   
_frameworkr
   r   _outputr   r   _COLLECTION_ITEM_TYPESEnumr   r   _COLLECTION_SORT_OPTIONSr   collections_clicommandr*   r2   rA   rI   rQ   rX   r]   ra   )tss   00r   <module>rq      s   N  & I E E ( , ""67 YY3DZ5[DZqdDZ5[bef #$45 +<T-U<Tqd<T-U\_`  %LM   B 
9     OO@   "O"OJ 6C  ;;   UU: `W  CC6 'E (Ei 6\ .Vs   F
9F
