nomic-ai / ts-nomic

Typescript bindings for Atlas
MIT License
5 stars 4 forks source link

feat: add 'Viewer' class disentangled from 'User' #48

Closed bmschmidt closed 4 months ago

bmschmidt commented 6 months ago

This PR disentangles two concepts in the module:

  1. The AtlasUser in the system, which is a set of information like an e-mail, a name, a profile picture, etc.
  2. The basket of permissions that we hit the API endpoint with.

Fusing them together leads to a monstrous solipsism where the AtlasUser cannot imagine any user other than himself. He cannot collaborate with other AtlasUsers unless they give him full access to their APIKeys and authority to hit endpoints with them.

Following practice at Meta, we introduce a new fundamental class called the AtlasViewer, which is the agent making requests. AtlasUser is just the person in the system. For the time being AtlasUser still accepts keys in its constructor, but it passes them through to the underlying AtlasViewer: this behavior will probably be deprecated in version 1.0.


:rocket: This description was created by Ellipsis for commit 325def1b5a94e69e777489aae5a5673b1cef6785

Summary:

Refactored the SDK to introduce AtlasViewer for handling API requests, separating it from AtlasUser which now only represents user information.

Key points:


Generated with :heart: by ellipsis.dev

bmschmidt commented 5 months ago

@ellipses-dev review this