Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"optional": true
},
"eval-type-backport": "^0.2.0",
"aiofiles": "^24.1.0",
"exceptiongroup": "^1.3.0"
},
"extra_dev_dependencies": {
Expand All @@ -38,8 +37,7 @@
]
},
"testbook": "^0.4.2",
"pydocstyle": "^6.1.1",
"types-aiofiles": "^24.1.0.20240626"
"pydocstyle": "^6.1.1"
},
"extras": {
"examples": [
Expand All @@ -64,6 +62,6 @@
}
]
},
"originGitCommit": "274a9e627c776728cbf8da2fc71627448d122f99",
"sdkVersion": "0.13.12"
"originGitCommit": "2968d0bfb0c9e8d381a274972edb6f7948cf77c6",
"sdkVersion": "0.13.14"
}
167 changes: 165 additions & 2 deletions .fern/replay.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,168 @@ generations:
timestamp: 2026-03-04T21:44:25.857Z
cli_version: unknown
generator_versions: {}
current_generation: 49870a174e0242036241ef71f5ed00f7573d11af
patches: []
- commit_sha: fe01fd08770ba763f2599c946a16b6b338e6e86f
tree_hash: d0b66290fa6e15f864f77fb3fd897340b79062eb
timestamp: 2026-06-15T20:50:01.935Z
cli_version: unknown
generator_versions:
fernapi/fern-python-sdk: 4.61.0
current_generation: fe01fd08770ba763f2599c946a16b6b338e6e86f
patches:
- id: patch-ece510a1
content_hash: sha256:2296c327028f8024cba5c6ffccf276bca01550441a8ddc9ec88499b9e056f429
original_commit: ece510a1ed2211a1803f6964767988211f2a74f9
original_message: Expose temperature parameter on TTS client (#486)
original_author: Rob Hughes <77rgh77@gmail.com>
base_generation: b5be3efc6b1ca84a043b82c57631736c867cac35
files:
- pyproject.toml
patch_content: |
diff --git a/pyproject.toml b/pyproject.toml
index 3b3bc72..d173560 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "hume"
-version = "0.13.12"
+version = "0.13.13"
description = "A Python SDK for Hume AI"
readme = "README.md"
authors = []
theirs_snapshot:
pyproject.toml: |
[project]
name = "hume"
dynamic = ["version"]

[tool.poetry]
name = "hume"
version = "0.13.13"
description = "A Python SDK for Hume AI"
readme = "README.md"
authors = []
keywords = [
"hume",
"ai",
"evi",
"empathic",
"multimodal",
"expression",
"analysis",
"sentiment",
"voice",
"recognition",
"detection",
"emotion",
"interface",
"speech",
"audio",
"vision",
"expressive",
"embeddings",
"communication",
"learning"
]
license = "MIT"
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
"License :: OSI Approved :: MIT License"
]
packages = [
{ include = "hume", from = "src"}
]

[tool.poetry.urls]
Documentation = 'https://dev.hume.ai'
Homepage = 'https://www.hume.ai/'
Repository = 'https://github.com/HumeAI/hume-python-sdk'

[tool.poetry.dependencies]
python = ">=3.9,<4"
aiofiles = "^24.1.0"
eval-type-backport = "^0.2.0"
exceptiongroup = "^1.3.0"
httpx = ">=0.21.2"
jupyter = { version = "^1.0.0", optional = true}
pydantic = ">= 1.9.2"
pydantic-core = ">=2.18.2"
sounddevice = { version = "^0.4.6", optional = true}
typing_extensions = ">= 4.0.0"
websockets = ">=12.0"

[tool.poetry.group.dev.dependencies]
mypy = "==1.13.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
pytest-xdist = "^3.6.1"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"
requests = "^2.31.0"
types-requests = "^2.31.0"
covcheck = { version = "^0.4.3", extras = ["toml"]}
pydocstyle = "^6.1.1"
pydub-stubs = "^0.25.1"
pylint = "^2.16.2"
pytest-cov = "^4.0.0"
ruff = "==0.11.5"
semver = "^2.13.0"
testbook = "^0.4.2"
types-aiofiles = "^24.1.0.20240626"

[tool.pytest.ini_options]
testpaths = [ "tests" ]
asyncio_mode = "auto"

[tool.mypy]
plugins = ["pydantic.mypy"]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
]
ignore = [
"E402", # Module level import not at top of file
"E501", # Line too long
"E711", # Comparison to `None` should be `cond is not None`
"E712", # Avoid equality comparisons to `True`; use `if ...:` checks
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
"E722", # Do not use bare `except`
"E731", # Do not assign a `lambda` expression, use a `def`
"F821", # Undefined name
"F841" # Local variable ... is assigned to but never used
]

[tool.ruff.lint.isort]
section-order = ["future", "standard-library", "third-party", "first-party"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.extras]
examples=["jupyter"]
microphone=["sounddevice"]
status: unresolved
8 changes: 0 additions & 8 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,9 @@ src/hume/client.py
src/hume/empathic_voice/chat/client.py
src/hume/empathic_voice/chat/raw_client.py

# Needs to add .stream to reference expression measurement stream client
# Also wrap the .batch client in BatchClientWithUtils
src/hume/expression_measurement/client.py

# Need to add .stream_input to reference stream_input client
src/hume/tts/client.py

