Metadata-Version: 2.4
Name: hyperneuronai
Version: 0.1.22
Summary: Official Python SDK for HyperNeuron AI services
Author-email: HyperNeuronAI <support@hyperneuron.in>
License: MIT
Project-URL: Homepage, https://www.hyperneuronai.com
Project-URL: Repository, https://github.com/hyperneuronai/hyperneuronai-python
Keywords: ai,tts,voice,telephony,speech
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: audio
Requires-Dist: numpy>=1.24.0; extra == "audio"
Requires-Dist: scipy>=1.11.0; extra == "audio"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"

# hyperneuronai
<p align="center">
  <img src="https://i.ibb.co/DHdfV789/logohyperneuronsmall-copy.png" alt="HyperNeuronAI" width="200"/>
</p>

Official Python SDK for [HyperNeuron AI](https://www.hyperneuronai.com) — TTS streaming and AI telephony services.

## Install

```bash
pip install hyperneuronai
```

## Quick start

```python
"""Make an outbound AI voice call (sync)."""
import time
import hyperneuronai

client = hyperneuronai.HyperNeuron(
    api_key="<api-key-get-from-your-account>",
    base_url="https://ai.hyperneuron.in/",
)

### Uncomment for oneway outbound calls
# call = client.telephony.outbound(
#     to_number="+91<10digitphone>",
#     text="Hello! This is an automated call from HyperNeuron. How are you today?",
#     voice="deepraj",
#     language="en",
# )
call = client.telephony.agent_call(
    to_number="+91<10digitphone>",
    greetings="Hello! This is an automated call from HyperNeuron. How are you today?",
    voice="deepraj",
    language="en",
)
print(f"Call initiated: {call.call_uuid}")
print(f"State: {call.state}")

# Poll until call ends
while True:
    time.sleep(5)
    status = client.telephony.status(call.call_uuid)
    print(f"  → {status.state}")
    if status.is_terminal:
        print(f"\nCall ended: {status.state}")
        if status.duration_sec:
            print(f"Duration: {status.duration_sec}s ({status.duration_min:.1f} min)")
        break


client.close()
```



```python
import hyperneuronai

client = hyperneuronai.HyperNeuron(
    api_key="hn_key_xxxx",
    base_url="https://ai.hyperneuron.in",
)

# TTS — save to WAV
audio = client.tts.generate("Hello, world!", voice="sanjana")
with open("hello.wav", "wb") as f:
    f.write(audio)

# TTS — stream in real time
for chunk in client.tts.stream("Hello, world!", voice="sanjana"):
    your_speaker.write(chunk)

# One-way outbound call
call = client.telephony.outbound(
    to="+91<10digitIndianNumber>",
    text="Hi! Your order has shipped and arrives tomorrow.",
    voice="sanjana",
)
print(call.call_uuid, call.state)
```

## Async

```python
import asyncio
import hyperneuronai

async def main():
    async with hyperneuronai.AsyncHyperNeuron(api_key="hn_key_xxxx") as client:
        audio = await client.tts.generate("Hello!")
        call  = await client.telephony.outbound(to="+91<10digitIndianNumber>", text="Hi there!")

asyncio.run(main())
```

## License

MIT
