Fix errors and bugs in the given code, without changing its intended functionality. ONLY return the fixed code and nothing else. Enclose the entire code in a single code block.

{
  "$schema": "https://www.raycast.com/schemas/extension.json",
  "name": "raycast-g4f",
  "version": "3.4",
  "title": "GPT4Free",
  "description": "Use GPT-4 for FREE, on Raycast - no API Key required.",
  "icon": "gpt-icon.png",
  "author": "muzhen_gaming",
  "categories": [
    "Productivity",
    "Developer Tools"
  ],
  "license": "MIT",
  "commands": [
    {
      "name": "askAI",
      "title": "Ask AI",
      "description": "Ask GPT a question",
      "icon": "gpt-icon.png",
      "mode": "view",
      "arguments": [
        {
          "name": "query",
          "placeholder": "Query",
          "type": "text",
          "required": false
        }
      ]
    },
    {
      "name": "aiChat",
      "title": "AI Chat",
      "description": "Chat with GPT",
      "icon": "chat-icon.png",
      "mode": "view"
    },
    {
      "name": "askAboutSelectedText",
      "title": "Ask About Selected Text",
      "description": "Ask GPT about selected text",
      "icon": "clipboard-icon.png",
      "mode": "view",
      "arguments": [
        {
          "name": "query",
          "placeholder": "Query",
          "type": "text",
          "required": false
        }
      ]
    },
    {
      "name": "askAboutScreenContent",
      "title": "Ask About Screen Content",
      "description": "Ask GPT about screen content",
      "icon": "screen-icon.png",
      "mode": "no-view",
      "arguments": [
        {
          "name": "query",
          "placeholder": "Query",
          "type": "text",
          "required": false
        }
      ]
    },
    {
      "name": "continue",
      "title": "Continue Text",
      "description": "Generate completion of text",
      "icon": "text-icon.png",
      "mode": "view"
    },
    {
      "name": "summarize",
      "title": "Summarize",
      "description": "Summarize text",
      "icon": "summarize-icon.png",
      "mode": "view"
    },
    {
      "name": "explain",
      "title": "Explain",
      "description": "Explain text",
      "icon": "explain-icon.png",
      "mode": "view"
    },
    {
      "name": "fixCode",
      "title": "Fix Code",
      "description": "Fix errors and bugs in code",
      "icon": "code-icon.png",
      "mode": "view"
    },
    {
      "name": "friendly",
      "title": "Change Tone to Friendly",
      "description": "Change tone of text to friendly",
      "icon": "text-icon.png",
      "mode": "view"
    },
    {
      "name": "professional",
      "title": "Change Tone to Professional",
      "description": "Change tone of text to professional",
      "icon": "text-icon.png",
      "mode": "view"
    },
    {
      "name": "paraphrase",
      "title": "Paraphrase",
      "description": "Paraphrase text",
      "icon": "text-icon.png",
      "mode": "view"
    },
    {
      "name": "synonyms",
      "title": "Find Synonyms",
      "description": "Find synonyms of word/phrase",
      "icon": "synonym-icon.png",
      "mode": "view",
      "arguments": [
        {
          "name": "query",
          "type": "text",
          "placeholder": "word/phrase",
          "required": false
        }
      ]
    },
    {
      "name": "translate",
      "title": "Translate",
      "description": "Translate text to another language",
      "icon": "synonym-icon.png",
      "mode": "view"
    },
    {
      "name": "improve",
      "title": "Improve Writing",
      "description": "Improve writing of text",
      "icon": "grammar-icon.png",
      "mode": "view"
    },
    {
      "name": "longer",
      "title": "Make Longer",
      "description": "Make text longer",
      "icon": "longer-icon.png",
      "mode": "view"
    },
    {
      "name": "shorter",
      "title": "Make Shorter",
      "description": "Make text shorter",
      "icon": "shorten-icon.png",
      "mode": "view"
    },
    {
      "name": "genImage",
      "title": "Generate Images",
      "description": "Generate images from a text prompt",
      "icon": "image-icon.png",
      "mode": "view"
    },
    {
      "name": "customAICommands",
      "title": "Custom AI Commands",
      "description": "Run and manage custom AI commands",
      "icon": "command-icon.png",
      "mode": "view"
    },
    {
      "name": "checkForUpdates",
      "title": "Check for Updates",
      "description": "Check for extension updates from the official GitHub source",
      "icon": "update-icon.png",
      "mode": "view"
    },
    {
      "name": "configureLocalAPIs",
      "title": "Configure Local APIs",
      "description": "Configure GPT4Free and Ollama Local API settings",
      "icon": "box-icon.png",
      "mode": "view"
    },
    {
      "name": "manageAIPresets",
      "title": "Manage AI Presets",
      "description": "Manage AI presets",
      "icon": "preset-icon.png",
      "mode": "view"
    }
  ],
  "preferences": [
    {
      "name": "gptProvider",
      "title": "Default Provider",
      "description": "The default provider and model used in this extension.",
      "required": false,
      "type": "dropdown",
      "data": [
        {
          "title": "Nexra (chatgpt)",
          "value": "NexraChatGPT"
        },
        {
          "title": "Nexra (gpt-4o)",
          "value": "NexraGPT4o"
        },
        {
          "title": "Nexra (gpt-4-32k)",
          "value": "NexraGPT4"
        },
        {
          "title": "Nexra (Bing)",
          "value": "NexraBing"
        },
        {
          "title": "Nexra (llama-3.1)",
          "value": "NexraLlama31"
        },
        {
          "title": "Nexra (gemini-1.0-pro)",
          "value": "NexraGeminiPro"
        },
        {
          "title": "DeepInfra (meta-llama-3.1-405b)",
          "value": "DeepInfraLlama31_405B"
        },
        {
          "title": "DeepInfra (meta-llama-3.1-70b)",
          "value": "DeepInfraLlama31_70B"
        },
        {
          "title": "DeepInfra (meta-llama-3.1-8b)",
          "value": "DeepInfraLlama31_8B"
        },
        {
          "title": "DeepInfra (Mixtral-8x22B)",
          "value": "DeepInfraMixtral_8x22B"
        },
        {
          "title": "DeepInfra (Mixtral-8x7B)",
          "value": "DeepInfraMixtral_8x7B"
        },
        {
          "title": "DeepInfra (Qwen2-72B)",
          "value": "DeepInfraQwen2_72B"
        },
        {
          "title": "DeepInfra (Mistral-7B)",
          "value": "DeepInfraMistral_7B"
        },
        {
          "title": "DeepInfra (openchat-3.6-8b)",
          "value": "DeepInfraOpenChat36_8B"
        },
        {
          "title": "DeepInfra (meta-llama-3-70b)",
          "value": "DeepInfraLlama3_70B"
        },
        {
          "title": "DeepInfra (meta-llama-3-8b)",
          "value": "DeepInfraLlama3_8B"
        },
        {
          "title": "DeepInfra (gemma-2-27b)",
          "value": "DeepInfraGemma2_27B"
        },
        {
          "title": "DeepInfra (WizardLM-2-8x22B)",
          "value": "DeepInfraWizardLM2_8x22B"
        },
        {
          "title": "DeepInfra (llava-1.5-7b)",
          "value": "DeepInfraLlava15_7B"
        },
        {
          "title": "Blackbox (custom-model)",
          "value": "Blackbox"
        },
        {
          "title": "DuckDuckGo (gpt-4o-mini)",
          "value": "DuckDuckGo_GPT4oMini"
        },
        {
          "title": "DuckDuckGo (claude-3-haiku)",
          "value": "DuckDuckGo_Claude3Haiku"
        },
        {
          "title": "DuckDuckGo (meta-llama-3.1-70b)",
          "value": "DuckDuckGo_Llama31_70B"
        },
        {
          "title": "DuckDuckGo (mixtral-8x7b)",
          "value": "DuckDuckGo_Mixtral_8x7B"
        },
        {
          "title": "BestIM (gpt-4o-mini)",
          "value": "BestIM_GPT4oMini"
        },
        {
          "title": "Rocks (claude-3.5-sonnet)",
          "value": "RocksClaude35Sonnet"
        },
        {
          "title": "Rocks (claude-3-opus)",
          "value": "RocksClaude3Opus"
        },
        {
          "title": "Rocks (gpt-4o)",
          "value": "RocksGPT4o"
        },
        {
          "title": "Rocks (gpt-4)",
          "value": "RocksGPT4"
        },
        {
          "title": "Rocks (llama-3.1-405b)",
          "value": "RocksLlama31_405B"
        },
        {
          "title": "Rocks (llama-3.1-70b)",
          "value": "RocksLlama31_70B"
        },

        {
          "title": "PizzaGPT (gpt-3.5-turbo)",
          "value": "PizzaGPT"
        },
        {
          "title": "Meta AI (meta-llama-3.1)",
          "value": "MetaAI"
        },
        {
          "title": "SambaNova (llama-3.1-405b)",
          "value": "SambaNovaLlama31_405B"
        },
        {
          "title": "SambaNova (llama-3-70b)",
          "value": "SambaNovaLlama3_70B"
        },
        {
          "title": "SambaNova (llama-3-8b)",
          "value": "SambaNovaLlama3_8B"
        },
        {
          "title": "Replicate (mixtral-8x7b)",
          "value": "ReplicateMixtral_8x7B"
        },
        {
          "title": "Replicate (meta-llama-3.1-405b)",
          "value": "ReplicateLlama31_405B"
        },
        {
          "title": "Replicate (meta-llama-3-70b)",
          "value": "ReplicateLlama3_70B"
        },
        {
          "title": "Replicate (meta-llama-3-8b)",
          "value": "ReplicateLlama3_8B"
        },
        {
          "title": "Google Gemini (requires API Key)",
          "value": "GoogleGemini"
        },
        {
          "title": "GPT4Free Local API",
          "value": "G4FLocal"
        },
        {
          "title": "Ollama Local API",
          "value": "OllamaLocal"
        }
      ],
      "default": "NexraChatGPT"
    },
    {
      "name": "webSearch",
      "title": "Features",
      "label": "Enable Web Search",
      "description": "Add web search capabilities to GPT. Available in AI Chat.",
      "required": false,
      "type": "checkbox",
      "default": false
    },
    {
      "name": "smartChatNaming",
      "label": "Enable Smart Chat Naming",
      "description": "Automatically rename chat sessions based on the messages you send.",
      "required": false,
      "type": "checkbox",
      "default": false
    },
    {
      "name": "autoCheckForUpdates",
      "label": "Automatically Check for Updates",
      "description": "Automatically check for updates from the official GitHub source.",
      "required": false,
      "type": "checkbox",
      "default": false
    },
    {
      "name": "persistentStorage",
      "label": "Enable Persistent Storage",
      "description": "Enable more persistent storage of the extension's data. Do not use if you have sensitive data.",
      "required": false,
      "type": "checkbox",
      "default": false
    },
    {
      "name": "codeInterpreter",
      "label": "Enable Code Interpreter (BETA)",
      "description": "Allows GPT to interpret and run Python code locally, based on your queries. Use at your own risk!",
      "required": false,
      "type": "checkbox",
      "default": false
    },
    {
      "name": "TavilyAPIKeys",
      "title": "Tavily API Keys",
      "description": "Optional. Only used if Web Search is enabled. Multiple keys are supported - separate them with commas.",
      "required": false,
      "type": "password",
      "default": ""
    },
    {
      "name": "GeminiAPIKeys",
      "title": "Google Gemini API Keys",
      "description": "Optional. Only used if Gemini provider is selected. Multiple keys are supported - separate them with commas.",
      "required": false,
      "type": "password",
      "default": ""
    },
    {
      "name": "inactiveDuration",
      "title": "Delete Inactive Chats After...",
      "description": "Duration of inactivity before chat is deleted.",
      "required": false,
      "type": "dropdown",
      "default": "Disabled",
      "data": [
        {
          "title": "Disabled",
          "value": "0"
        },
        {
          "title": "6 Hours",
          "value": "6"
        },
        {
          "title": "1 Day",
          "value": "24"
        },
        {
          "title": "3 Days",
          "value": "72"
        },
        {
          "title": "1 Week",
          "value": "168"
        },
        {
          "title": "1 Month",
          "value": "720"
        },
        {
          "title": "6 Months",
          "value": "4320"
        }
      ]
    }
  ],
  "dependencies": {
    "@raycast/api": "^1.80.0",
    "g4f-image": "^1.1.0",
    "gemini-g4f": "^12.3.8",
    "node-fetch": "^3.3.2"
  },
  "devDependencies": {
    "@raycast/eslint-config": "1.0.5",
    "@types/node": "^20.14.14",
    "@types/react": "^18.3.3",
    "eslint": "^7.32.0",
    "prettier": "^2.8.8",
    "react": "^18.3.1",
    "typescript": "^5.5.4"
  },
  "scripts": {
    "build": "ray build -e dist",
    "dev": "ray develop",
    "fix-lint": "ray lint --fix",
    "lint": "ray lint",
    "publish": "npx @raycast/api@latest publish"
  }
}