Metadata-Version: 2.2
Name: genorbex
Version: 0.1.0
Summary: Official Python SDK for Genorbex prompts and model serving.
Author-email: Genorbex AI <support@genorbex.com>
License: MIT
Project-URL: Homepage, https://www.genorbex.com
Project-URL: Documentation, https://www.genorbex.com/orbexdb/ai-ml/prompts
Project-URL: Source, https://github.com/johnyogu/naijamarket
Keywords: genorbex,mlflow,prompt-registry,model-serving,genai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: mlflow
Requires-Dist: mlflow>=3.0; extra == "mlflow"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"

# Genorbex Python SDK

Official Python client for the Genorbex Prompt Registry and OpenAI-compatible model-serving endpoints.

## Install

```bash
python -m pip install genorbex
```

Install MLflow support when your environment does not already include MLflow:

```bash
python -m pip install "genorbex[mlflow]"
```

## Authenticate

Create an API key at `https://www.genorbex.com/settings/api-keys`, then configure it as an environment variable:

```bash
export GENORBEX_API_KEY="your_api_key"
```

Managed Genorbex notebooks authenticate automatically and do not require this variable.

For a self-hosted installation, also set:

```bash
export GENORBEX_HOST="https://your-genorbex-host.example"
```

## Load and invoke a registered prompt

```python
import mlflow
from genorbex.sdk import ClientSpace

prompt = mlflow.genai.load_prompt(
    "prompts:/main.data_science.sales_summary@production"
)

formatted_prompt = prompt.format(
    number_of_sentences=3,
    sales_data="Revenue increased by 12% in July.",
)

client = ClientSpace().serving_endpoints.get_open_ai_client()
response = client.chat.completions.create(
    model="databricks-claude-sonnet-4-5",
    messages=[{"role": "user", "content": formatted_prompt}],
)

print(response.choices[0].message.content)
```

The SDK uses only the Python standard library at runtime. Python 3.9 or newer is required.

## Direct prompt loading

Applications that do not use MLflow can load the same registered prompt directly:

```python
from genorbex.sdk import ClientSpace

workspace = ClientSpace()
prompt = workspace.prompts.load(
    "prompts:/main.data_science.sales_summary@production"
)
```

## License

MIT

