Skip to content

Instantly share code, notes, and snippets.

@eliorc
eliorc / fsspec_open_any_file.py
Created February 20, 2024 13:18
Open any file
CLOUD_PROTOCOLS = ("s3", "s3n", "s3a", "gcs", "gs", "adl", "abfs", "abfss", "gdrive")
HTTP_PROTOCOLS = ("http", "https")
S3_PROTOCOLS = ("s3", "s3a", "s3n")
PROTOCOL_DELIMITER = "://"
def _parse_filepath(filepath: str) -> dict[str, str]:
"""
Split filepath on protocol and path. Based on `fsspec.utils.infer_storage_options`.
@eliorc
eliorc / llm_example.json
Created May 28, 2025 10:05
LLM JSON Example
{
"model": "llm-model-name-goes-here", // Example: "gpt-4-turbo"
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a specified location.",
"parameters": {
"type": "object",