{"record":{"id":"f9ab72869c6ed318","repo":"xtekky/gpt4free","slug":"provider-name-has-no-supported-create-method","errorCode":null,"errorMessage":"{provider_name} has no supported create method","messagePattern":"(.+?) has no supported create method","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"g4f/providers/config_provider.py","lineNumber":578,"sourceCode":"            )\n            if not current_api_key or AppConfig.disable_custom_api_key:\n                current_api_key = AuthManager.load_api_key(provider)\n            if current_api_key:\n                extra_body[\"api_key\"] = current_api_key\n\n            try:\n                if hasattr(provider, \"create_async_generator\"):\n                    async for chunk in provider.create_async_generator(\n                        target_model, messages, **extra_body\n                    ):\n                        yield chunk\n                elif hasattr(provider, \"create_completion\"):\n                    for chunk in provider.create_completion(\n                        target_model, messages, **extra_body\n                    ):\n                        yield chunk\n                else:\n                    raise NotImplementedError(\n                        f\"{provider_name} has no supported create method\"\n                    )\n                debug.log(f\"config.yaml: {provider_name} succeeded for model {model!r}\")\n                return  # Success\n            except Exception as e:\n                # On rate-limit errors invalidate the quota cache\n                from ..errors import RateLimitError\n\n                if isinstance(e, RateLimitError) or \"429\" in str(e):\n                    debug.log(\n                        f\"config.yaml: Rate-limited by {provider_name}, \"\n                        \"invalidating quota cache\"\n                    )\n                    QuotaCache.invalidate(provider_name)\n\n                ErrorCounter.increment(provider_name)\n                last_exception = e\n                debug.error(f\"config.yaml: {provider_name} failed:\", e)","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/providers/config_provider.py#L560-L596","documentation":"NotImplementedError raised in config_provider's dispatch loop: the resolved provider class exposes neither create_async_generator nor create_completion, so there is no way to call it. It flags provider classes that are abstract helpers, base classes, or pure utility classes being listed directly in config.yaml.","triggerScenarios":"A config.yaml entry points at a class like a base provider, an ignored/deprecated stub, or a helper with only get_quota — the dispatch checks hasattr for both create methods and both fail.","commonSituations":"Listing base or internal provider names (e.g. AsyncGeneratorProvider itself, or an 'Ignored' provider) in config.yaml; g4f refactors that strip create methods from a provider while configs still reference it.","solutions":["Replace the entry with a concrete provider that implements create_async_generator or create_completion (most working providers do).","List available working providers via g4f.Provider and pick one whose needs_auth/working flags are set.","Update g4f in case the named provider was recently fixed to implement a create method.","Remove the entry — other providers in the chain will still be tried (this error is caught per-provider, but the entry never succeeds)."],"exampleFix":"# before (config.yaml)\nproviders:\n  - provider: \"BaseProvider\"\n\n# after\nproviders:\n  - provider: \"OpenaiChat\"","handlingStrategy":"validation","validationCode":"def is_callable_provider(p) -> bool:\n    return hasattr(p, 'create_async_generator') or hasattr(p, 'create_completion')\n\nbad = [n for n, p in resolved_providers.items() if not is_callable_provider(p)]\nif bad:\n    raise ValueError(f'providers without a create method: {bad}')","typeGuard":"def is_callable_provider(p) -> bool:\n    return hasattr(p, 'create_async_generator') or hasattr(p, 'create_completion')","tryCatchPattern":null,"preventionTips":["List only concrete providers in config.yaml, never base/utility classes.","Validate with hasattr checks when building provider lists programmatically.","Prefer providers whose .working flag is True."],"tags":["config","yaml","provider-resolution","not-implemented","g4f"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}