Skip to content

Commit db28e34

Browse files
committed
review and changelog
1 parent 0e23e6e commit db28e34

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

FirebaseAI/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
- [feature] Adds support for configuring image generation properties,
33
such as aspect ratio and image size, through the new `ImageConfig` struct
44
and its integration with `GenerationConfig`.
5+
- [feature] Adds support for new `FinishReason` values including
6+
image-related reasons like `imageSafety`, `noImage`, and others for
7+
tool-use, language, and malformed responses.
58

69
# 12.11.0
710
- [feature] **Public Preview**: Introduces `GenerativeModelSession` providing

FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ struct ImagenIntegrationTests {
168168
}
169169
}
170170

171-
172171
// TODO(#14221): Add an integration test for the prompt being blocked.
173172

174173
// TODO(#14452): Add integration tests for validating that Storage Rules are enforced.

FirebaseAI/Tests/Unit/APITests.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -236,20 +236,21 @@ final class APITests: XCTestCase {
236236

237237
func testFinishReason_decoding() throws {
238238
let decoder = JSONDecoder()
239-
let testCases: [(String, FinishReason)] = [
240-
("LANGUAGE", .language),
241-
("UNEXPECTED_TOOL_CALL", .unexpectedToolCall),
242-
("TOO_MANY_TOOL_CALLS", .tooManyToolCalls),
243-
("MISSING_THOUGHT_SIGNATURE", .missingThoughtSignature),
244-
("MALFORMED_RESPONSE", .malformedResponse),
245-
("IMAGE_SAFETY", .imageSafety),
246-
("IMAGE_PROHIBITED_CONTENT", .imageProhibitedContent),
247-
("IMAGE_OTHER", .imageOther),
248-
("NO_IMAGE", .noImage),
249-
("IMAGE_RECITATION", .imageRecitation),
239+
let testCases: [FinishReason] = [
240+
.language,
241+
.unexpectedToolCall,
242+
.tooManyToolCalls,
243+
.missingThoughtSignature,
244+
.malformedResponse,
245+
.imageSafety,
246+
.imageProhibitedContent,
247+
.imageOther,
248+
.noImage,
249+
.imageRecitation,
250250
]
251251

252-
for (reasonString, expectedReason) in testCases {
252+
for expectedReason in testCases {
253+
let reasonString = expectedReason.rawValue
253254
let json = createResponseJSON(finishReason: reasonString)
254255
let response = try decoder.decode(GenerateContentResponse.self, from: json)
255256
XCTAssertEqual(

0 commit comments

Comments
 (0)