[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M759C46C7G1G2DG9A4AEGSRP":3,"skill-same:01M759C46C7G1G2DG9A4AEGSRP":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M759C46C7G1G2DG9A4AEGSRP","context-caching",null,"Large context caching, cached token management, TTL config, and cost optimization.","Lord1Egypt\u002Fgemini-agent-toolkit","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M7592YEPQJ1K2ZGRH69T378X",1,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fcontext-caching\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: context-caching\ndescription: Large context caching, cached token management, TTL config, and cost optimization.\nallowed-tools: Read Write Edit Bash\nlicense: MIT license\nmetadata:\n    skill-author: Lord1Egypt\n---\n\n# Gemini Context Caching Skill\n\n## Overview\nThis skill implements Gemini's native **Context Caching** API. Context Caching allows you to upload large, reusable pieces of data (e.g. video files, massive directories of text, or large PDFs) to Google's servers once, cache the parsed tokens, and query them multiple times.\n\nCaching significantly reduces both query latency and per-request token costs when dealing with contents larger than 32,768 tokens (up to 2 million tokens).\n\n---\n\n## When to Use This Skill\n- Building interactive developer agents that need to inspect an entire codebase continuously.\n- Q&A bots querying thick books, academic corpuses, or large financial directories.\n- Repetitive analysis of long videos or extensive audio recordings.\n- Cost reduction for high-frequency user interactions over a stable background dataset.\n\n---\n\n## Quick Start (with runnable code examples)\n\n```python\nimport time\nfrom google import genai\n\n# Initialize the Gemini GenAI Client\nclient = genai.Client()\n\ndef create_and_use_cache(document_path: str):\n    print(\"Uploading target file for context caching...\")\n    doc_file = client.files.upload(file=document_path)\n    \n    # Wait for file to become active\n    while doc_file.state.name == \"PROCESSING\":\n        time.sleep(2)\n        doc_file = client.files.get(name=doc_file.name)\n        \n    print(f\"Creating Gemini Context Cache for: {doc_file.name}...\")\n    \n    # Create the cache\n    cache = client.caches.create(\n        model='gemini-2.5-flash',\n        config=dict(\n            # Pass the files or text contents to cache\n            contents=[doc_file],\n            # Time to live (TTL) before the cache expires automatically\n            ttl='300s', # 5 minutes\n            # Provide a descriptive name\u002Flabel for management\n            display_name=\"large_document_reference_cache\"\n        )\n    )\n    \n    print(f\"Cache created successfully! Cache Name: {cache.name}\")\n    print(f\"Expires at: {cache.expire_time}\")\n    \n    # Query using the cached content\n    print(\"\\nQuerying Gemini using the cache token bank...\")\n    response1 = client.models.generate_content(\n        model='gemini-2.5-flash',\n        contents=\"Summarize Section 3 of the document.\",\n        config=dict(\n            # Link the query to the cache resource name\n            cached_content=cache.name\n        )\n    )\n    print(\"Response 1:\", response1.text)\n    \n    # Run a second query (reuses the cache, saving time and tokens)\n    response2 = client.models.generate_content(\n        model='gemini-2.5-flash',\n        contents=\"Extract all dates mentioned in the text.\",\n        config=dict(\n            cached_content=cache.name\n        )\n    )\n    print(\"\\nResponse 2:\", response2.text)\n    \n    # Cleanup: Delete the cache token bank\n    print(\"\\nCleaning up cache...\")\n    client.caches.delete(name=cache.name)\n    client.files.delete(name=doc_file.name)\n\nif __name__ == \"__main__\":\n    # Create a dummy file for demonstration\n    with open(\"temp_large_doc.txt\", \"w\") as f:\n        f.write(\"Section 1: Intro. Section 2: General Rules. Section 3: Analysis of results from 2026-06-04.\")\n        \n    create_and_use_cache(\"temp_large_doc.txt\")\n```\n\n---\n\n## Advanced Usage\n\n### Monitoring Cache Resources & Extending TTL\nYou can inspect the cache size, verify token details, and update the time-to-live expiration dynamically:\n\n```python\n# Retrieve active cache information\nmy_cache = client.caches.get(name=cache.name)\nprint(f\"Cached tokens count: {my_cache.metadata.total_token_count}\")\n\n# Extend cache lifetime by resetting the TTL\nclient.caches.patch(\n    name=cache.name,\n    config=dict(\n        ttl='600s' # Extend by another 10 minutes\n    )\n)\n```\n\n---\n\n## Key References\n- [Gemini Context Caching Guide](https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-genai)\n- Google API Pricing for Cached Tokens\n\n---\n\n## Dependencies\n- `google-genai>=0.1.1`\n","# Gemini Context Caching Skill\n\n## Overview\nThis skill implements Gemini's native **Context Caching** API. Context Caching allows you to upload large, reusable pieces of data (e.g. video files, massive directories of text, or large PDFs) to Google's servers once, cache the parsed tokens, and query them multiple times.\n\nCaching significantly reduces both query latency and per-request token costs when dealing with contents larger than 32,768 tokens (up to 2 million tokens).\n\n---\n\n## When to Use This Skill\n- Building interactive developer agents that need to inspect an entire codebase continuously.\n- Q&A bots querying thick books, academic corpuses, or large financial directories.\n- Repetitive analysis of long videos or extensive audio recordings.\n- Cost reduction for high-frequency user interactions over a stable background dataset.\n\n---\n\n## Quick Start (with runnable code examples)\n\n```python\nimport time\nfrom google import genai\n\n# Initialize the Gemini GenAI Client\nclient = genai.Client()\n\ndef create_and_use_cache(document_path: str):\n    print(\"Uploading target file for context caching...\")\n    doc_file = client.files.upload(file=document_path)\n    \n    # Wait for file to become active\n    while doc_file.state.name == \"PROCESSING\":\n        time.sleep(2)\n        doc_file = client.files.get(name=doc_file.name)\n        \n    print(f\"Creating Gemini Context Cache for: {doc_file.name}...\")\n    \n    # Create the cache\n    cache = client.caches.create(\n        model='gemini-2.5-flash',\n        config=dict(\n            # Pass the files or text contents to cache\n            contents=[doc_file],\n            # Time to live (TTL) before the cache expires automatically\n            ttl='300s', # 5 minutes\n            # Provide a descriptive name\u002Flabel for management\n            display_name=\"large_document_reference_cache\"\n        )\n    )\n    \n    print(f\"Cache created successfully! Cache Name: {cache.name}\")\n    print(f\"Expires at: {cache.expire_time}\")\n    \n    # Query using the cached content\n    print(\"\\nQuerying Gemini using the cache token bank...\")\n    response1 = client.models.generate_content(\n        model='gemini-2.5-flash',\n        contents=\"Summarize Section 3 of the document.\",\n        config=dict(\n            # Link the query to the cache resource name\n            cached_content=cache.name\n        )\n    )\n    print(\"Response 1:\", response1.text)\n    \n    # Run a second query (reuses the cache, saving time and tokens)\n    response2 = client.models.generate_content(\n        model='gemini-2.5-flash',\n        contents=\"Extract all dates mentioned in the text.\",\n        config=dict(\n            cached_content=cache.name\n        )\n    )\n    print(\"\\nResponse 2:\", response2.text)\n    \n    # Cleanup: Delete the cache token bank\n    print(\"\\nCleaning up cache...\")\n    client.caches.delete(name=cache.name)\n    client.files.delete(name=doc_file.name)\n\nif __name__ == \"__main__\":\n    # Create a dummy file for demonstration\n    with open(\"temp_large_doc.txt\", \"w\") as f:\n        f.write(\"Section 1: Intro. Section 2: General Rules. Section 3: Analysis of results from 2026-06-04.\")\n        \n    create_and_use_cache(\"temp_large_doc.txt\")\n```\n\n---\n\n## Advanced Usage\n\n### Monitoring Cache Resources & Extending TTL\nYou can inspect the cache size, verify token details, and update the time-to-live expiration dynamically:\n\n```python\n# Retrieve active cache information\nmy_cache = client.caches.get(name=cache.name)\nprint(f\"Cached tokens count: {my_cache.metadata.total_token_count}\")\n\n# Extend cache lifetime by resetting the TTL\nclient.caches.patch(\n    name=cache.name,\n    config=dict(\n        ttl='600s' # Extend by another 10 minutes\n    )\n)\n```\n\n---\n\n## Key References\n- [Gemini Context Caching Guide](https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-genai)\n- Google API Pricing for Cached Tokens\n\n---\n\n## Dependencies\n- `google-genai>=0.1.1`\n",{"name":5,"license":24,"metadata":25,"description":7,"allowed-tools":26},"MIT license",{"skill-author":9},"Read Write Edit Bash","main","9b8e8f0d767fb59015984d8f339202645dd3ffd9","gemini-skills\u002Fcontext-caching",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-05 05:47:34",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Lord1Egypt\u002Fgemini-agent-toolkit --skill context-caching",{"tool":41,"command":42},"bunx","bunx skills add Lord1Egypt\u002Fgemini-agent-toolkit --skill context-caching",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fgemini-agent-toolkit --skill context-caching","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fcontext-caching\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M75B0J46ADXWJTA1VY67W4V5","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M75B01F60NZVDD5C7EYD671V","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fwhat-if-oracle\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M75AZYC0SYMS729448FAJPX1","websockets-network","Asynchronous bi-directional WebSocket client and server configuration in Python.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fwebsockets-network\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M75AZVNH8FCTFSFC97FB9AJ1","vite-frontend","Initializing, structuring, and bundling client-side Single-Page Applications (SPA) with Vite.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fvite-frontend\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M75AZNWDK8HEB64542V07AVZ","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fvenue-templates\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M75AZH369T8DAYY132KF1P1K","vaex","Use this skill for processing and analyzing large tabular datasets (billions of rows) that exceed available RAM. Vaex excels at out-of-core DataFrame operations, lazy evaluation, fast aggregations, efficient visualization of big data, and machine learning on large datasets. Apply when users need to work with large CSV\u002FHDF5\u002FArrow\u002FParquet files, perform fast statistics on massive datasets, create visualizations of big data, or build ML pipelines that do not fit in memory.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fgemini-agent-toolkit\u002Fblob\u002Fmain\u002Fgemini-skills\u002Fvaex\u002FSKILL.md",[],[]]