Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Move update task interaction into OasstApiClient

Open jack-michaud opened this issue 2 years ago • 4 comments

Note: Waiting for https://github.com/LAION-AI/Open-Assistant/pull/342 to be merged.

The website directly calls the backend through fetch here when it should be called through the OasstApiClient.

  1. Create a new method in website/src/lib/oasst_api_client.ts's OasstApiClient which makes the API call done here.
  2. Replace the original fetch call with the method call on OasstApiClient.
  3. Write a test in website/cypress/contract/oasst_api_contract_tests.cy.ts which calls that function and checks that the response is not null. An example of such a test can be found here

jack-michaud avatar Jan 04 '23 02:01 jack-michaud

I haven't been tracking what this OasstApiClient does. Could you outline what it's core methods are?

fozziethebeat avatar Jan 04 '23 03:01 fozziethebeat

Nevermind, seeing the PR, i see this is a new thing you're creating. I like it.

fozziethebeat avatar Jan 04 '23 03:01 fozziethebeat

Before closing this out, can you also do some refactoring to tackle #105? This basically needs to change how you set the user field in the body being posted.

fozziethebeat avatar Jan 04 '23 03:01 fozziethebeat

Before closing this out, can you also do some refactoring to tackle #105? This basically needs to change how you set the user field in the body being posted.

Sure, I can supply the JWT in the constructor of OasstApiClient so the client can be aware of the current user.

jack-michaud avatar Jan 04 '23 04:01 jack-michaud