Metadata-Version: 2.5
Name: weftai-providers
Version: 0.5.2
Summary: Present a weftai runtime as a tool on OpenAI, Anthropic, Gemini, Bedrock, Ollama, Cohere and other model hosts.
Project-URL: Homepage, https://github.com/tochi-mba/weftai
Project-URL: Documentation, https://github.com/tochi-mba/weftai/tree/main/docs
Author: Rex Technologies
License-Expression: MIT
License-File: LICENSE
Keywords: ai,anthropic,bedrock,cohere,function-calling,gemini,llm,ollama,openai,tool-calling,weftai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27
Requires-Dist: weftai==0.5.2
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.49; extra == 'anthropic'
Description-Content-Type: text/markdown

# weftai-providers

Present a [weftai](https://pypi.org/project/weftai/) runtime as a tool on a model host. weftai
never calls a model itself: each adapter turns one bound plan tool into the tool definition a
host documents, and turns the host's tool calls back into plans. Your application keeps its own
SDK or HTTP client.

```sh
pip install weftai-providers
pip install "weftai-providers[anthropic]"   # adds the Anthropic SDK, for its tool runner
```

```python
from weftai.providers.openai import PRESETS, openai_tools

tools = openai_tools(
    runtime,
    {
        **PRESETS["qwenIntl"],
        "model": "qwen-plus",
        "ctx": ctx,
        "tools": [{"name": "query_tickets", "include": lambda op: op.effects == "read"}],
    },
)
```

## Families

Each family is its own module, so an application imports only the ones it uses.

| Import | Host |
| --- | --- |
| `weftai.providers.openai` | OpenAI Chat Completions and Responses, Azure OpenAI, and OpenAI-compatible hosts through `PRESETS` |
| `weftai.providers.anthropic` | Anthropic Messages tools, and the SDK's tool runner with the `anthropic` extra |
| `weftai.providers.google` | Gemini `generateContent` and Interactions |
| `weftai.providers.bedrock` | Amazon Bedrock Converse |
| `weftai.providers.ollama` | Ollama's native `/api/chat` |
| `weftai.providers.cohere` | Cohere Chat v2 |
| `weftai.providers.dashscope` | Alibaba DashScope Generation and MultiModalConversation |
| `weftai.providers.hunyuan` | Tencent Cloud Hunyuan |
| `weftai.providers.spark` | iFlytek Spark (WebSocket) |
| `weftai.providers.ai_sdk` | The Vercel AI SDK's `tool()` shape |
| `weftai.providers.laya` | A decision service over HTTP, for weftai's decisions interface (below) |

`PRESETS` holds the base URL and settings of hosted, local and regional OpenAI-compatible
hosts, so a preset plus a model name is a complete configuration. The capability catalog checks
known model and API combinations, and names an explicit override when a model is unknown.

## Decisions over HTTP

weftai's decisions interface asks a `Decider` short, typed questions (a choice, a score, a yes or
no) and gets back answers with probabilities. `LayaDecider` is one implementation, for a
decision service reached over HTTP: you supply its endpoint and an `httpx.AsyncClient`, which you
own. Failures and timeouts abstain rather than guess, and what a host does with an answer,
including any permission, stays the host's decision.

## License

MIT
