
    h &                         S SK JrJr  S SKJr  S SKJr  S SKJr  \ " S S5      5       r	S r
\S:X  aD  \" \	5      r\R                  5       S    r\
" \R                  \R                   \R"                  5        g	g	)
    )	dataclassfield)Dataset)HfArgumentParser)get_json_schemac                   n    \ rS rSr% Sr\" SSS0S9r\\S'   \" SSS	0S9r	\
\S
'   \" SSS0S9r\\S'   Srg)ScriptArguments   a  
Arguments for the script.

Args:
    test_size (`float`, *optional*, defaults to `0.1`):
        Fraction of the dataset to include in the test split.
    push_to_hub (`bool`, *optional*, defaults to `False`):
        Whether to push the dataset to the Hugging Face Hub.
    repo_id (`str`, *optional*, defaults to `"trl-internal-testing/zen"`):
        Hugging Face repository ID to push the dataset to.
g?helpz5Fraction of the dataset to include in the test split.)defaultmetadata	test_sizeFz4Whether to push the dataset to the Hugging Face Hub.push_to_hubztrl-internal-testing/toolcallz2Hugging Face repository ID to push the dataset to.repo_id N)__name__
__module____qualname____firstlineno____doc__r   r   float__annotations__r   boolr   str__static_attributes__r       [/home/james-whalen/.local/lib/python3.13/site-packages/scripts/generate_toolcall_dataset.pyr	   r	      sd    
 QRIu  PQK  /NOGS r   r	   c                 z   S[         S[         4S jnS[        S[        4S jnS[        S[         4S jnS[        S[        S[        4S	 jnS
[        S[        S[        4S jnS[        S[        S[        4S jnS[        S[        S[        4S jn	S
[        S[        S[        [         [        4   4S jn
[	        U5      n[	        U5      n[	        U5      n[	        U5      n[	        U5      n[	        U5      n[	        U	5      n	[	        U
5      n
[
        R                  " SSS.SSSSS0S.S./S.SSS S!.SS"S./SS#S.SSS$SS%0S.S./S.SS$S&S!.SS'S./SS(S.SSS)SS*0S.S./S.SS)S+S!.SS,S./SS-S.SSS.S/S0S1.S.S./S.SS.S2S!.SS3S./SS4S.SSS5S6S7S8.S.S./S.SS5S9S!.SS:S./SS;S.SSS<S=S>S?.S.S./S.SS<S@S!.SSAS./SSBS.SSSCSDSESF.S.S./S.SSCSGS!.SSHS./SSIS.SSSJSKSLSM.S.S./S.SSJSNS!.SSOS.//X9/U/XWU
/Xh/Xz/U/X9/Xz//SP.5      nUR                  U SQSR9nU(       a  UR                  U5        g g )SNdurationreturnc                     U $ )z
Starts a timer for the specified duration in seconds.

Args:
    duration: Duration in seconds to set the timer for.

Returns:
    The duration set for the timer.
r   )r   s    r   start_timermain.<locals>.start_timer4   s	     r   locationc                     g)z
Returns the current time in the specified location.

Args:
    location: The location for which to get the current time.

Returns:
    The current time in the specified location.
06:22:48r   r$   s    r   get_current_timemain.<locals>.get_current_time@   s     r   c                     g)z
Returns the air quality index for the specified location.

Args:
    location: The location for which to get the air quality index.

Returns:
    The air quality index for the specified location.
5   r   r'   s    r   get_air_quality_index#main.<locals>.get_air_quality_indexL   s     r   titleartistc                 
    SS0$ )z
Plays music by the specified title and artist.

Args:
    title: The title of the music to play.
    artist: The artist of the music to play.

Returns:
    A dictionary indicating the status of the music playback.
statusPlayingr   r.   r/   s     r   
play_musicmain.<locals>.play_musicX   s     )$$r   citydatec                     SSS.$ )a  
Returns the weather forecast for the specified city and date.

Args:
    city: The city for which to get the weather forecast.
    date: The date for which to get the weather forecast.

Returns:
    A dictionary containing the temperature and weather condition.
r
   zpartly cloudy)temperature	conditionr   r6   r7   s     r   get_weather_forecast"main.<locals>.get_weather_forecaste   s      "@@r   roomstatec                 
    SU0$ )z
Controls the light in the specified room.

Args:
    room: The room where the light should be controlled.
    state: The desired state of the light ("on" or "off").

Returns:
    A dictionary indicating the state of the light.
r?   r   r>   r?   s     r   control_lightmain.<locals>.control_lightr   s     r   timenotec                     g)z
Creates a reminder for the specified time and note.

Args:
    time: The time for the reminder.
    note: The note for the reminder.

Returns:
    A confirmation message indicating that the reminder has been set.
z$I'll remind you to call mom at 7 PM.r   rD   rE   s     r   create_remindermain.<locals>.create_reminder   s     6r   unitc                     g)z
Returns the wind conditions for the specified city.

Args:
    city: The city for which to get the wind conditions.
    unit: The unit of measurement for the wind speed (e.g., "mph").

Returns:
    A tuple containing the wind speed and direction.
)   NWr   r6   rJ   s     r   get_wind_conditions!main.<locals>.get_wind_conditions   s     r   userzSet a timer for 10 minutes.)rolecontent	assistantfunctionr"   iX  )name	arguments)typerU   )rR   
tool_callstool600)rR   rV   rS   zTimer set for 10 minutes.zWhat time is it in Tokyo?r(   Tokyor&   z&The current time in Tokyo is 06:22 AM.z!Is the air clean today in Lisbon?get_air_qualityzLisbon, Portugal53zThe air quality is moderate.zPlay some music.r4   z	Take FivezDave Brubeckr3   z{'status': 'Playing'}zEnjoy the jazz tunes!z+What's the weather like tomorrow in Berlin?r<   Berlinz
2025-06-16r;   z1{'temperature': 22, 'condition': 'partly cloudy'}u>   Tomorrow in Berlin will be partly cloudy with a high of 22°C.zTurn on the living room lights.rB   zliving roomonrA   z{'state': 'on'}z"The living room lights are now on.zRemind me to call mom at 7 PM.rH   z19:00zCall momrG   zReminder setu,   Okay, I’ll remind you to call mom at 7 PM.z,How strong is the wind in Chicago right now?rO   ChicagomphrN   z
(14, 'NW')z<The wind in Chicago is blowing at 14 mph from the northwest.)messagestoolsF)r   shuffle)	intr   dicttupler   r   	from_dicttrain_test_splitr   )r   r   r   r"   r(   r,   r4   r<   rB   rH   rO   datasets               r   mainrl   2   s|   
c 
c 

3 
3 

 
 
%# %s %t %A3 Ac Ad A C      6c 6 6 6# S U38_  "+.K&'78+,AB ,J*+?@#M2M%o6O)*=>   ,IJ$j_l  }G  IL  |M  WN  6O  5P  Q5I$1LM	  ,GH$j_q  BL  NU  AV  WW  6X  5Y  Z);
S$1YZ	  ,OP$j_p  AK  M_  @`  Wa  6b  5c  d):tL$1OP	  ,>?$j_k  EP  \j  {k  Wl  6m  5n  oBYZ$1HI	  ,YZ$j_u  NV  `l  Em  Wn  6o  5p  q)?L  A$1qr	  ,MN$j_n  GT  _c  ~d  We  6f  5g  hEVW$1UV	  ,LM$j_p  IP  Zd  @e  Wf  6g  5h  i):~V$1_`	  ,Z[$j_t  MV  `e  Df  Wg  6h  5i  j)><X$1op	W1
f *":MN'!7O*!7	
g=! =G| &&E&JGG$ r   __main__N)dataclassesr   r   datasetsr   transformersr   transformers.utilsr   r	   rl   r   parserparse_args_into_dataclassesscript_argsr   r   r   r   r   r   <module>ru      s}    )  ) .   6q%j zo.F446q9K		 7 79L9LM r   