src/hume/expression_measurement/batch/client_with_utils.py
# Backward compatibility for InferenceJob.status
src/hume/expression_measurement/batch/types/inference_job.py
src/hume/empathic_voice/chat/audio/microphone.py
src/hume/empathic_voice/chat/audio/microphone_interface.py
src/hume/empathic_voice/chat/audio/microphone_sender.py
Expand All @@ -39,7 +32,6 @@ src/hume/empathic_voice/chat/audio/chat_client.py
# Manually maintained to support deprecated methods
src/hume/empathic_voice/chat/client.py
src/hume/empathic_voice/chat/socket_client.py
src/hume/expression_measurement/stream/stream/socket_client.py
src/hume/core/websocket.py

# Customize the GitHub workflow to run only Fern tests (not legacy)
Expand Down
41 changes: 10 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ The Hume Python SDK is compatible across several Python versions and operating s

- For the [Empathic Voice Interface](https://dev.hume.ai/docs/empathic-voice-interface-evi/overview), Python versions `3.9` through `3.13` are supported on macOS and Linux.
- For [Text-to-speech (TTS)](https://dev.hume.ai/docs/text-to-speech-tts/overview), Python versions `3.9` through `3.13` are supported on macOS, Linux, and Windows.
- For [Expression Measurement](https://dev.hume.ai/docs/expression-measurement/overview), Python versions `3.9` through `3.13` are supported on macOS, Linux, and Windows.

Below is a table which shows the version and operating system compatibilities by product:

| | Python Version | Operating System |
| ------------------------ | -------------------------------------- | --------------------- |
| Empathic Voice Interface | `3.9`, `3.10`, `3.11`, `3.12`, `3.13` | macOS, Linux |
| Text-to-speech (TTS) | `3.9`, `3.10`, `3.11`, `3.12`, `3.13` | macOS, Linux, Windows |
| Expression Measurement | `3.9`, `3.10`, `3.11`, `3.12`, `3.13` | macOS, Linux, Windows |

## Installation

Expand All @@ -64,7 +62,6 @@ Starter projects that use this SDK:

- **[EVI Python quickstart](https://github.com/HumeAI/hume-api-examples/tree/main/evi/evi-python-quickstart)** — Empathic Voice Interface
- **[TTS Python quickstart](https://github.com/HumeAI/hume-api-examples/tree/main/tts/tts-python-quickstart)** — Text-to-speech
- **[Expression Measurement streaming (Python)](https://github.com/HumeAI/hume-api-examples/tree/main/expression-measurement/streaming/python-streaming-example)** — Streaming expression measurement

## Async Client

Expand All @@ -83,25 +80,9 @@ async def main() -> None:
asyncio.run(main())
```

### Writing File

Writing files with an async stream of bytes can be tricky in Python! `aiofiles` can simplify this some. For example,
you can download your job artifacts like so:

```python
import aiofiles

from hume import AsyncHumeClient

client = AsyncHumeClient()
async with aiofiles.open('artifacts.zip', mode='wb') as file:
async for chunk in client.expression_measurement.batch.get_job_artifacts(id="my-job-id"):
await file.write(chunk)
```

## Namespaces

This SDK contains the APIs for empathic voice, tts, and expression measurement. Even
This SDK contains the APIs for empathic voice and tts. Even
if you do not plan on using more than one API to start, the SDK provides easy access in
case you would like to use additional APIs in the future.

Expand All @@ -112,9 +93,8 @@ from hume.client import HumeClient

client = HumeClient(api_key="YOUR_API_KEY")

client.empathic_voice. # APIs specific to Empathic Voice
client.tts. # APIs specific to Text-to-speech
client.expression_measurement. # APIs specific to Expression Measurement
client.empathic_voice. # APIs specific to Empathic Voice
client.tts. # APIs specific to Text-to-speech
```

## Exception Handling
Expand All @@ -127,7 +107,7 @@ from hume.core import ApiError

client = HumeClient(api_key="YOUR_API_KEY")
try:
client.expression_measurement.batch.get_job_predictions(id="my-job-id")
client.empathic_voice.configs.list_configs()
except ApiError as e:
print(e.status_code)
print(e.body)
Expand Down Expand Up @@ -166,22 +146,21 @@ print(pager.items)

## WebSockets

We expose a websocket client for interacting with the EVI API as well as Expression Measurement.
We expose a websocket client for interacting with the EVI API.

When interacting with these clients, you can use them very similarly to how you'd use the common `websockets` library:

```python
import os

from hume import AsyncHumeClient
from hume.empathic_voice.types import UserInput

client = AsyncHumeClient(api_key=os.getenv("HUME_API_KEY"))
async with client.expression_measurement.stream.connect() as hume_socket:
print(await hume_socket.get_job_details())
async with client.empathic_voice.chat.connect() as hume_socket:
await hume_socket.send_user_input(message=UserInput(text="Hello!"))
```

Model configuration (e.g. face, language, prosody) is sent per payload when you send data (e.g. via `send_publish()`, `send_text()`, or `send_file()`), not at connect time.

The underlying connection, in this case `hume_socket`, will support intellisense/autocomplete for the different functions that are available on the socket!

### Advanced
Expand All @@ -208,7 +187,7 @@ from hume.core import RequestOptions
client = HumeClient(...)

# Override retries for a specific method
client.expression_measurement.batch.get_job_predictions(...,
client.empathic_voice.configs.list_configs(
request_options=RequestOptions(max_retries=5)
)
```
Expand All @@ -228,7 +207,7 @@ client = HumeClient(
)

# Override timeout for a specific method
client.expression_measurement.batch.get_job_predictions(...,
client.empathic_voice.configs.list_configs(
request_options=RequestOptions(timeout_in_seconds=20)
)
```
Expand Down
Loading
Loading