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

genai: add WithAttribution client option #159

Merged
merged 2 commits into from
Jul 11, 2024
Merged

genai: add WithAttribution client option #159

merged 2 commits into from
Jul 11, 2024

Conversation

jba
Copy link
Collaborator

@jba jba commented Jul 3, 2024

Add an option that lets Google products identify which calls
are made with this client.

@jba jba requested a review from eliben July 3, 2024 19:34
Copy link
Member

@eliben eliben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not objecting to this PR, but I do wonder if this can be emulated with a WithHTTPClient instead of adding new options?

genai/option.go Show resolved Hide resolved
genai/client.go Show resolved Hide resolved
@jba
Copy link
Collaborator Author

jba commented Jul 10, 2024

Not objecting to this PR, but I do wonder if this can be emulated with a WithHTTPClient instead of adding new options?

It's theoretically possible but first, this should work for gRPC as well as HTTP (not that we need that now, but maybe someday) and more importantly, if you use WithHTTPClient it replaces all the setup that the normal client does. You'd have to do your own auth, for example. So it's challenging.

Add an option that lets Google products identify which calls
are made with this client.
@jba jba requested a review from eliben July 10, 2024 23:35
@jba jba merged commit 0994642 into main Jul 11, 2024
2 checks passed
@jba jba deleted the jba/attribution branch July 11, 2024 22:26
eliben pushed a commit that referenced this pull request Jul 11, 2024
Add an option that lets  products identify which calls
are made with this client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants