scorecard-ai 1.0.0-alpha.9 → 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.
Files changed (103) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +4 -4
  7. package/client.js.map +1 -1
  8. package/client.mjs +4 -4
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +6 -6
  11. package/lib/runAndEvaluate.d.mts +20 -8
  12. package/lib/runAndEvaluate.d.mts.map +1 -1
  13. package/lib/runAndEvaluate.d.ts +20 -8
  14. package/lib/runAndEvaluate.d.ts.map +1 -1
  15. package/lib/runAndEvaluate.js +31 -21
  16. package/lib/runAndEvaluate.js.map +1 -1
  17. package/lib/runAndEvaluate.mjs +31 -21
  18. package/lib/runAndEvaluate.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resources/index.d.mts +2 -2
  21. package/resources/index.d.mts.map +1 -1
  22. package/resources/index.d.ts +2 -2
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js +4 -4
  25. package/resources/index.js.map +1 -1
  26. package/resources/index.mjs +2 -2
  27. package/resources/index.mjs.map +1 -1
  28. package/resources/metrics.d.mts +421 -0
  29. package/resources/metrics.d.mts.map +1 -0
  30. package/resources/metrics.d.ts +421 -0
  31. package/resources/metrics.d.ts.map +1 -0
  32. package/resources/metrics.js +33 -0
  33. package/resources/metrics.js.map +1 -0
  34. package/resources/metrics.mjs +29 -0
  35. package/resources/metrics.mjs.map +1 -0
  36. package/resources/runs.d.mts +5 -5
  37. package/resources/runs.d.mts.map +1 -1
  38. package/resources/runs.d.ts +5 -5
  39. package/resources/runs.d.ts.map +1 -1
  40. package/resources/runs.js +1 -1
  41. package/resources/runs.mjs +1 -1
  42. package/resources/systems/index.d.mts +3 -0
  43. package/resources/systems/index.d.mts.map +1 -0
  44. package/resources/systems/index.d.ts +3 -0
  45. package/resources/systems/index.d.ts.map +1 -0
  46. package/resources/systems/index.js +9 -0
  47. package/resources/systems/index.js.map +1 -0
  48. package/resources/systems/index.mjs +4 -0
  49. package/resources/systems/index.mjs.map +1 -0
  50. package/resources/systems/systems.d.mts +229 -0
  51. package/resources/systems/systems.d.mts.map +1 -0
  52. package/resources/systems/systems.d.ts +229 -0
  53. package/resources/systems/systems.d.ts.map +1 -0
  54. package/resources/systems/systems.js +151 -0
  55. package/resources/systems/systems.js.map +1 -0
  56. package/resources/systems/systems.mjs +146 -0
  57. package/resources/systems/systems.mjs.map +1 -0
  58. package/resources/systems/versions.d.mts +132 -0
  59. package/resources/systems/versions.d.mts.map +1 -0
  60. package/resources/systems/versions.d.ts +132 -0
  61. package/resources/systems/versions.d.ts.map +1 -0
  62. package/resources/{system-configs.js → systems/versions.js} +26 -25
  63. package/resources/systems/versions.js.map +1 -0
  64. package/resources/{system-configs.mjs → systems/versions.mjs} +24 -23
  65. package/resources/systems/versions.mjs.map +1 -0
  66. package/resources/systems.d.mts +1 -224
  67. package/resources/systems.d.mts.map +1 -1
  68. package/resources/systems.d.ts +1 -224
  69. package/resources/systems.d.ts.map +1 -1
  70. package/resources/systems.js +2 -139
  71. package/resources/systems.js.map +1 -1
  72. package/resources/systems.mjs +1 -137
  73. package/resources/systems.mjs.map +1 -1
  74. package/resources/testsets.d.mts +1 -1
  75. package/resources/testsets.d.ts +1 -1
  76. package/resources/testsets.js +1 -1
  77. package/resources/testsets.mjs +1 -1
  78. package/src/client.ts +14 -26
  79. package/src/lib/runAndEvaluate.ts +52 -27
  80. package/src/resources/index.ts +2 -8
  81. package/src/resources/metrics.ts +525 -0
  82. package/src/resources/runs.ts +5 -5
  83. package/src/resources/systems/index.ts +18 -0
  84. package/src/resources/systems/systems.ts +299 -0
  85. package/src/resources/systems/versions.ts +166 -0
  86. package/src/resources/systems.ts +1 -277
  87. package/src/resources/testsets.ts +1 -1
  88. package/src/version.ts +1 -1
  89. package/version.d.mts +1 -1
  90. package/version.d.mts.map +1 -1
  91. package/version.d.ts +1 -1
  92. package/version.d.ts.map +1 -1
  93. package/version.js +1 -1
  94. package/version.js.map +1 -1
  95. package/version.mjs +1 -1
  96. package/version.mjs.map +1 -1
  97. package/resources/system-configs.d.mts +0 -148
  98. package/resources/system-configs.d.mts.map +0 -1
  99. package/resources/system-configs.d.ts +0 -148
  100. package/resources/system-configs.d.ts.map +0 -1
  101. package/resources/system-configs.js.map +0 -1
  102. package/resources/system-configs.mjs.map +0 -1
  103. package/src/resources/system-configs.ts +0 -189
