valenceai 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/README.dev.md +1 -1
- package/README.md +9 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,49 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.5.1] - 2025-06-24
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Documentation Consistency**: Updated `README.dev.md` to use correct package name `valenceai` instead of outdated `valence-sdk-js`
|
|
12
|
+
- **Developer Experience**: Corrected installation instructions for publishing and development workflows
|
|
13
|
+
- **Package Alignment**: Ensured all development documentation reflects current package naming conventions
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
- **Developer Guidelines**: Updated publish and install commands with correct package names
|
|
17
|
+
- **Consistency**: Aligned development documentation with current v0.5.x package structure
|
|
18
|
+
- **Clarity**: Improved developer onboarding with accurate installation instructions
|
|
19
|
+
|
|
20
|
+
### Publishing
|
|
21
|
+
- **npm Commands**: Verified `npm publish --access public` workflow with correct package name
|
|
22
|
+
- **Installation**: Updated to `npm install valenceai` for consistency with published package
|
|
23
|
+
|
|
24
|
+
## [0.5.0] - 2025-06-23
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **Enhanced API Compatibility**: JavaScript SDK now matches Python SDK's v0.5.0 feature set
|
|
28
|
+
- **Improved Upload Robustness**: Enhanced error handling and retry logic for async uploads
|
|
29
|
+
- **Sequential Upload Strategy**: Maintains reliable upload performance with proper error recovery
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- **Version Alignment**: Updated to v0.5.0 to maintain feature parity with Python SDK
|
|
33
|
+
- **Consistent Documentation**: Updated examples and usage patterns to match Python SDK
|
|
34
|
+
- **Unified User Experience**: Ensures identical functionality across both language implementations
|
|
35
|
+
|
|
36
|
+
### Technical Improvements
|
|
37
|
+
- **Cross-Platform Consistency**: JavaScript SDK maintains same API patterns as Python SDK
|
|
38
|
+
- **Reliable Upload Process**: Sequential part uploads with comprehensive error handling
|
|
39
|
+
- **Maintained Performance**: Optimized upload strategy for JavaScript environment
|
|
40
|
+
|
|
41
|
+
### Documentation
|
|
42
|
+
- **Updated Examples**: Aligned with Python SDK documentation patterns
|
|
43
|
+
- **Consistent Naming**: Maintained unified terminology across both SDKs
|
|
44
|
+
- **Enhanced Guides**: Improved usage examples for better developer experience
|
|
45
|
+
|
|
46
|
+
### Notes
|
|
47
|
+
- **No Breaking Changes**: All existing functionality preserved
|
|
48
|
+
- **Feature Parity**: JavaScript SDK maintains equivalent capabilities to Python SDK
|
|
49
|
+
- **Semantic Versioning**: Version bump reflects alignment with Python SDK capabilities
|
|
50
|
+
|
|
8
51
|
## [0.4.1] - 2025-06-18
|
|
9
52
|
|
|
10
53
|
### Changed
|
package/README.dev.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Valence SDK for Emotion Detection
|
|
1
|
+
# Valence SDK for Emotion Detection
|
|
2
2
|
|
|
3
|
-
**valenceai** is a Node.js SDK for interacting with the [Valence
|
|
3
|
+
**valenceai** is a Node.js SDK for interacting with the [Valence AI](https://getvalenceai.com) Pulse API for emotion detection. It provides a convenient interface to upload audio files -— short or long —- and retrieve detected emotional states.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ While our APIs include the same model offerings in the backend, they are best su
|
|
|
28
28
|
| | DiscreteAPI | AsynchAPI |
|
|
29
29
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
30
|
| Inputs | A short audio file, 4-10s in length. | A long audio file, at least 5s in length. Inputs can be up to 1 GB large. |
|
|
31
|
-
| Outputs | A JSON that includes the primary emotion detected in the file, along with its confidence.
|
|
31
|
+
| Outputs | A JSON that includes the primary emotion detected in the file, along with its confidence. The confidence scores of all other emotions in the model are also returned. | A time-stamped JSON that includes the classified emotion and its confidence at a rate of 1 classification per 5 seconds of audio. |
|
|
32
32
|
| Response Time | 100-500 ms | Dependent upon file size |
|
|
33
33
|
|
|
34
34
|
The **DiscreteAPI** is built for real-time analysis of emotions in audio data. Small snippets of audio are sent to the API to receive feedback in real-time of what emotions are detected based on tone of voice. This API operates on an approximate per-sentence basis, and audio must be cut to the appropriate size.
|
|
@@ -50,7 +50,7 @@ Create a `.env` file in your project root:
|
|
|
50
50
|
```env
|
|
51
51
|
VALENCE_API_KEY=your_api_key # Required: Your Valence API key
|
|
52
52
|
VALENCE_DISCRETE_URL=https://discrete-api-url # Optional: Discrete audio endpoint
|
|
53
|
-
VALENCE_ASYNCH_URL=https://
|
|
53
|
+
VALENCE_ASYNCH_URL=https://asynch-api-url # Optional: Asynch audio endpoint
|
|
54
54
|
VALENCE_LOG_LEVEL=info # Optional: debug, info, warn, error
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -111,7 +111,7 @@ import { ValenceClient } from 'valenceai';
|
|
|
111
111
|
// Custom client configuration
|
|
112
112
|
const client = new ValenceClient(
|
|
113
113
|
2 * 1024 * 1024, // 2MB parts
|
|
114
|
-
5
|
|
114
|
+
5 // 5 retry attempts
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
// Upload with custom configuration
|
|
@@ -161,7 +161,7 @@ Uploads asynch (long) audio files using multipart upload for processing.
|
|
|
161
161
|
|
|
162
162
|
### `client.asynch.emotions(requestId, maxAttempts?, intervalSeconds?)`
|
|
163
163
|
|
|
164
|
-
Retrieves emotion prediction results for
|
|
164
|
+
Retrieves emotion prediction results for asynch audio processing.
|
|
165
165
|
|
|
166
166
|
**Parameters:**
|
|
167
167
|
- `requestId` (string): Request ID from `client.asynch.upload`
|
|
@@ -185,7 +185,7 @@ The APIs expect mono audio in the .wav format. An ideal audio file is recorded a
|
|
|
185
185
|
|
|
186
186
|
For the **DiscreteAPI**, input data is an audio file in the .wav format.
|
|
187
187
|
|
|
188
|
-
For the **AsynchAPI**, input data is an audio file
|
|
188
|
+
For the **AsynchAPI**, input data is an audio file in the .wav format.
|
|
189
189
|
|
|
190
190
|
### Outputs
|
|
191
191
|
|
|
@@ -212,7 +212,7 @@ The emotion returned in `main_emotion` is the highest confidence emotion returne
|
|
|
212
212
|
|
|
213
213
|
```json
|
|
214
214
|
{
|
|
215
|
-
"request_id": "27a33189-bdd7-47ca-9817-
|
|
215
|
+
"request_id": "27a33189-bdd7-47ca-9817-abacfb7bdaf4",
|
|
216
216
|
"status": "completed",
|
|
217
217
|
"emotions": [
|
|
218
218
|
{
|
|
@@ -287,7 +287,7 @@ npm login
|
|
|
287
287
|
npm publish --access public
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
-
## What's New in v0.
|
|
290
|
+
## What's New in v0.5.0
|
|
291
291
|
|
|
292
292
|
### Major Changes
|
|
293
293
|
- **Unified Client Architecture** - Single `ValenceClient` with nested `discrete` and `asynch` clients
|