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

Add usageMetadata to GenerateContentResponse in Vertex AI #12777

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

andrewheard
Copy link
Contributor

Added usageMetadata to GenerateContentResponse.

#no-changelog

@andrewheard andrewheard requested a review from paulb777 April 12, 2024 20:33
@@ -17,13 +17,28 @@ import Foundation
/// The model's response to a generate content request.
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
public struct GenerateContentResponse {
/// Token usage metadata for processing the generate content request.
Copy link
Member

Choose a reason for hiding this comment

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

nit: Shouldn't internal line-based comments be two slashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't seem to be very consistent about // vs. /// for internal variables / constants (e.g.,

/// The resource name of the model in the backend; has the format "models/model-name".
let modelResourceName: String
/// The backing service responsible for sending and receiving model requests to the backend.
let generativeAIService: GenerativeAIService
/// Configuration parameters used for the MultiModalModel.
let generationConfig: GenerationConfig?
/// The safety settings to be used for prompts.
let safetySettings: [SafetySetting]?
/// A list of tools the model may use to generate the next response.
let tools: [Tool]?
/// Tool configuration for any `Tool` specified in the request.
let toolConfig: ToolConfig?
/// Instructions that direct the model to behave a certain way.
let systemInstruction: ModelContent?
/// Configuration parameters for sending requests to the backend.
let requestOptions: RequestOptions
) but you pointed out a very important issue... these should be public (wasn't caught because the test uses @testable import) and should remain /// for DocC. Adding public now.

@andrewheard andrewheard merged commit 9d304a1 into vertex-ai Apr 12, 2024
42 checks passed
@andrewheard andrewheard deleted the ah/vertex-usage-metadata branch April 12, 2024 21:21
@firebase firebase locked and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants