Fosowl/agenticSeek · error · NotImplementedError
{str(e)} Is {self.provider_name} implemented ?
Error message
{str(e)}
Is {self.provider_name} implemented ? What it means
In Provider.respond (sources/llm_provider.py:90), an AttributeError raised inside a provider function is re-raised as NotImplementedError with the message 'Is <provider> implemented ?'. The library assumes AttributeErrors mean the provider's implementation references a missing attribute or method, so it converts them into a clearer 'not implemented' hint naming the provider.
Source
Thrown at sources/llm_provider.py:90
if not url: # running on host
return "http://localhost", False
return url, True
def respond(self, history, verbose=True):
"""
Use the choosen provider to generate text.
"""
llm = self.available_providers[self.provider_name]
self.logger.info(f"Using provider: {self.provider_name} at {self.server_ip}")
try:
thought = llm(history, verbose)
except KeyboardInterrupt:
self.logger.warning("User interrupted the operation with Ctrl+C")
return "Operation interrupted by user. REQUEST_EXIT"
except ConnectionError as e:
raise ConnectionError(f"{str(e)}\nConnection to {self.server_ip} failed.")
except AttributeError as e:
raise NotImplementedError(f"{str(e)}\nIs {self.provider_name} implemented ?")
except ModuleNotFoundError as e:
raise ModuleNotFoundError(
f"{str(e)}\nA import related to provider {self.provider_name} was not found. Is it installed ?")
except Exception as e:
if "try again later" in str(e).lower():
return f"{self.provider_name} server is overloaded. Please try again later."
if "refused" in str(e):
return f"Server {self.server_ip} seem offline. Unable to answer."
raise Exception(f"Provider {self.provider_name} failed: {str(e)}") from e
return thought
def is_ip_online(self, address: str, timeout: int = 10) -> bool:
"""
Check if an address is online by sending a ping request.
"""
if not address:
return False
parsed = urlparse(address if address.startswith(('http://', 'https://')) else f'http://{address}')View on GitHub (pinned to ae57a23577)
Solutions
- Check the original AttributeError text (shown above the hint) to find the missing attribute and the provider function that touched it.
- Verify the provider SDK version matches what the library expects (pip show openai/ollama/etc.) and upgrade or pin accordingly.
- Inspect the provider function for the selected provider (self.available_providers mapping) and confirm every attribute/method it uses exists on the objects returned by that SDK.
- If you wrote a custom provider function, implement the missing attribute/method or return an object with the expected shape.
Example fix
// before (AttributeError inside openai_fn with old SDK usage) thought = response.choices[0].text // after thought = response.choices[0].message.content
Defensive patterns
Strategy: try-catch
Validate before calling
import importlib
def provider_sdk_ready(provider_name: str) -> bool:
required = {
'huggingface': 'huggingface_hub',
'together': 'together',
'anthropic': 'anthropic',
'litellm': 'litellm',
'dsk_deepseek': 'dsk.api',
}.get(provider_name)
return required is None or importlib.util.find_spec(required.split('.')[0]) is not None Type guard
def has_attr_safe(obj, names: list[str]) -> bool:
return all(hasattr(obj, n) for n in names)
# e.g. before reading the completion:
# has_attr_safe(response, ['choices']) and has_attr_safe(response.choices[0], ['message']) Try / catch
from provider import Provider
try:
res = provider.respond(history)
except NotImplementedError as e:
print(f"Provider code incomplete or SDK mismatch: {e}")
print(f"Cause: {e.__cause__}") # original AttributeError
except Exception as e:
raise Prevention
- Pin provider SDK versions in requirements.txt and test upgrades before deploying.
- Before calling respond(), smoke-test each provider function with a minimal history to catch attribute mismatches early.
- When writing custom provider functions, validate SDK response objects (hasattr checks) before accessing nested attributes.
- Check the chained __cause__ of NotImplementedError to see the real AttributeError instead of guessing.
When it happens
Trigger: A provider function (e.g. ollama_fn, openai_fn) raises AttributeError while respond() dispatches it via self.available_providers[self.provider_name] — e.g. calling an attribute that doesn't exist on a response object (response.choices[0].message on a malformed payload), or an SDK attribute absent in the installed library version.
Common situations: An SDK version change renamed or removed an attribute (e.g. openai client migration); a provider function accesses response fields that don't exist because the API returned an error payload; a typo or partially-implemented custom provider; calling a method on None when a request returned nothing.
Related errors
- Model not set
- Ollama connection failed. is the server running ?
- Tool must be a callable object (a method)
- Prompt file not found at path: {file_path}
- Permission denied to read prompt file at path: {file_path}
AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30).
Data as JSON: /api/errors/1a6abfbffe9d2da5.
Report an issue: GitHub.