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

vertex-sdk: Add gcp-labels to llm calls #619

Open
mktce opened this issue Dec 4, 2024 · 2 comments
Open

vertex-sdk: Add gcp-labels to llm calls #619

mktce opened this issue Dec 4, 2024 · 2 comments

Comments

@mktce
Copy link

mktce commented Dec 4, 2024

When using gemini models via vertex API, it is possible to add gcp labels to API calls (https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls). It would be very helpful, if the same was possible for anthropic calls via vertex API.

@RobertCraigie
Copy link
Collaborator

Thanks for the request, what would you want the SDK interface to be?

@mktce
Copy link
Author

mktce commented Dec 5, 2024

I could imagine, that analogous to Google's generateContent endpoint (see https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/generateContent), the MessageCreateParamsBase gets a new property labels that can be used on each create-call, like:

const result = await client.messages.create({
    messages: [{role: 'user', content: 'Hey Claude!'}],
    model: 'claude-3-5-sonnet-v2@20241022',
    labels: {
        'component': 'frontend',
        'team': 'research'
    }
});

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

No branches or pull requests

2 participants