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 CHANGED
@@ -9,7 +9,7 @@ This is the Javascript SDK for Umbrage Evals. It will have both TypeScript and J
9
9
  To install the package, run the following command:
10
10
 
11
11
  ```bash
12
- npm install evals-sdk
12
+ npm install evals
13
13
  ```
14
14
 
15
15
  ## Dependencies
@@ -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;
@@ -0,0 +1,2 @@
1
+ export { default as Evals } from './evals';
2
+ export { ModelSettings, Prompt, RequestData, } from './types';
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
+ };
@@ -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.1",
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
- "OpenAI",
25
- "agents",
26
- "functions",
27
- "function calling"
24
+ "evals",
25
+ "umbrage",
26
+ "ai",
27
+ "sdk"
28
28
  ],
29
29
  "author": "umbrage.ai",
30
30
  "license": "UNLICENSED",