evals 0.0.1 → 0.0.2
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/README.md +1 -1
- package/dist/evals.d.ts +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +26 -0
- package/dist/types.d.ts +18 -0
- package/package.json +5 -5
package/README.md
CHANGED
package/dist/evals.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="bun-types" />
|
|
2
|
+
import { RequestData } from './types';
|
|
3
|
+
declare class Evals {
|
|
4
|
+
private apiKey;
|
|
5
|
+
private endpoint;
|
|
6
|
+
constructor(apiKey: string, endpoint?: string);
|
|
7
|
+
logPrompt(requestData: RequestData): Promise<Response>;
|
|
8
|
+
}
|
|
9
|
+
export default Evals;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/evals.ts
|
|
2
|
+
class Evals {
|
|
3
|
+
apiKey;
|
|
4
|
+
endpoint;
|
|
5
|
+
constructor(apiKey, endpoint = "https://sdk-request-handler.groff.workers.dev") {
|
|
6
|
+
this.apiKey = apiKey;
|
|
7
|
+
this.endpoint = endpoint;
|
|
8
|
+
}
|
|
9
|
+
async logPrompt(requestData) {
|
|
10
|
+
const response = await fetch(this.endpoint, {
|
|
11
|
+
method: "POST",
|
|
12
|
+
headers: {
|
|
13
|
+
"Content-Type": "application/json"
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
api_key: this.apiKey,
|
|
17
|
+
...requestData
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
return response;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var evals_default = Evals;
|
|
24
|
+
export {
|
|
25
|
+
evals_default as Evals
|
|
26
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ModelSettings {
|
|
2
|
+
temperature?: number;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface Prompt {
|
|
6
|
+
prompt_type: string;
|
|
7
|
+
prompt_text: string;
|
|
8
|
+
}
|
|
9
|
+
export interface RequestData {
|
|
10
|
+
prompt_name: string;
|
|
11
|
+
environment: string;
|
|
12
|
+
model: string;
|
|
13
|
+
model_settings: ModelSettings;
|
|
14
|
+
prompts: Prompt[];
|
|
15
|
+
response: string;
|
|
16
|
+
request_timestamp: string;
|
|
17
|
+
response_timestamp: string;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.2",
|
|
8
8
|
"description": "SDK for Umbrage Evals",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "bun build --target=node ./src/index.ts --outfile=dist/index.js && bun run build:declaration",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"typescript": "^5.0.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
24
|
+
"evals",
|
|
25
|
+
"umbrage",
|
|
26
|
+
"ai",
|
|
27
|
+
"sdk"
|
|
28
28
|
],
|
|
29
29
|
"author": "umbrage.ai",
|
|
30
30
|
"license": "UNLICENSED",
|