-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Expose a kwargs "add_to_user_agent" #8941
Comments
We do support this per request: But you're right - seem that we (probably I) forgot to add it on init..... :) |
Do you mean we want to expose "add_to_user_agent" for every pipeline run? |
@annatisch yes, |
@xiangyan99 Previously we use something like "client.config.add_user_agent(UA_AGENT_1); client.config.add_user_agent(UA_AGENT_2)" to append our own user agents in Azure CLI code, after your PR #9355 , how can I use kwargs to achieve the same goal? |
@jsntcy the kwargs will be called "user_agent" |
@lmazuel , so if I want to add two use agents as I did before like client.config.add_user_agent(UA_AGENT_1)
client.config.add_user_agent(UA_AGENT_2) do I need use as follows? policy = UserAgentPolicy(),
policy.add_user_agent(UA_AGENT_1),
policy.add_user_agent(UA_AGENT_2),
kwargs['user_agent'] = policy
client(**kwargs) |
Nope, you would have to build the string and pass one kwarg: kwargs['user_agent'] = " ".join(UA_AGENT_1, UA_AGENT_2)
client(**kwargs) You don't instantiate the UserAgentPolicy, that's internal |
Fixed |
Right now it's not possible to add anything to the user-agent unless you create your own policy UserAgentPolicy yourself, which means create your own pipeline.
The text was updated successfully, but these errors were encountered: