Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Evals utils #6

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Specify files that shouldn't be modified by Fern
src/ExtendedClient.ts
src/index.ts
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "humanloop",
"version": "0.8.6",
"version": "0.8.7",
"private": false,
"repository": "https://github.com/humanloop/humanloop-node",
"main": "./index.js",
Expand All @@ -12,29 +12,33 @@
"test": "jest"
},
"dependencies": {
"url-join": "4.0.1",
"cli-progress": "^3.12.0",
"form-data": "^4.0.0",
"form-data-encoder": "^4.0.2",
"formdata-node": "^6.0.3",
"nanoid": "^5.0.7",
"node-fetch": "2.7.0",
"p-map": "^7.0.2",
"qs": "6.11.2",
"readable-stream": "^4.5.2",
"form-data-encoder": "^4.0.2"
"url-join": "4.0.1"
},
"devDependencies": {
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/cli-progress": "^3.11.6",
"@types/jest": "29.5.5",
"@types/node": "17.0.33",
"@types/node-fetch": "2.6.9",
"@types/qs": "6.9.8",
"@types/readable-stream": "^4.0.15",
"@types/url-join": "4.0.1",
"fetch-mock-jest": "^1.5.1",
"webpack": "^5.94.0",
"ts-loader": "^9.3.1",
"jest": "29.7.0",
"@types/jest": "29.5.5",
"ts-jest": "29.1.1",
"jest-environment-jsdom": "29.7.0",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
"ts-jest": "29.1.1",
"ts-loader": "^9.3.1",
"typescript": "4.6.4",
"webpack": "^5.94.0"
},
"browser": {
"fs": false,
Expand Down
26 changes: 26 additions & 0 deletions src/ExtendedClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

import { HumanloopClient as BaseHumanloopClient } from "Client";
import { Evaluations as BaseEvaluations} from "api/resources/evaluations/client/Client";

class ExtendedEvaluations extends BaseEvaluations {
constructor(options: BaseHumanloopClient.Options) {
super(options); // Pass options to the parent Evaluations constructor.
}
// TODO: add new methods here
run(): void {
console.log("Running extended evaluation...");
}
}

// Extend the main HumanloopClient to use the new `ExtendedEvaluations`.
export class HumanloopClient extends BaseHumanloopClient {
protected _evaluations: ExtendedEvaluations | undefined;

constructor(protected readonly _options: BaseHumanloopClient.Options) {
super(_options);
}

public get evaluations(): ExtendedEvaluations {
return (this._evaluations ??= new ExtendedEvaluations(this._options));
}
}
48 changes: 24 additions & 24 deletions src/api/resources/datasets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -259,8 +259,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -369,8 +369,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -448,8 +448,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -525,8 +525,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -628,8 +628,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -729,8 +729,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -819,8 +819,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -927,8 +927,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1022,8 +1022,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1108,8 +1108,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1183,8 +1183,8 @@ export class Datasets {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
20 changes: 10 additions & 10 deletions src/api/resources/directories/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class Directories {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -130,8 +130,8 @@ export class Directories {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -212,8 +212,8 @@ export class Directories {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -292,8 +292,8 @@ export class Directories {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -369,8 +369,8 @@ export class Directories {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
36 changes: 18 additions & 18 deletions src/api/resources/evaluations/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -198,8 +198,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -277,8 +277,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -358,8 +358,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -450,8 +450,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -539,8 +539,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -624,8 +624,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -720,8 +720,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -807,8 +807,8 @@ export class Evaluations {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "humanloop",
"X-Fern-SDK-Version": "0.8.6",
"User-Agent": "humanloop/0.8.6",
"X-Fern-SDK-Version": "0.8.7",
"User-Agent": "humanloop/0.8.7",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
Loading
Loading