-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feature/#173 client name #190
Conversation
astrapy/utils.py
Outdated
def compose_user_agent( | ||
client_name: Optional[str], client_version: Optional[str] | ||
) -> str: | ||
if client_name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing not
?
if client_name: | |
if not client_name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
I suggest this PR stops here (pure internal refactoring) and another one does the actual implementation of new API. Besides the internal refactoring (and the final shape of the Note: the reason I went for |
Closes #173
This proposes simplification and the infrastructure, at the "request functions layer", for optional management of client name and client version by the astrapy classes.
By client_name and client_version it is meant something such as "langchain" and "0.2.0", optionally set by the code that uses astrapy (in a way TBD). This would make for better usage statistics.
None
but the infra is in placeAs per API specs, it is desired that this client_name is first in a slash-separated string. Currently I went for a format, if everything provided, like
"langchain/astrapy/0.7.3/0.2.0"
.Open questions
How exactly should code that uses astrapy "set" or communicate this info, if it desires to? (setter methods or additional params to a lot of class methods? Both?). This is to be defined, hence this is a draft.
Please someone come up with a better naming scheme other than
client_name/version
. There are way too many "clients" around already. On the other hand, "user" seems not right. Caller, perhaps?