qualifire 1.5.1 → 1.6.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/lib/index.d.ts +2 -1
- package/lib/index.js +5 -1
- package/lib/types.d.ts +4 -0
- package/lib/types.js +4 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -169,10 +169,11 @@ export declare class Qualifire {
|
|
|
169
169
|
* });
|
|
170
170
|
* ```
|
|
171
171
|
**/
|
|
172
|
-
invokeEvaluation: ({ input, output, evaluationId, }: {
|
|
172
|
+
invokeEvaluation: ({ input, output, evaluationId, metadata, }: {
|
|
173
173
|
input: string;
|
|
174
174
|
output: string;
|
|
175
175
|
evaluationId: string;
|
|
176
|
+
metadata?: Record<string, string>;
|
|
176
177
|
}) => Promise<EvaluationResponse | undefined>;
|
|
177
178
|
/**
|
|
178
179
|
* Compiles a prompt from Qualifire Studio with the specified parameters.
|
package/lib/index.js
CHANGED
|
@@ -232,6 +232,7 @@ class Qualifire {
|
|
|
232
232
|
evaluationProxyAPIRequest.topic_scoping_multi_turn_mode,
|
|
233
233
|
topic_scoping_target: evaluationProxyAPIRequest.topicScopingTarget ??
|
|
234
234
|
evaluationProxyAPIRequest.topic_scoping_target,
|
|
235
|
+
metadata: evaluationProxyAPIRequest.metadata,
|
|
235
236
|
};
|
|
236
237
|
const headers = {
|
|
237
238
|
'Content-Type': 'application/json',
|
|
@@ -290,6 +291,8 @@ class Qualifire {
|
|
|
290
291
|
topic_scoping_mode: EvaluationRequestV2.topicScopingMode,
|
|
291
292
|
topic_scoping_multi_turn_mode: EvaluationRequestV2.topicScopingMultiTurnMode,
|
|
292
293
|
topic_scoping_target: EvaluationRequestV2.topicScopingTarget,
|
|
294
|
+
allowed_topics: EvaluationRequestV2.allowedTopics,
|
|
295
|
+
metadata: EvaluationRequestV2.metadata,
|
|
293
296
|
};
|
|
294
297
|
const headers = {
|
|
295
298
|
'Content-Type': 'application/json',
|
|
@@ -324,12 +327,13 @@ class Qualifire {
|
|
|
324
327
|
* });
|
|
325
328
|
* ```
|
|
326
329
|
**/
|
|
327
|
-
this.invokeEvaluation = async ({ input, output, evaluationId, }) => {
|
|
330
|
+
this.invokeEvaluation = async ({ input, output, evaluationId, metadata, }) => {
|
|
328
331
|
const url = `${this.baseUrl}/api/evaluation/invoke`;
|
|
329
332
|
const body = JSON.stringify({
|
|
330
333
|
input,
|
|
331
334
|
output,
|
|
332
335
|
evaluation_id: evaluationId,
|
|
336
|
+
metadata,
|
|
333
337
|
});
|
|
334
338
|
const headers = {
|
|
335
339
|
'Content-Type': 'application/json',
|
package/lib/types.d.ts
CHANGED
|
@@ -173,6 +173,8 @@ export declare const EvaluationRequestV2Schema: z.ZodObject<{
|
|
|
173
173
|
output: "output";
|
|
174
174
|
both: "both";
|
|
175
175
|
}>>;
|
|
176
|
+
allowedTopics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
176
178
|
}, z.core.$strip>;
|
|
177
179
|
export declare const EvaluationProxyAPIRequestSchema: z.ZodObject<{
|
|
178
180
|
input: z.ZodOptional<z.ZodString>;
|
|
@@ -279,6 +281,8 @@ export declare const EvaluationProxyAPIRequestSchema: z.ZodObject<{
|
|
|
279
281
|
output: "output";
|
|
280
282
|
both: "both";
|
|
281
283
|
}>>;
|
|
284
|
+
allowedTopics: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
285
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
282
286
|
}, z.core.$strip>;
|
|
283
287
|
declare const EvaluationResponseSchema: z.ZodObject<{
|
|
284
288
|
evaluationResults: z.ZodArray<z.ZodObject<{
|
package/lib/types.js
CHANGED
|
@@ -119,6 +119,8 @@ exports.EvaluationRequestV2Schema = zod_1.z.object({
|
|
|
119
119
|
topicScopingMode: zod_1.z.enum(ModelModeEnum).default('balanced').optional(),
|
|
120
120
|
topicScopingMultiTurnMode: zod_1.z.boolean().default(false).optional(),
|
|
121
121
|
topicScopingTarget: zod_1.z.enum(PolicyTargetEnum).optional(),
|
|
122
|
+
allowedTopics: zod_1.z.array(zod_1.z.string()).optional(),
|
|
123
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
122
124
|
});
|
|
123
125
|
exports.EvaluationProxyAPIRequestSchema = zod_1.z
|
|
124
126
|
.object({
|
|
@@ -187,6 +189,8 @@ exports.EvaluationProxyAPIRequestSchema = zod_1.z
|
|
|
187
189
|
topicScopingMode: zod_1.z.enum(ModelModeEnum).default('balanced').optional(),
|
|
188
190
|
topicScopingMultiTurnMode: zod_1.z.boolean().default(false).optional(),
|
|
189
191
|
topicScopingTarget: zod_1.z.enum(PolicyTargetEnum).optional(),
|
|
192
|
+
allowedTopics: zod_1.z.array(zod_1.z.string()).optional(),
|
|
193
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
190
194
|
})
|
|
191
195
|
.superRefine((data, ctx) => {
|
|
192
196
|
const hasMessages = Array.isArray(data.messages) && data.messages.length > 0;
|