Metadata-Version: 2.3
Name: axa-yap
Version: 0.1.4
Summary: Windows hold-to-speak dictation app using SecureGPT.
Requires-Dist: numpy>=1.24
Requires-Dist: openai>=1.0,<2
Requires-Dist: pynput>=1.7
Requires-Dist: pyperclip>=1.8
Requires-Dist: python-dotenv>=1.0
Requires-Dist: requests>=2.34.2
Requires-Dist: sounddevice>=0.4
Requires-Dist: soxr>=0.3
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# AXA YAP : Hold-to-speak dictation app powered by SecureGPT

Hold a hotkey, speak, release and your speech is transcribed and pasted at the cursor.

![Demo](./assets/axa_yap.gif)

## Requirements

- Windows 11
- Python 3.13+
- [uv](https://docs.astral.sh/uv/getting-started/installation/) installed

## Configuration

### Option 1 : Manually set environment variables

Set the following environment variables:

```sh
# SecureGPT credentials
ONEACCOUNT_LOGIN_URL=https://onelogin.axa.com
MHUB_API_URL=https://api.se.axa-go.applications.services.axa-tech.intraxa/ago-m365-securegpt-hub-v1-vrs
MHUB_CLIENT_ID=<your-client-id>
MHUB_CLIENT_SECRET=<your-client-secret>
MHUB_API_VERSION=2025-04-01-preview
```

Optionally, you can set these as well:

```sh
# Hotkey combo to hold while speaking (default: Ctrl+Alt+Space)
AXA_YAP_HOTKEY=<ctrl>+<alt>+<space>

# OpenAI transcription model
AXA_YAP_TRANSCRIPTION_MODEL=gpt-4o-transcribe-2025-03-20

# Microphone device index (run uvx axa_yap --list-devices to find yours, leave empty for default)
# Pass the index of the device (e.g. "0")
AXA_YAP_MIC_DEVICE=

# Language hint for transcription (e.g. "en", "fr"). Default: "en"
# Doesn't do much
AXA_YAP_LANGUAGE=en
```

### Option 2: Use a .env file

Create a `.env` file in whatever location you want, and specify its path in the environment variable `AXA_YAP_DOTENV_PATH`.

## Usage

Run directly with `uvx` (no manual install needed):

```
uvx axa_yap
```

**Important**: Use `uvx axa_yap --list-devices` to find your microphone index if the default doesn't work, and set `AXA_YAP_MIC_DEVICE` accordingly.


### CLI Options

```sh
uvx axa_yap --list-devices # List available audio input devices
uvx axa_yap --install      # Register app to start automatically on Windows login
uvx axa_yap --uninstall    # Remove app from Windows startup
```

### Instructions

1. **Hold** the hotkey (default `Ctrl+Alt+Space`) : recording starts and an overlay appears.
2. **Speak** while holding the keys.
3. **Release**: audio is sent to SecureGPT for transcription.
4. The transcribed text is automatically **pasted** at your current cursor position.