BaseProvider. This abstract class defines how ai-blackteam talks to AI models - whether that’s Anthropic’s API, OpenAI, Google, or a local Ollama instance.
Data Classes
Two dataclasses hold results: Two dataclasses hold results:PromptResult
Returned bysend_prompt() and send_in_conversation().
ToolResult
Returned bysend_with_tools().
The BaseProvider Class
Methods
send_prompt(prompt, system_prompt=None) -> PromptResult
Required. Send a single prompt to the model. This is the most basic operation.
send_in_conversation(messages, system_prompt=None) -> PromptResult
Required. Send a conversation history (list of {"role": ..., "content": ...} dicts). Used by multi-turn attacks where each turn builds on previous context.
send_with_tools(messages, tools, system_prompt=None) -> ToolResult
Optional. Send a conversation with tool definitions. Used by tool-use attacks. Returns any tool calls the model wants to make.
Default implementation raises NotImplementedError. Only providers that support function calling need to override this.
default_model() -> str
Required. Returns the default model name for this provider.
supports_tools() -> bool
Returns whether this provider supports tool/function calling. Default is False.
get_model_info() -> dict
Returns basic model info. Used internally by the Engine for logging.
The 7 Providers
| Provider | Default Model | Supports Tools |
|---|---|---|
| Anthropic | claude-sonnet-4-6 | Yes |
| OpenAI | gpt-5.4 | Yes |
| gemini-3.1-pro | Yes | |
| DeepSeek | deepseek-v3 | No |
| Mistral | mistral-large-latest | Yes |
| Ollama | llama3.2 | No |
| HuggingFace | Llama-4-Scout-17B | No |
Source
src/ai-blackteam/providers/base.py