{"record":{"id":"b989cc329af4891f","repo":"microsoft/autogen","slug":"failed-to-update-gallery","errorCode":null,"errorMessage":"Failed to update gallery","messagePattern":"Failed to update gallery","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-studio/frontend/src/components/views/gallery/api.ts","lineNumber":73,"sourceCode":"    galleryData: Partial<Gallery>,\n    userId: string\n  ): Promise<Gallery> {\n    const gallery = {\n      ...galleryData,\n      user_id: userId,\n    };\n\n    const response = await fetch(\n      `${this.getBaseUrl()}/gallery/${galleryId}?user_id=${userId}`,\n      {\n        method: \"PUT\",\n        headers: this.getHeaders(),\n        body: JSON.stringify(gallery),\n      }\n    );\n    const data = await response.json();\n    if (!data.status)\n      throw new Error(data.message || \"Failed to update gallery\");\n    return data.data;\n  }\n\n  async deleteGallery(galleryId: number, userId: string): Promise<void> {\n    const response = await fetch(\n      `${this.getBaseUrl()}/gallery/${galleryId}?user_id=${userId}`,\n      {\n        method: \"DELETE\",\n        headers: this.getHeaders(),\n      }\n    );\n    const data = await response.json();\n    if (!data.status)\n      throw new Error(data.message || \"Failed to delete gallery\");\n  }\n\n  async syncGallery(url: string): Promise<Gallery> {\n    const response = await fetch(url);","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-studio/frontend/src/components/views/gallery/api.ts#L55-L91","documentation":"Raised in the tool constructor when `azure-search-documents` (checked via the module-level `has_azure_search` import guard) is unavailable. The Azure AI Search tool is an optional extra of autogen-ext; constructing it without the SDK fails immediately with install instructions.","triggerScenarios":"Instantiating AzureAISearchTool (or any BaseAzureAISearchTool subclass) in an environment where `import azure.search.documents` failed at module import time — the class is importable but unusable.","commonSituations":"Installing autogen-ext without the [azure] extra; a different virtualenv at runtime than at dev time; a dependency conflict downgrading/removing azure-search-documents; version <11.4.0 missing required APIs.","solutions":["Install the SDK: `pip install azure-search-documents>=11.4.0` (or `uv add \"azure-search-documents>=11.4.0\"`).","Better, install via the extra: `pip install \"autogen-ext[azure]\"` so the right dependencies travel with the package.","Verify in the runtime env: `python -c \"import azure.search.documents; print(azure.search.documents.__version__)\"`."],"exampleFix":"# before: ImportError on AzureAISearchTool(...)\n# after\n# shell:\n#   pip install \"autogen-ext[azure]\"\n#   # or: pip install \"azure-search-documents>=11.4.0\"","handlingStrategy":"validation","validationCode":"def azure_search_sdk_available() -> bool:\n    try:\n        import azure.search.documents  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nassert azure_search_sdk_available(), \"pip install 'autogen-ext[azure]'\"","typeGuard":null,"tryCatchPattern":"try:\n    tool = AzureAISearchTool(...)\nexcept ImportError as e:\n    raise SystemExit(\"Install azure-search-documents>=11.4.0 or autogen-ext[azure]\") from e","preventionTips":["Install autogen-ext with the [azure] extra so optional SDKs come along.","Pin azure-search-documents>=11.4.0 in your lock file."],"tags":["python","dependencies","azure-ai-search"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}