File Downloader in FC

Download a file in FC
from llmcam.fn_to_fc import *
import llmcam.downloader
import json

source

download_file

 download_file (url:str, save_path:str=None)

Download a file from a give url

Type Default Details
url str URL to download
save_path str None file name to save
tools = [tool_schema(llmcam.downloader.download_file)]
#print(json.dumps(*tools, indent=4))
m = form_msgs([("user","Download a file from https://weathercam.digitraffic.fi/C0150200.jpg.")])
complete(m, tools=tools)
print_msgs(m, skip_tools=False)
>> User:
Download a file from https://weathercam.digitraffic.fi/C0150200.jpg.
>> Assistant:
{'content': None, 'refusal': None, 'role': 'assistant', 'tool_calls': [{'id': 'call_Xdh3dm0g2VAkNLTCVq5J7gKp', 'function': {'arguments': '{"url":"https://weathercam.digitraffic.fi/C0150200.jpg"}', 'name': 'download_file'}, 'type': 'function'}]}
>> Assistant:
The file has been downloaded successfully from [this
link](https://weathercam.digitraffic.fi/C0150200.jpg) and is saved as "C0150200.jpg".