diff --git a/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/StreamingSnapshotTests.kt b/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/StreamingSnapshotTests.kt index 4abf386765a..8b421edfa50 100644 --- a/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/StreamingSnapshotTests.kt +++ b/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/StreamingSnapshotTests.kt @@ -69,7 +69,7 @@ internal class StreamingSnapshotTests { @Test fun `unknown enum`() = - goldenStreamingFile("success-unknown-enum.txt") { + goldenStreamingFile("success-unknown-safety-enum.txt") { val responses = apiController.generateContentStream(textGenerateContentRequest("prompt")) withTimeout(testTimeout) { @@ -152,20 +152,6 @@ internal class StreamingSnapshotTests { } } - @Test - fun `citation returns correctly when using alternative name`() = - goldenStreamingFile("success-citations-altname.txt") { - val responses = apiController.generateContentStream(textGenerateContentRequest("prompt")) - - withTimeout(testTimeout) { - val responseList = responses.toList() - responseList.any { - it.candidates?.any { it.citationMetadata?.citationSources?.isNotEmpty() ?: false } - ?: false - } shouldBe true - } - } - @Test fun `stopped for recitation`() = goldenStreamingFile("failure-recitation-no-content.txt") { diff --git a/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/UnarySnapshotTests.kt b/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/UnarySnapshotTests.kt index c316a9ece81..49a24201c3f 100644 --- a/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/UnarySnapshotTests.kt +++ b/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/UnarySnapshotTests.kt @@ -75,7 +75,7 @@ internal class UnarySnapshotTests { @Test fun `unknown enum`() = - goldenUnaryFile("success-unknown-enum.json") { + goldenUnaryFile("success-unknown-enum-safety-ratings.json") { withTimeout(testTimeout) { val response = apiController.generateContent(textGenerateContentRequest("prompt")) @@ -211,17 +211,6 @@ internal class UnarySnapshotTests { } } - @Test - fun `citation returns correctly when using alternative name`() = - goldenUnaryFile("success-citations-altname.json") { - withTimeout(testTimeout) { - val response = apiController.generateContent(textGenerateContentRequest("prompt")) - - response.candidates?.isEmpty() shouldBe false - response.candidates?.first()?.citationMetadata?.citationSources?.isNotEmpty() shouldBe true - } - } - @OptIn(ExperimentalSerializationApi::class) @Test fun `properly translates json text`() = @@ -306,7 +295,7 @@ internal class UnarySnapshotTests { @Test fun `service disabled`() = - goldenUnaryFile("failure-service-disabled.json", HttpStatusCode.Forbidden) { + goldenUnaryFile("failure-firebaseml-api-not-enabled.json", HttpStatusCode.Forbidden) { withTimeout(testTimeout) { shouldThrow { apiController.generateContent(textGenerateContentRequest("prompt")) diff --git a/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/util/tests.kt b/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/util/tests.kt index 5e52b1827b0..bf79df56604 100644 --- a/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/util/tests.kt +++ b/firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/util/tests.kt @@ -140,7 +140,7 @@ internal fun goldenStreamingFile( httpStatusCode: HttpStatusCode = HttpStatusCode.OK, block: CommonTest, ) = doBlocking { - val goldenFile = loadGoldenFile("streaming/$name") + val goldenFile = loadGoldenFile("streaming-$name") val messages = goldenFile.readLines().filter { it.isNotBlank() } commonTest(httpStatusCode) { @@ -171,7 +171,7 @@ internal fun goldenUnaryFile( block: CommonTest, ) = commonTest(httpStatusCode) { - val goldenFile = loadGoldenFile("unary/$name") + val goldenFile = loadGoldenFile("unary-$name") val message = goldenFile.readText() channel.send(message.toByteArray()) @@ -186,7 +186,8 @@ internal fun goldenUnaryFile( * * @see goldenUnaryFile */ -internal fun loadGoldenFile(path: String): File = loadResourceFile("golden-files/$path") +internal fun loadGoldenFile(path: String): File = + loadResourceFile("vertexai-sdk-test-data/mock-responses/$path") /** Loads a file from the test resources directory. */ internal fun loadResourceFile(path: String) = File("src/test/resources/$path") diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-api-key.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-api-key.txt deleted file mode 100644 index ecf6f6b53fa..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-api-key.txt +++ /dev/null @@ -1,21 +0,0 @@ -{ - "error": { - "code": 400, - "message": "API key not valid. Please pass a valid API key.", - "status": "INVALID_ARGUMENT", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.ErrorInfo", - "reason": "API_KEY_INVALID", - "domain": "googleapis.com", - "metadata": { - "service": "generativelanguage.googleapis.com" - } - }, - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "Invalid API key: AIzv00G7VmUCUeC-5OglO3hcXM" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-empty-content.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-empty-content.txt deleted file mode 100644 index 5762b515325..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-empty-content.txt +++ /dev/null @@ -1 +0,0 @@ -data: {"candidates": [{"content": {},"index": 0}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-finish-reason-safety.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-finish-reason-safety.txt deleted file mode 100644 index 05e0936168d..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-finish-reason-safety.txt +++ /dev/null @@ -1,2 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": ""}],"role": "model"},"finishReason": "SAFETY","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "HIGH"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-http-error.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-http-error.txt deleted file mode 100644 index 8c75fd7bf2d..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-http-error.txt +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 400, - "message": "$grpcMessage", - "status": "FAILED_PRECONDITION", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "[ORIGINAL ERROR] generic::failed_precondition: User location is not supported for the API use. [google.rpc.error_details_ext] { message: \"User location is not supported for the API use.\" }" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-image-rejected.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-image-rejected.txt deleted file mode 100644 index 8567086e2ec..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-image-rejected.txt +++ /dev/null @@ -1,7 +0,0 @@ -{ - "error": { - "code": 400, - "message": "Request contains an invalid argument.", - "status": "INVALID_ARGUMENT" - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-prompt-blocked-safety.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-prompt-blocked-safety.txt deleted file mode 100644 index 58c914af08e..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-prompt-blocked-safety.txt +++ /dev/null @@ -1,2 +0,0 @@ -data: {"promptFeedback": {"blockReason": "SAFETY","safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "HIGH"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-recitation-no-content.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-recitation-no-content.txt deleted file mode 100644 index 6d69b64e51f..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-recitation-no-content.txt +++ /dev/null @@ -1,6 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "PLACEHOLDER"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - -data: {"candidates": [{"content": {"parts": [{"text": "PLACEHOLDER"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "LOW"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citationSources": [{"startIndex": 30,"endIndex": 179,"uri": "https://example.com","license": ""}]}}]} - -data: {"candidates": [{"finishReason": "RECITATION","index": 0}]} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-unknown-model.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/failure-unknown-model.txt deleted file mode 100644 index 60b3f55c978..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/failure-unknown-model.txt +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 404, - "message": "models/unknown is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.", - "status": "NOT_FOUND", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "[ORIGINAL ERROR] generic::not_found: models/unknown is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods. [google.rpc.error_details_ext] { message: \"models/unknown is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.\" }" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/success-basic-reply-long.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/success-basic-reply-long.txt deleted file mode 100644 index 268f75d7821..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/success-basic-reply-long.txt +++ /dev/null @@ -1,12 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "**Cats:**\n\n1. **Anatomy and Appearance:**\n - Cats have"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - -data: {"candidates": [{"content": {"parts": [{"text": " flexible bodies with a long tail, sharp retractable claws, and soft fur.\n - Their eyes are adapted for low-light conditions and have a vertical slit"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "-like pupil.\n - Cats come in a wide variety of breeds, each with distinct physical characteristics.\n\n2. **Behavior and Personality:**\n - Cats are known for their independence and solitary nature.\n - They are often described as aloof and mysterious, but they can also be affectionate and playful."}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "\n - Cats are territorial and communicate through body language, vocalizations, and scent marking.\n\n3. **Diet and Nutrition:**\n - Cats are obligate carnivores, meaning they require animal-based protein for survival.\n - Their diet should consist primarily of high-quality cat food that meets their nutritional needs.\n - Cats are prone to obesity, so portion control and regular exercise are important.\n\n4. **Health and Care:**\n - Cats require regular veterinary checkups, vaccinations, and parasite control.\n - They should be brushed regularly to prevent matting and shedding.\n - Providing"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": " a clean litter box and fresh water is essential for their well-being.\n\n5. **Lifespan:**\n - The average lifespan of a cat is 12-15 years, although some cats can live longer with proper care.\n\n**Dogs:**\n\n1. **Anatomy and Appearance:**\n - Dogs have a diverse range of sizes, shapes, and coat types depending on their breed.\n - They have strong jaws with sharp teeth adapted for chewing and tearing.\n - Dogs' ears are typically floppy or erect and can be used to express emotions.\n\n2. **Behavior and Personality:**\n - Dogs are known for their loyalty, companionship, and trainability.\n - They are social animals that thrive on human interaction and form strong bonds with their owners.\n - Dogs communicate through barking, whining, growling, and body language.\n\n3. **Diet and Nutrition:**\n - Dogs are omnivores and can eat a variety of foods, including meat, grains, fruits, and vegetables.\n - Their diet should be balanced and meet their nutritional requirements based on age, size, and activity level.\n - Obesity is a common problem in dogs, so portion control and exercise are important.\n\n4"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": ". **Health and Care:**\n - Dogs require regular veterinary checkups, vaccinations, and parasite control.\n - They should be brushed regularly to maintain a healthy coat and prevent shedding.\n - Providing adequate exercise, mental stimulation, and socialization is essential for their well-being.\n\n5. **Lifespan:**\n - The average lifespan of a dog varies depending on breed, size, and overall health.\n - Smaller breeds tend to live longer than larger breeds, with an average lifespan of 10-15 years."}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/success-basic-reply-short.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/success-basic-reply-short.txt deleted file mode 100644 index b3c07628fc2..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/success-basic-reply-short.txt +++ /dev/null @@ -1,2 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "Cheyenne"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/success-citations-altname.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/success-citations-altname.txt deleted file mode 100644 index 4c682dc8f2f..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/success-citations-altname.txt +++ /dev/null @@ -1,12 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citations": [{"startIndex": 574,"endIndex": 705,"uri": "https://example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://example.com","license": ""}]}}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citations": [{"startIndex": 574,"endIndex": 705,"uri": "https://example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://example.com","license": ""}]}}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citations": [{"startIndex": 574,"endIndex": 705,"uri": "https://example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://example.com","license": ""}]}}]} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/success-citations.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/success-citations.txt deleted file mode 100644 index 3bb76e3d7a5..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/success-citations.txt +++ /dev/null @@ -1,12 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citationSources": [{"startIndex": 574,"endIndex": 705,"uri": "https://example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://example.com","license": ""}]}}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citationSources": [{"startIndex": 574,"endIndex": 705,"uri": "https://example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://example.com","license": ""}]}}]} - -data: {"candidates": [{"content": {"parts": [{"text": "placeholder"}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}],"citationMetadata": {"citationSources": [{"startIndex": 574,"endIndex": 705,"uri": "https://example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://example.com","license": ""}]}}]} - diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/success-quotes-escaped.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/success-quotes-escaped.txt deleted file mode 100644 index ef71be2906f..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/success-quotes-escaped.txt +++ /dev/null @@ -1,7 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": " Pineapples and \"bananas\" are two different types of fruit. Pineapples grow on a"}]},"index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_TOXICITY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_SEXUAL","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_VIOLENCE","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DEROGATORY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_TOXICITY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_SEXUAL","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_VIOLENCE","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DEROGATORY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS","probability": "NEGLIGIBLE"}]}} - -data: {"candidates": [{"content": {"parts": [{"text": " tropical plant with a rosette of long, pointed leaves. Bananas grow on a herbaceous"}]},"index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_TOXICITY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_SEXUAL","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_VIOLENCE","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DEROGATORY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": " plant with large, broad leaves. The two plants are not related, and pin"}]},"index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_TOXICITY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_SEXUAL","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_VIOLENCE","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DEROGATORY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "eapples do not grow on banana plants."}]},"index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_TOXICITY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_SEXUAL","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_VIOLENCE","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DEROGATORY","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS","probability": "NEGLIGIBLE"}]}]} diff --git a/firebase-vertexai/src/test/resources/golden-files/streaming/success-unknown-enum.txt b/firebase-vertexai/src/test/resources/golden-files/streaming/success-unknown-enum.txt deleted file mode 100644 index 0f3da8ebf17..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/streaming/success-unknown-enum.txt +++ /dev/null @@ -1,11 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "**Cats:**\n\n- **Physical Characteristics:**\n - Size: Cats come"}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}} - -data: {"candidates": [{"content": {"parts": [{"text": " in a wide range of sizes, from small breeds like the Singapura to large breeds like the Maine Coon.\n - Fur: Cats have soft, furry coats"}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": " that can vary in length and texture depending on the breed.\n - Eyes: Cats have large, expressive eyes that can be various colors, including green, blue, yellow, and hazel.\n - Ears: Cats have pointed, erect ears that are sensitive to sound.\n - Tail: Cats have long"}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": ", flexible tails that they use for balance and communication.\n\n- **Behavior and Personality:**\n - Independent: Cats are often described as independent animals that enjoy spending time alone.\n - Affectionate: Despite their independent nature, cats can be very affectionate and form strong bonds with their owners.\n - Playful: Cats are naturally playful and enjoy engaging in activities such as chasing toys, climbing, and pouncing.\n - Curious: Cats are curious creatures that love to explore their surroundings.\n - Vocal: Cats communicate through a variety of vocalizations, including meows, purrs, hisses, and grow"}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": "ls.\n\n- **Health and Care:**\n - Diet: Cats are obligate carnivores, meaning they require animal-based protein for optimal health.\n - Grooming: Cats spend a significant amount of time grooming themselves to keep their fur clean and free of mats.\n - Exercise: Cats need regular exercise to stay healthy and active. This can be achieved through play sessions or access to outdoor space.\n - Veterinary Care: Regular veterinary checkups are essential for maintaining a cat's health and detecting any potential health issues early on.\n\n**Dogs:**\n\n- **Physical Characteristics:**\n - Size: Dogs come in a wide range of sizes, from small breeds like the Chihuahua to giant breeds like the Great Dane.\n - Fur: Dogs have fur coats that can vary in length, texture, and color depending on the breed.\n - Eyes: Dogs have expressive eyes that can be various colors, including brown, blue, green, and hazel.\n - Ears: Dogs have floppy or erect ears that are sensitive to sound.\n - Tail: Dogs have long, wagging tails that they use for communication and expressing emotions.\n\n- **Behavior and Personality:**\n - Loyal: Dogs are known for their loyalty and"}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}]} - -data: {"candidates": [{"content": {"parts": [{"text": " devotion to their owners.\n - Friendly: Dogs are generally friendly and outgoing animals that enjoy interacting with people and other animals.\n - Playful: Dogs are playful and energetic creatures that love to engage in activities such as fetching, running, and playing with toys.\n - Trainable: Dogs are highly trainable and can learn a variety of commands and tricks.\n - Vocal: Dogs communicate through a variety of vocalizations, including barking, howling, whining, and growling.\n\n- **Health and Care:**\n - Diet: Dogs are omnivores and can eat a variety of foods, including meat, vegetables, and grains.\n - Grooming: Dogs require regular grooming to keep their fur clean and free of mats. The frequency of grooming depends on the breed and coat type.\n - Exercise: Dogs need regular exercise to stay healthy and active. The amount of exercise required varies depending on the breed and age of the dog.\n - Veterinary Care: Regular veterinary checkups are essential for maintaining a dog's health and detecting any potential health issues early on."}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT_NEW_ENUM","probability": "NEGLIGIBLE_UNKNOWN_ENUM"}]}]} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-api-key.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-api-key.json deleted file mode 100644 index ecf6f6b53fa..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-api-key.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "error": { - "code": 400, - "message": "API key not valid. Please pass a valid API key.", - "status": "INVALID_ARGUMENT", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.ErrorInfo", - "reason": "API_KEY_INVALID", - "domain": "googleapis.com", - "metadata": { - "service": "generativelanguage.googleapis.com" - } - }, - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "Invalid API key: AIzv00G7VmUCUeC-5OglO3hcXM" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-empty-content.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-empty-content.json deleted file mode 100644 index 4e1889660f2..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-empty-content.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "candidates": [ - { - "content": {}, - "index": 0 - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-finish-reason-safety.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-finish-reason-safety.json deleted file mode 100644 index 111e33de2e3..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-finish-reason-safety.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "" - } - ], - "role": "model" - }, - "finishReason": "SAFETY", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "HIGH" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-http-error.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-http-error.json deleted file mode 100644 index c8b07a5bf0e..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-http-error.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 400, - "message": "$grpcMessage", - "status": "FAILED_PRECONDITION", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "[ORIGINAL ERROR] generic::failed_precondition: User location is not supported for the API use. [google.rpc.error_details_ext] { message: \"User location is not supported for the API use.\" }" - } - ] -} -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-image-rejected.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-image-rejected.json deleted file mode 100644 index 9dacdc71e7a..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-image-rejected.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 400, - "message": "Request contains an invalid argument.", - "status": "INVALID_ARGUMENT", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "[ORIGINAL ERROR] generic::invalid_argument: invalid status photos.thumbnailer.Status.Code::5: Source image 0 too short" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-invalid-response.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-invalid-response.json deleted file mode 100644 index 49d05e1840b..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-invalid-response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "this": [ - { - "is": { - "not": [ - { - "a": "valid" - } - ] - }, - "response": {} - } - ] -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-malformed-content.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-malformed-content.json deleted file mode 100644 index 737f2e08548..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-malformed-content.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "candidates": [ - { - "content": { - "invalid-field": true - }, - "index": 0 - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-prompt-blocked-safety.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-prompt-blocked-safety.json deleted file mode 100644 index 9d2abbb23d6..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-prompt-blocked-safety.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "promptFeedback": { - "blockReason": "SAFETY", - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "HIGH" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-quota-exceeded.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-quota-exceeded.json deleted file mode 100644 index fc438f7b080..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-quota-exceeded.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "error": { - "code": 429, - "message": "Quota exceeded for quota metric 'Generate Content API requests per minute' and limit 'GenerateContent request limit per minute for a region' of service 'generativelanguage.googleapis.com' for consumer 'project_number:348715329010'.", - "status": "RESOURCE_EXHAUSTED", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.ErrorInfo", - "reason": "RATE_LIMIT_EXCEEDED", - "domain": "googleapis.com", - "metadata": { - "service": "generativelanguage.googleapis.com", - "consumer": "projects/348715329010", - "quota_limit_value": "0", - "quota_limit": "GenerateContentRequestsPerMinutePerProjectPerRegion", - "quota_location": "us-east2", - "quota_metric": "generativelanguage.googleapis.com/generate_content_requests" - } - }, - { - "@type": "type.googleapis.com/google.rpc.Help", - "links": [ - { - "description": "Request a higher quota limit.", - "url": "https://cloud.google.com/docs/quota#requesting_higher_quota" - } - ] - } - ] - } -} \ No newline at end of file diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-service-disabled.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-service-disabled.json deleted file mode 100644 index ed842833aa5..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-service-disabled.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "error": { - "code": 403, - "message": "Firebase ML API has not been used in project 12345 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebaseml.googleapis.com/overview?project=12345 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", - "status": "PERMISSION_DENIED", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.Help", - "links": [ - { - "description": "Google developers console API activation", - "url": "https://console.developers.google.com/apis/api/firebaseml.googleapis.com/overview?project=12345" - } - ] - }, - { - "@type": "type.googleapis.com/google.rpc.ErrorInfo", - "reason": "SERVICE_DISABLED", - "domain": "googleapis.com", - "metadata": { - "service": "firebaseml.googleapis.com", - "consumer": "projects/12345" - } - } - ] - } -} \ No newline at end of file diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-unknown-model.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-unknown-model.json deleted file mode 100644 index 60b3f55c978..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-unknown-model.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 404, - "message": "models/unknown is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.", - "status": "NOT_FOUND", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "[ORIGINAL ERROR] generic::not_found: models/unknown is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods. [google.rpc.error_details_ext] { message: \"models/unknown is not found for API version v1, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.\" }" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/failure-unsupported-user-location.json b/firebase-vertexai/src/test/resources/golden-files/unary/failure-unsupported-user-location.json deleted file mode 100644 index c4c2ace4e20..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/failure-unsupported-user-location.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 400, - "message": "User location is not supported for the API use.", - "status": "FAILED_PRECONDITION", - "details": [ - { - "@type": "type.googleapis.com/google.rpc.DebugInfo", - "detail": "[ORIGINAL ERROR] generic::failed_precondition: User location is not supported for the API use. [google.rpc.error_details_ext] { message: \"User location is not supported for the API use.\" }" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-basic-reply-long.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-basic-reply-long.json deleted file mode 100644 index 2ee6617774a..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-basic-reply-long.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "1. **Use Freshly Ground Coffee**:\n - Grind your coffee beans just before brewing to preserve their flavor and aroma.\n - Use a burr grinder for a consistent grind size.\n\n2. **Choose the Right Water**:\n - Use filtered or spring water for the best taste.\n - Avoid using tap water, as it may contain impurities that can affect the flavor.\n\n3. **Measure Accurately**:\n - Use a kitchen scale to measure your coffee and water precisely.\n - A general rule of thumb is to use 1:16 ratio of coffee to water (e.g., 15 grams of coffee to 240 grams of water).\n\n4. **Preheat Your Equipment**:\n - Preheat your coffee maker or espresso machine before brewing to ensure a consistent temperature.\n\n5. **Control the Water Temperature**:\n - The ideal water temperature for brewing coffee is between 195°F (90°C) and 205°F (96°C).\n - Too hot water can extract bitter flavors, while too cold water won't extract enough flavor.\n\n6. **Steep the Coffee**:\n - For drip coffee, let the water slowly drip through the coffee grounds for optimal extraction.\n - For espresso, maintain a steady pressure and flow rate during the extraction.\n\n7. **Clean Your Equipment**:\n - Regularly clean your coffee maker or espresso machine to remove any residual oils or coffee grounds that can affect the taste.\n\n8. **Experiment with Different Coffee Beans**:\n - Try different coffee beans from various regions and roasts to find your preferred flavor profile.\n\n9. **Store Coffee Properly**:\n - Store your coffee beans in an airtight container in a cool, dark place to preserve their freshness.\n\n10. **Enjoy Freshly Brewed Coffee**:\n - Drink your coffee as soon as possible after brewing to savor its peak flavor and aroma." - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-basic-reply-short.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-basic-reply-short.json deleted file mode 100644 index 40a9a6da58e..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-basic-reply-short.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "Mountain View, California, United States" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-citations-altname.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-citations-altname.json deleted file mode 100644 index 7adaad5fcf2..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-citations-altname.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "placeholder" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ], - "citationMetadata": { - "citations": [ - { - "startIndex": 574, - "endIndex": 705, - "uri": "https://example.com/", - "license": "" - }, - { - "startIndex": 899, - "endIndex": 1026, - "uri": "https://example.com/", - "license": "" - } - ] - } - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-citations-nolicense.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-citations-nolicense.json deleted file mode 100644 index b8336b70ee4..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-citations-nolicense.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "candidates": [ - { - "content": { - "role": "model", - "parts": [ - { - "text": "Some information cited from an external source" - } - ] - }, - "finishReason": "STOP", - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.16013464, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.074500255 - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.09687653, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.049313594 - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.16817278, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.09451043 - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.05023736, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.034553625 - } - ], - "citationMetadata": { - "citations": [ - { - "endIndex": 366, - "uri": "https://www.example.com/some-citation" - } - ] - } - } - ], - "usageMetadata": { - "promptTokenCount": 11, - "candidatesTokenCount": 135, - "totalTokenCount": 146 - } -} \ No newline at end of file diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-citations.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-citations.json deleted file mode 100644 index 2a765aceda7..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-citations.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "placeholder" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ], - "citationMetadata": { - "citationSources": [ - { - "startIndex": 574, - "endIndex": 705, - "uri": "https://example.com/", - "license": "" - }, - { - "startIndex": 899, - "endIndex": 1026, - "uri": "https://example.com/", - "license": "" - } - ] - } - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-code-execution.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-code-execution.json deleted file mode 100644 index 3b8f4c25f0e..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-code-execution.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "executableCode": { - "language": "PYTHON", - "code": "print(\"Hello World\")" - } - }, - { - "codeExecutionResult": { - "outcome": "OUTCOME_OK", - "output": "Hello World" - } - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 774, - "candidatesTokenCount": 4176, - "totalTokenCount": 4950 - } -} \ No newline at end of file diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-constraint-decoding-json.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-constraint-decoding-json.json deleted file mode 100644 index 52c4a501823..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-constraint-decoding-json.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "[\n {\n \"name\": \"Fuji Dawn\",\n \"colors\": [\n \"#FEE4C4\",\n \"#FCDEC0\",\n \"#FBC7BB\",\n \"#F2A194\",\n \"#ED8571\"\n ]\n },\n {\n \"name\": \"Hawaiian Sunset\",\n \"colors\": [\n \"#F25C54\",\n \"#F24545\",\n \"#F22E35\",\n \"#C92127\",\n \"#96141A\"\n ]\n },\n {\n \"name\": \"Jakarta Noon\",\n \"colors\": [\n \"#037F8C\",\n \"#026773\",\n \"#014F59\",\n \"#F2C777\",\n \"#F2A857\"\n ]\n }\n]\n\n" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ] -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-empty-arguments.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-empty-arguments.json deleted file mode 100644 index dc0b75ad930..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-empty-arguments.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "functionCall": { - "name": "current_time" - } - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0 - } - ] -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-json-literal.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-json-literal.json deleted file mode 100644 index fe4571880a8..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-json-literal.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "functionCall": { - "name": "functionName", - "args": { - "original_title": "String", - "current": true - } - } - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 774, - "candidatesTokenCount": 4176, - "totalTokenCount": 4950 - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-null.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-null.json deleted file mode 100644 index 14801eef9b8..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-function-call-null.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "functionCall": { - "name": "functionName", - "args": { - "original_title": "String", - "season": null - } - } - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 774, - "candidatesTokenCount": 4176, - "totalTokenCount": 4950 - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-including-severity.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-including-severity.json deleted file mode 100644 index ccaae7e3309..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-including-severity.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "candidates": [ - { - "content": { - "role": "model", - "parts": [ - { - "text": "## One Thousand and One Nights: A Summary\n\nOne Thousand and One Nights, also known as Arabian Nights, is a collection of Middle Eastern and South Asian stories." - } - ] - }, - "finishReason": "STOP", - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.062331032, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.052134257 - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.04240383, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.06325052 - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.06359858, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.021990221 - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.39030153, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.10650458 - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 11, - "candidatesTokenCount": 592, - "totalTokenCount": 603 - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-partial-usage-metadata.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-partial-usage-metadata.json deleted file mode 100644 index 662b873f179..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-partial-usage-metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "Mountain View, California, United States" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 6 - }, - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-quote-reply.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-quote-reply.json deleted file mode 100644 index f1e5331ec3f..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-quote-reply.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "1. \"The greatest glory in living lies not in never falling, but in rising every time we fall.\" - Nelson Mandela\n2. \"The future belongs to those who believe in the beauty of their dreams.\" - Eleanor Roosevelt\n3. \"It does not matter how slow you go so long as you do not stop.\" - Confucius\n4. \"If you want to live a happy life, tie it to a goal, not to people or things.\" - Albert Einstein\n5. \"The only person you are destined to become is the person you decide to be.\" - Ralph Waldo Emerson\n6. \"It's not how much you have, but how much you enjoy that makes happiness.\" - Charles Spurgeon\n7. \"The greatest wealth is to live content with little.\" - Plato\n8. \"The only way to do great work is to love what you do.\" - Steve Jobs\n9. \"Don't be afraid to fail. Be afraid not to try.\" - Michael Jordan\n10. \"The best way to predict the future is to create it.\" - Abraham Lincoln" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-unknown-enum.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-unknown-enum.json deleted file mode 100644 index b27a11ae955..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-unknown-enum.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "1. **Use Freshly Ground Coffee**:\n - Grind your coffee beans just before brewing to preserve their flavor and aroma.\n - Use a burr grinder for a consistent grind size.\n\n\n2. **Choose the Right Water**:\n - Use filtered or spring water for the best taste.\n - Avoid using tap water, as it may contain impurities that can affect the flavor.\n\n\n3. **Measure Accurately**:\n - Use a kitchen scale to measure your coffee and water precisely.\n - A general rule of thumb is to use 1:16 ratio of coffee to water (e.g., 15 grams of coffee to 240 grams of water).\n\n\n4. **Preheat Your Equipment**:\n - Preheat your coffee maker or espresso machine before brewing to ensure a consistent temperature.\n\n\n5. **Control the Water Temperature**:\n - The ideal water temperature for brewing coffee is between 195°F (90°C) and 205°F (96°C).\n - Too hot water can extract bitter flavors, while too cold water won't extract enough flavor.\n\n\n6. **Steep the Coffee**:\n - For drip coffee, let the water slowly drip through the coffee grounds for optimal extraction.\n - For pour-over coffee, pour the water in a circular motion over the coffee grounds, allowing it to steep for 30-45 seconds before continuing.\n\n\n7. **Clean Your Equipment**:\n - Regularly clean your coffee maker or espresso machine to prevent the buildup of oils and residue that can affect the taste of your coffee.\n\n\n8. **Experiment with Different Coffee Beans**:\n - Try different coffee beans from various regions and roasts to find your preferred flavor profile.\n - Experiment with different grind sizes and brewing methods to optimize the flavor of your chosen beans.\n\n\n9. **Store Coffee Properly**:\n - Store your coffee beans in an airtight container in a cool, dark place to preserve their freshness and flavor.\n - Avoid storing coffee in the refrigerator or freezer, as this can cause condensation and affect the taste.\n\n\n10. **Enjoy Freshly Brewed Coffee**:\n - Drink your coffee as soon as possible after brewing to enjoy its peak flavor and aroma.\n - Coffee starts to lose its flavor and aroma within 30 minutes of brewing." - } - ] - }, - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT_ENUM_NEW", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT_LIKE_A_NEW_ENUM", - "probability": "NEGLIGIBLE_NEW_ENUM" - } - ] - } -} diff --git a/firebase-vertexai/src/test/resources/golden-files/unary/success-usage-metadata.json b/firebase-vertexai/src/test/resources/golden-files/unary/success-usage-metadata.json deleted file mode 100644 index 77efea8f268..00000000000 --- a/firebase-vertexai/src/test/resources/golden-files/unary/success-usage-metadata.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "candidates": [ - { - "content": { - "parts": [ - { - "text": "Mountain View, California, United States" - } - ], - "role": "model" - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 6, - "candidatesTokenCount": 357, - "totalTokenCount": 363 - }, - "promptFeedback": { - "safetyRatings": [ - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE" - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE" - } - ] - } -}