{"record":{"id":"248d3a059648221c","repo":"ScrapeGraphAI/Scrapegraph-ai","slug":"smartscrapermultibatchgraph-only-supports-openai-m","errorCode":null,"errorMessage":"SmartScraperMultiBatchGraph only supports OpenAI models. Got provider '{provider}'. Use SmartScraperMultiGraph for other providers.","messagePattern":"SmartScraperMultiBatchGraph only supports OpenAI models\\. Got provider '(.+?)'\\. Use SmartScraperMultiGraph for other providers\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scrapegraphai/graphs/smart_scraper_multi_batch_graph.py","lineNumber":136,"sourceCode":"    def __init__(\n        self,\n        prompt: str,\n        source: List[str],\n        config: dict,\n        schema: Optional[Type[BaseModel]] = None,\n    ):\n        self.copy_config = safe_deepcopy(config)\n        self.copy_schema = deepcopy(schema)\n        self.batch_config = config.get(\"batch_api\", {})\n\n        # Validate that the model is OpenAI-based\n        model_str = config.get(\"llm\", {}).get(\"model\", \"\")\n        if \"/\" in model_str:\n            provider = model_str.split(\"/\")[0]\n        else:\n            provider = \"\"\n        if provider and provider != \"openai\":\n            raise ValueError(\n                f\"SmartScraperMultiBatchGraph only supports OpenAI models. \"\n                f\"Got provider '{provider}'. \"\n                f\"Use SmartScraperMultiGraph for other providers.\"\n            )\n\n        super().__init__(prompt, config, source, schema)\n\n    def _create_graph(self) -> BaseGraph:\n        \"\"\"Creates the graph of nodes for the batch scraping pipeline.\n\n        The graph has two phases:\n        1. GraphIteratorNode runs _FetchParseOnlyGraph per URL (concurrent)\n        2. BatchGenerateAnswerNode submits all prompts via Batch API\n        3. MergeAnswersNode combines the results\n\n        Returns:\n            BaseGraph: A graph instance representing the batch scraping workflow.\n        \"\"\"","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/532dfffbf6ee823a6c9cf8cfedc24a93bf026780/scrapegraphai/graphs/smart_scraper_multi_batch_graph.py#L118-L154","documentation":"SmartScraperMultiBatchGraph.__init__ inspects the llm model string: if it contains '/', the prefix before the slash is treated as the provider, and any provider other than 'openai' is rejected with this ValueError before delegating to super().__init__. The batch implementation relies on OpenAI-specific batch APIs.","triggerScenarios":"config = {'llm': {'model': 'azure_openai/gpt-4o', ...}} or 'anthropic/claude-...' etc. — any 'provider/model' string where provider != 'openai'. Note: a bare model name without '/' sets provider='' and passes the check.","commonSituations":"Switching an existing SmartScraperMultiGraph config to the batch variant while keeping a provider-qualified model string; using Azure (azure_openai/...) or openrouter-style model ids, which are unsupported here.","solutions":["Use an OpenAI model for this graph (model string 'openai/gpt-4o' or plain 'gpt-4o').","Use SmartScraperMultiGraph (non-batch) for other providers.","For Azure, pass a model_instance built with AzureChatOpenAI plus model_tokens if batch semantics are not strictly required."],"exampleFix":"# before\nconfig = {'llm': {'model': 'azure_openai/gpt-4o', 'api_key': key}}\ngraph = SmartScraperMultiBatchGraph(prompt=..., source=..., config=config)\n\n# after\nconfig = {'llm': {'model': 'openai/gpt-4o', 'api_key': key}}\ngraph = SmartScraperMultiBatchGraph(prompt=..., source=..., config=config)","handlingStrategy":"validation","validationCode":"model_str = config.get('llm', {}).get('model', '')\nprovider = model_str.split('/')[0] if '/' in model_str else 'openai'\nif provider != 'openai':\n    raise SystemExit(f'Batch graph is OpenAI-only (got {provider}); use SmartScraperMultiGraph')","typeGuard":"def batch_compatible(cfg: dict) -> bool:\n    m = cfg.get('llm', {}).get('model', '')\n    return '/' not in m or m.split('/')[0] == 'openai'","tryCatchPattern":"try:\n    g = SmartScraperMultiBatchGraph(prompt=p, source=s, config=config)\nexcept ValueError as e:\n    if 'only supports OpenAI' in str(e):\n        g = SmartScraperMultiGraph(prompt=p, source=s, config=config)\n    else:\n        raise","preventionTips":["Keep an OpenAI-specific config dict for batch graphs.","Remember bare model names without '/' pass the check — always qualify provider for clarity.","Fall back to SmartScraperMultiGraph for other providers."],"tags":["provider-restriction","openai-only","batch-graph","configuration"],"backgroundTag":"unsupported-provider","analyzedSha":"532dfffbf6ee823a6c9cf8cfedc24a93bf026780","analyzedAt":"2026-08-28T15:19:38.821Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}