Metadata-Version: 2.4
Name: neurocli-sdk
Version: 1.2.4
Summary: The official Python SDK for the NeuroCLI API
Home-page: https://www.neurocli.in
Author: NeuroCLI
Author-email: NeuroCLI <info@neurocli.in>
License: MIT
Project-URL: Homepage, https://www.neurocli.in
Project-URL: Documentation, https://www.neurocli.in/docs
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: tenacity>=8.0.0
Requires-Dist: pydantic>=2.0.0
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# NeuroCLI Python SDK

The official Python library for the NeuroCLI API. 

## Installation

You can install this SDK locally:
```bash
pip install -e .
```

## Usage

The SDK mimics the standard OpenAI Python client interface, making it extremely easy to drop into existing AI applications.

### Basic Chat Completion

```python
import neurocli

# Initialize the client
client = neurocli.NeuroCLI(
    api_key="ncli_YOUR_SECRET_KEY",
    # During local testing, point this to your local server:
    # base_url="http://127.0.0.1:8000/api/ai" 
    # Optionally configure where sensitive PII is routed:
    # hybrid_fallback_url="https://neurocli.in/api/isolated" 
)

# Generate a response
response = client.chat.completions.create(
    model="neurocli-delta",
    messages=[
        {"role": "user", "content": "Explain quantum computing in simple terms."}
    ],
    temperature=0.7
)

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

### BYOH Hybrid Routing (PII Detection)

NeuroCLI features an industry-first BYOH (Bring Your Own Hardware) Hybrid Router built directly into the SDK. 

If you pass `hybrid_routing=True`, the SDK uses a local `PIIScanner` to detect highly sensitive Personally Identifiable Information (like SSNs and Credit Cards) in your prompt. If detected, it immediately aborts the cloud request and re-routes the prompt to your configured fallback (which defaults to the `https://neurocli.in/api/isolated` Enterprise Isolated Cluster, but can be configured to point to your own private on-premise cloud or local Ollama instance).

```python
response = client.chat.completions.create(
    model="neurocli-delta",
    messages=[
        {"role": "user", "content": "My SSN is 123-45-6789. Can you process my loan?"}
    ],
    hybrid_routing=True
)
# If PII is detected, this request is re-routed to the secure isolated cluster!
```

### Medical Reasoning

The `NeuroCLI` client also supports clinical-grade response generation via the specialized `MedicalReasoning` subsystem:

```python
medical = client.medical.analyze(
    symptoms="Patient presents with severe localized headache and visual auras.",
    stream=True
)

for chunk in medical:
    print(chunk.choices[0].delta.content, end="")
```
