@promptmetrics/sdk 1.0.0

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 ADDED
@@ -0,0 +1,82 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2025-12-30
9
+
10
+ ### 🎉 First Stable Release
11
+
12
+ This is the first production-ready release of the PromptMetrics SDK.
13
+
14
+ ### Added
15
+
16
+ #### Core Features
17
+
18
+ - **Template Management**
19
+
20
+ - Get templates by ID or name
21
+ - List templates with filtering, search, and pagination
22
+ - Support for version and environment label filtering
23
+
24
+ - **Version Management**
25
+
26
+ - Get specific template versions
27
+ - Run versions with variable substitution
28
+ - Update version metadata and environment labels
29
+ - Custom model and parameter overrides
30
+
31
+ - **Prompt Logs**
32
+
33
+ - List execution logs with filtering
34
+ - Filter by template, version, date range, and status
35
+ - Full request/response capture with costs and latency
36
+
37
+ - **LLM Providers**
38
+ - List available providers and models
39
+ - Provider-specific model information
40
+
41
+ #### Tracing & Observability
42
+
43
+ - **@traceable Decorator**
44
+
45
+ - Automatic function tracking with zero configuration
46
+ - Automatic ID generation (trace_id, span_id)
47
+ - Automatic timing capture (start, end, duration)
48
+ - Automatic error handling with stack traces
49
+ - Parent-child relationship tracking for nested functions
50
+
51
+ - **Context-Aware Tracking**
52
+
53
+ - `pm.track.metadata()` - Add metadata without span_id
54
+ - `pm.track.score()` - Track quality scores
55
+ - `pm.track.group()` - Group related traces
56
+
57
+ - **Batch Operations**
58
+
59
+ - Create up to 100 traces in a single request
60
+ - Efficient bulk import for historical data
61
+
62
+ - **LLM Request Correlation**
63
+ - Automatic linking of `pm.versions.run()` to traces
64
+ - End-to-end visibility across custom functions and LLM calls
65
+
66
+ #### Developer Experience
67
+
68
+ - Full TypeScript support with strict typing
69
+ - ESM and CommonJS dual package support
70
+ - Automatic retry logic with exponential backoff
71
+ - Custom error classes for precise error handling
72
+ - Debug mode for request/response logging
73
+ - Comprehensive JSDoc documentation
74
+ - Example scripts for all features
75
+
76
+ ### Technical
77
+
78
+ - Built with TypeScript 5.0+
79
+ - Dual package (CJS + ESM) with tsup
80
+ - Axios-based HTTP client with retry logic
81
+ - Node.js 18+ required
82
+ - AsyncLocalStorage for context propagation
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PromptMetrics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.