@@ -1,189 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from '../core/pagination';
6
- import { RequestOptions } from '../internal/request-options';
7
- import { path } from '../internal/utils/path';
8
-
9
- export class SystemConfigs extends APIResource {
10
- /**
11
- * Create a new configuration for a system.
12
- *
13
- * Each configuration contains specific parameter values that match the system's
14
- * configSchema - things like model parameters, thresholds, or processing options.
15
- * Once created, configurations cannot be modified, ensuring stable reference
16
- * points for evaluations.
17
- *
18
- * When creating a configuration:
19
- *
20
- * - The 'config' object is validated against the parent system's configSchema
21
- * - Configurations with validation errors are still stored, with errors included
22
- * in the response
23
- * - Validation errors indicate fields that don't match the schema but don't
24
- * prevent creation
25
- * - Having validation errors may affect how some evaluation metrics are calculated
26
- *
27
- * @example
28
- * ```ts
29
- * const systemConfig = await client.systemConfigs.create(
30
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
31
- * {
32
- * config: {
33
- * temperature: 0.1,
34
- * maxTokens: 1024,
35
- * model: 'gpt-4-turbo',
36
- * },
37
- * name: 'Production (Low Temperature)',
38
- * },
39
- * );
40
- * ```
41
- */
42
- create(
43
- systemID: string,
44
- body: SystemConfigCreateParams,
45
- options?: RequestOptions,
46
- ): APIPromise<SystemConfig> {
47
- return this._client.post(path`/systems/${systemID}/configs`, { body, ...options });
48
- }
49
-
50
- /**
51
- * Retrieve a paginated list of configurations for a specific system.
52
- *
53
- * System configurations provide concrete parameter values for a System Under Test,
54
- * defining exactly how the system should be configured during an evaluation run.
55
- *
56
- * @example
57
- * ```ts
58
- * // Automatically fetches more pages as needed.
59
- * for await (const systemConfig of client.systemConfigs.list(
60
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
61
- * )) {
62
- * // ...
63
- * }
64
- * ```
65
- */
66
- list(
67
- systemID: string,
68
- query: SystemConfigListParams | null | undefined = {},
69
- options?: RequestOptions,
70
- ): PagePromise<SystemConfigsPaginatedResponse, SystemConfig> {
71
- return this._client.getAPIList(path`/systems/${systemID}/configs`, PaginatedResponse<SystemConfig>, {
72
- query,
73
- ...options,
74
- });
75
- }
76
-
77
- /**
78
- * Retrieve a specific system configuration by ID.
79
- *
80
- * @example
81
- * ```ts
82
- * const systemConfig = await client.systemConfigs.get(
83
- * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
84
- * );
85
- * ```
86
- */
87
- get(systemConfigID: string, options?: RequestOptions): APIPromise<SystemConfig> {
88
- return this._client.get(path`/systems/configs/${systemConfigID}`, options);
89
- }
90
- }
91
-
92
- export type SystemConfigsPaginatedResponse = PaginatedResponse<SystemConfig>;
93
-
94
- /**
95
- * A SystemConfig defines the specific settings for a System Under Test.
96
- *
97
- * Configurations contain parameter values that determine system behavior during
98
- * evaluation. They are immutable snapshots - once created, they never change.
99
- *
100
- * When running evaluations, you reference a specific configId to establish which
101
- * configuration to test.
102
- *
103
- * Configurations will be validated against the system's configSchema, with
104
- * non-conforming values generating warnings.
105
- */
106
- export interface SystemConfig {
107
- /**
108
- * The ID of the system configuration.
109
- */
110
- id: string;
111
-
112
- /**
113
- * The configuration of the system.
114
- */
115
- config: Record<string, unknown>;
116
-
117
- /**
118
- * The name of the system configuration.
119
- */
120
- name: string;
121
-
122
- /**
123
- * The ID of the system the configuration belongs to.
124
- */
125
- systemId: string;
126
-
127
- /**
128
- * Validation errors found in the configuration. If present, the configuration
129
- * doesn't fully conform to its system's configSchema.
130
- */
131
- validationErrors?: Array<SystemConfig.ValidationError>;
132
- }
133
-
134
- export namespace SystemConfig {
135
- export interface ValidationError {
136
- /**
137
- * Human-readable error description.
138
- */
139
- message: string;
140
-
141
- /**
142
- * JSON Pointer to the field with the validation error.
143
- */
144
- path: string;
145
- }
146
- }
147
-
148
- export interface SystemConfigCreateParams {
149
- /**
150
- * The configuration of the system.
151
- */
152
- config: Record<string, unknown>;
153
-
154
- /**
155
- * The name of the system configuration.
156
- */
157
- name: string;
158
-
159
- /**
160
- * Validation errors found in the configuration. If present, the configuration
161
- * doesn't fully conform to its system's configSchema.
162
- */
163
- validationErrors?: Array<SystemConfigCreateParams.ValidationError>;
164
- }
165
-
166
- export namespace SystemConfigCreateParams {
167
- export interface ValidationError {
168
- /**
169
- * Human-readable error description.
170
- */
171
- message: string;
172
-
173
- /**
174
- * JSON Pointer to the field with the validation error.
175
- */
176
- path: string;
177
- }
178
- }
179
-
180
- export interface SystemConfigListParams extends PaginatedResponseParams {}
181
-
182
- export declare namespace SystemConfigs {
183
- export {
184
- type SystemConfig as SystemConfig,
185
- type SystemConfigsPaginatedResponse as SystemConfigsPaginatedResponse,
186
- type SystemConfigCreateParams as SystemConfigCreateParams,
187
- type SystemConfigListParams as SystemConfigListParams,
188
- };
189
- }