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

Need a TypeScript client with the same API as the python client #33

Open
JGSweets opened this issue Jul 6, 2023 · 1 comment
Open
Assignees
Labels
help wanted Extra attention is needed New Feature A feature addition not currently in the library

Comments

@JGSweets
Copy link
Contributor

JGSweets commented Jul 6, 2023

Is your feature request related to a problem? Please describe.
Currently, there's only a python client.

Describe the outcome you'd like:
Similar to the python client here:
https://github.com/capitalone/federated-model-aggregation/tree/main/clients

We need a typescript client that similarly interacts with the API.

Additional context:
Mimic the API schema from the python client. Folder structure, etc.

Contributor is able to take liberties from the below.

These are suggested solutions.

Each function can be broken into a separate PR and unit tests created for each.

In a file called settings.ts:

export class DefaultSettings {
    url: string;
    constructor(){
        this.url = "http://127.0.0.1:8000/";
    }
}

In a file called clients.ts:

export class WebClient {
    /**
    *REST API Wrapper to interact with the federated model aggregation service.
    **/
    private _url: string;
    private _uuid: any;
    private _federated_model_id: number;
    is_registered: boolean;
    last_model_aggregate: number | null;
    constructor(federated_model_id:number, uuid:any=null, url:any=null) {
    ...
    }

    private _get_auth_header(uuid=null){...}
    async register() {...}
    async send_update(data:any, base_aggregate=null){...}
    
    async check_for_new_model_aggregate(update_after=null){...}
    async get_current_artifact(){...}
    async check_for_latest_model(update_after=null){...}
    async send_val_results ...
    
    ...
}
@JGSweets
Copy link
Contributor Author

JGSweets commented Jul 6, 2023

PR with tests for:

  • Initialize TS client folder
  • update workflow to run tests in this new folder
  • settings.ts
  • Webclient constructor
  • _get_auth_header
  • register
  • send_update
  • check_for_new_model_aggregate
  • get_current_artifact
  • check_for_latest_model
  • send_val_results
  • Example using TS client

Please add more comments as we need to break further.

@JGSweets JGSweets added help wanted Extra attention is needed New Feature A feature addition not currently in the library labels Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed New Feature A feature addition not currently in the library
Projects
None yet
Development

No branches or pull requests

5 participants