From 033f0894d4cfa5ba4e27ed91227dbd94379c06b7 Mon Sep 17 00:00:00 2001 From: Tanzim Hossain Date: Sun, 23 Jun 2024 23:59:22 +0000 Subject: [PATCH] VertexAI: update testing to clone mock responses from shared repo --- .gitignore | 3 +- packages/vertexai/package.json | 3 +- packages/vertexai/test-utils/convert-mocks.ts | 5 +- .../streaming-failure-empty-content.txt | 2 - ...streaming-failure-finish-reason-safety.txt | 2 - ...treaming-failure-prompt-blocked-safety.txt | 2 - ...treaming-failure-recitation-no-content.txt | 6 -- .../streaming-success-basic-reply-long.txt | 12 ---- .../streaming-success-basic-reply-short.txt | 2 - .../streaming-success-citations.txt | 12 ---- .../streaming-success-function-call-short.txt | 2 - .../streaming-success-unknown-enum.txt | 12 ---- .../mock-responses/streaming-success-utf8.txt | 8 --- .../unary-failure-empty-content.json | 28 -------- .../unary-failure-finish-reason-safety.json | 54 -------------- .../unary-failure-image-rejected.json | 13 ---- .../unary-failure-model-not-found.json | 13 ---- .../unary-failure-prompt-blocked-safety.json | 23 ------ .../unary-success-basic-reply-long.json | 51 -------------- .../unary-success-basic-reply-short.json | 51 -------------- .../unary-success-citations.json | 70 ------------------- .../unary-success-no-billable-characters.json | 3 - .../unary-success-total-tokens.json | 4 -- .../unary-success-unknown-enum.json | 52 -------------- 24 files changed, 8 insertions(+), 425 deletions(-) delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-failure-empty-content.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-failure-finish-reason-safety.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-failure-prompt-blocked-safety.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-failure-recitation-no-content.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-long.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-short.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-success-citations.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-success-function-call-short.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-success-unknown-enum.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/streaming-success-utf8.txt delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-failure-empty-content.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-failure-finish-reason-safety.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-failure-image-rejected.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-failure-model-not-found.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-failure-prompt-blocked-safety.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-long.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-short.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-success-citations.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-success-no-billable-characters.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-success-total-tokens.json delete mode 100644 packages/vertexai/test-utils/mock-responses/unary-success-unknown-enum.json diff --git a/.gitignore b/.gitignore index ec2ca7e596e..1a6a719d18d 100644 --- a/.gitignore +++ b/.gitignore @@ -98,5 +98,6 @@ docs/ *.tfstate *.tfstate.* -# generated test case text data +# vertexai test data +vertexai-sdk-test-data mocks-lookup.ts \ No newline at end of file diff --git a/packages/vertexai/package.json b/packages/vertexai/package.json index 3a111424f34..d951919b1f8 100644 --- a/packages/vertexai/package.json +++ b/packages/vertexai/package.json @@ -33,7 +33,8 @@ "build": "rollup -c && yarn api-report", "build:deps": "lerna run --scope @firebase/vertexai --include-dependencies build", "dev": "rollup -c -w", - "testsetup": "yarn ts-node ./test-utils/convert-mocks.ts", + "update-responses": "cd test-utils && rm -rf vertexai-sdk-test-data && git clone --depth 1 https://github.com/FirebaseExtended/vertexai-sdk-test-data.git", + "testsetup": "yarn update-responses && yarn ts-node ./test-utils/convert-mocks.ts", "test": "run-p --npm-path npm lint test:browser", "test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test", "test:browser": "yarn testsetup && karma start --single-run", diff --git a/packages/vertexai/test-utils/convert-mocks.ts b/packages/vertexai/test-utils/convert-mocks.ts index 0731df9da36..a6790b98fbc 100644 --- a/packages/vertexai/test-utils/convert-mocks.ts +++ b/packages/vertexai/test-utils/convert-mocks.ts @@ -25,7 +25,10 @@ const fs = require('fs'); // eslint-disable-next-line @typescript-eslint/no-require-imports const { join } = require('path'); -const mockResponseDir = join(__dirname, 'mock-responses'); +const mockResponseDir = join( + __dirname, + 'vertexai-sdk-test-data/mock-responses' +); async function main(): Promise { const list = fs.readdirSync(mockResponseDir); diff --git a/packages/vertexai/test-utils/mock-responses/streaming-failure-empty-content.txt b/packages/vertexai/test-utils/mock-responses/streaming-failure-empty-content.txt deleted file mode 100644 index 112a84ada1f..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-failure-empty-content.txt +++ /dev/null @@ -1,2 +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/packages/vertexai/test-utils/mock-responses/streaming-failure-finish-reason-safety.txt b/packages/vertexai/test-utils/mock-responses/streaming-failure-finish-reason-safety.txt deleted file mode 100644 index 05e0936168d..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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/packages/vertexai/test-utils/mock-responses/streaming-failure-prompt-blocked-safety.txt b/packages/vertexai/test-utils/mock-responses/streaming-failure-prompt-blocked-safety.txt deleted file mode 100644 index 58c914af08e..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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/packages/vertexai/test-utils/mock-responses/streaming-failure-recitation-no-content.txt b/packages/vertexai/test-utils/mock-responses/streaming-failure-recitation-no-content.txt deleted file mode 100644 index 05a296d60f0..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-failure-recitation-no-content.txt +++ /dev/null @@ -1,6 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "Copyrighted text goes here"}],"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": "More copyrighted text"}],"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": {"citations": [{"startIndex": 30,"endIndex": 179,"uri": "https://www.example.com","license": ""}]}}]} - -data: {"candidates": [{"finishReason": "RECITATION","index": 0}]} - diff --git a/packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-long.txt b/packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-long.txt deleted file mode 100644 index a53d1144840..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-long.txt +++ /dev/null @@ -1,12 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "**Cats:**\n\n- **Physical Characteristics:**\n - Size: Cats come"}],"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": " 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"}],"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": " 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"}],"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": ", 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","probability": "NEGLIGIBLE"}]}]} - diff --git a/packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-short.txt b/packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-short.txt deleted file mode 100644 index 716388d97de..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-short.txt +++ /dev/null @@ -1,2 +0,0 @@ -data: {"candidates": [{"content": {"role": "model","parts": [{"text": "Cheyenne"}]},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE","probabilityScore": 0.02854415,"severity": "HARM_SEVERITY_NEGLIGIBLE","severityScore": 0.052424565},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE","probabilityScore": 0.24926445,"severity": "HARM_SEVERITY_NEGLIGIBLE","severityScore": 0.0996453},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE","probabilityScore": 0.087096825,"severity": "HARM_SEVERITY_NEGLIGIBLE","severityScore": 0.043123372},{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE","probabilityScore": 0.14402841,"severity": "HARM_SEVERITY_NEGLIGIBLE","severityScore": 0.086169556}]}],"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"}]},"usageMetadata": {"promptTokenCount": 6,"candidatesTokenCount": 4,"totalTokenCount": 10}} - diff --git a/packages/vertexai/test-utils/mock-responses/streaming-success-citations.txt b/packages/vertexai/test-utils/mock-responses/streaming-success-citations.txt deleted file mode 100644 index 01376042eae..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-success-citations.txt +++ /dev/null @@ -1,12 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{"text": "1. **Definition:**\nQuantum mechanics is a fundamental theory in physics that provides"}],"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": " the foundation for understanding the physical properties of nature at the scale of atoms and subatomic particles. It is based on the idea that energy, momentum, angular momentum"}],"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": ", and other quantities are quantized, meaning they can exist only in discrete values. \n\n2. **Key Concepts:**\n - **Wave-particle Duality:** Particles such as electrons and photons can exhibit both wave-like and particle-like behaviors. \n - **Uncertainty Principle:** Proposed by Werner"}],"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": " Heisenberg, it states that the more precisely the position of a particle is known, the less precisely its momentum can be known, and vice versa. \n - **Superposition:** A quantum system can exist in multiple states simultaneously until it is observed or measured, at which point it \"collapses\" into a single state.\n - **Quantum Entanglement:** Two or more particles can become correlated in such a way that the state of one particle cannot be described independently of the other, even when they are separated by large distances. \n\n3. **Applications:**\n - **Quantum Computing:** It explores the use of quantum"}],"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://www.example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://www.example.com","license": ""}]}}]} - -data: {"candidates": [{"content": {"parts": [{"text": "-mechanical phenomena to perform complex calculations and solve problems that are intractable for classical computers. \n - **Quantum Cryptography:** Utilizes the principles of quantum mechanics to develop secure communication channels. \n - **Quantum Imaging:** Employs quantum effects to enhance the resolution and sensitivity of imaging techniques in fields such as microscopy and medical imaging. \n - **Quantum Sensors:** Leverages quantum properties to develop highly sensitive sensors for detecting magnetic fields, accelerations, and other physical quantities. \n\n4. **Learning Resources:**\n - **Books:**\n - \"Quantum Mechanics for Mathematicians\" by James Glimm and Arthur Jaffe\n - \"Principles of Quantum Mechanics\" by R. Shankar\n - \"Quantum Mechanics: Concepts and Applications\" by Nouredine Zettili\n - **Online Courses:**\n - \"Quantum Mechanics I\" by MIT OpenCourseWare\n - \"Quantum Mechanics for Everyone\" by Coursera\n - \"Quantum Mechanics\" by Stanford Online\n - **Documentaries and Videos:**\n - \"Quantum Mechanics: The Strangest Theory\" (BBC Documentary)\n - \"Quantum Mechanics Explained Simply\" by Veritasium (YouTube Channel)\n - \"What is Quantum Mechanics?\" by Minute"}],"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://www.example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://www.example.com","license": ""}]}}]} - -data: {"candidates": [{"content": {"parts": [{"text": "Physics (YouTube Channel)"}],"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://www.example.com","license": ""},{"startIndex": 899,"endIndex": 1026,"uri": "https://www.example.com","license": ""}]}}]} - diff --git a/packages/vertexai/test-utils/mock-responses/streaming-success-function-call-short.txt b/packages/vertexai/test-utils/mock-responses/streaming-success-function-call-short.txt deleted file mode 100644 index ad6cb050da5..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-success-function-call-short.txt +++ /dev/null @@ -1,2 +0,0 @@ -data: {"candidates": [{"content": {"parts": [{ "functionCall": { "name": "getTemperature", "args": { "city": "San Jose" } } }]}, "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/packages/vertexai/test-utils/mock-responses/streaming-success-unknown-enum.txt b/packages/vertexai/test-utils/mock-responses/streaming-success-unknown-enum.txt deleted file mode 100644 index ce29a518ee1..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-success-unknown-enum.txt +++ /dev/null @@ -1,12 +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/packages/vertexai/test-utils/mock-responses/streaming-success-utf8.txt b/packages/vertexai/test-utils/mock-responses/streaming-success-utf8.txt deleted file mode 100644 index a7531ab2580..00000000000 --- a/packages/vertexai/test-utils/mock-responses/streaming-success-utf8.txt +++ /dev/null @@ -1,8 +0,0 @@ -data: { "candidates": [ { "content": { "parts": [ { "text": "秋风瑟瑟,叶落纷纷,\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" } ] } ], "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": "霜渐浓。\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" } ] } ] } - -data: { "candidates": [ { "content": { "parts": [ { "text": "绪万千,\n明月当空,星星眨眼。\n思念远方的亲人,\n祝愿他们幸福安康。\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" } ] } ] } - -data: { "candidates": [ { "content": { "parts": [ { "text": ",\n一家人围坐在一起,\n分享丰收的喜悦,共度美好时光。\n\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/packages/vertexai/test-utils/mock-responses/unary-failure-empty-content.json b/packages/vertexai/test-utils/mock-responses/unary-failure-empty-content.json deleted file mode 100644 index 4e1889660f2..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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/packages/vertexai/test-utils/mock-responses/unary-failure-finish-reason-safety.json b/packages/vertexai/test-utils/mock-responses/unary-failure-finish-reason-safety.json deleted file mode 100644 index 111e33de2e3..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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/packages/vertexai/test-utils/mock-responses/unary-failure-image-rejected.json b/packages/vertexai/test-utils/mock-responses/unary-failure-image-rejected.json deleted file mode 100644 index 9dacdc71e7a..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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/packages/vertexai/test-utils/mock-responses/unary-failure-model-not-found.json b/packages/vertexai/test-utils/mock-responses/unary-failure-model-not-found.json deleted file mode 100644 index 50fcb725667..00000000000 --- a/packages/vertexai/test-utils/mock-responses/unary-failure-model-not-found.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "error": { - "code": 404, - "message": "models/test-model-name is not found for API version v1beta, or is not supported for countTokens. 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/test-model-name is not found for API version v1beta, or is not supported for countTokens. Call ListModels to see the list of available models and their supported methods. [google.rpc.error_details_ext] { message: \"models/test-model-name is not found for API version v1beta, or is not supported for countTokens. Call ListModels to see the list of available models and their supported methods.\" }" - } - ] - } -} diff --git a/packages/vertexai/test-utils/mock-responses/unary-failure-prompt-blocked-safety.json b/packages/vertexai/test-utils/mock-responses/unary-failure-prompt-blocked-safety.json deleted file mode 100644 index 9d2abbb23d6..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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/packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-long.json b/packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-long.json deleted file mode 100644 index b46ffedf563..00000000000 --- a/packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-long.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "candidates": [ - { - "content": { - "role": "model", - "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, - "finishReason": "STOP", - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.047869004, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.050705366 - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.052134257, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.036288295 - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.08464396, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.033907957 - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.06290424, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.050611436 - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 6, - "candidatesTokenCount": 303, - "totalTokenCount": 309 - } -} diff --git a/packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-short.json b/packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-short.json deleted file mode 100644 index a0101241f41..00000000000 --- a/packages/vertexai/test-utils/mock-responses/unary-success-basic-reply-short.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "candidates": [ - { - "content": { - "role": "model", - "parts": [ - { - "text": "Mountain View, California" - } - ] - }, - "index": 0, - "finishReason": "STOP", - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.029035643, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.05613278 - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.2641685, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.082253955 - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.087252244, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.04509957 - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.1431877, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.11027937 - } - ] - } - ], - "usageMetadata": { - "promptTokenCount": 6, - "candidatesTokenCount": 7, - "totalTokenCount": 13 - } -} diff --git a/packages/vertexai/test-utils/mock-responses/unary-success-citations.json b/packages/vertexai/test-utils/mock-responses/unary-success-citations.json deleted file mode 100644 index 254b4f59f2f..00000000000 --- a/packages/vertexai/test-utils/mock-responses/unary-success-citations.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "candidates": [ - { - "content": { - "role": "model", - "parts": [ - { - "text": "Some information cited from an external source" - } - ] - }, - "finishReason": "STOP", - "index": 0, - "safetyRatings": [ - { - "category": "HARM_CATEGORY_HATE_SPEECH", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.16926852, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.08181271 - }, - { - "category": "HARM_CATEGORY_DANGEROUS_CONTENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.15636235, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.02981654 - }, - { - "category": "HARM_CATEGORY_HARASSMENT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.33133608, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.10875559 - }, - { - "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", - "probability": "NEGLIGIBLE", - "probabilityScore": 0.17766814, - "severity": "HARM_SEVERITY_NEGLIGIBLE", - "severityScore": 0.18787657 - } - ], - "citationMetadata": { - "citations": [ - { - "endIndex": 128, - "uri": "https://www.example.com/some-citation-1" - }, - { - "startIndex": 130, - "endIndex": 265, - "uri": "https://www.example.com/some-citation-2" - }, - { - "startIndex": 272, - "endIndex": 431, - "uri": "https://www.example.com/some-citation-3", - "license": "mit" - } - ] - } - } - ], - "usageMetadata": { - "promptTokenCount": 15, - "candidatesTokenCount": 253, - "totalTokenCount": 268 - } -} diff --git a/packages/vertexai/test-utils/mock-responses/unary-success-no-billable-characters.json b/packages/vertexai/test-utils/mock-responses/unary-success-no-billable-characters.json deleted file mode 100644 index 03425d51db0..00000000000 --- a/packages/vertexai/test-utils/mock-responses/unary-success-no-billable-characters.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "totalTokens": 258 -} diff --git a/packages/vertexai/test-utils/mock-responses/unary-success-total-tokens.json b/packages/vertexai/test-utils/mock-responses/unary-success-total-tokens.json deleted file mode 100644 index d2ad6e4ff30..00000000000 --- a/packages/vertexai/test-utils/mock-responses/unary-success-total-tokens.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "totalTokens": 6, - "totalBillableCharacters": 16 -} diff --git a/packages/vertexai/test-utils/mock-responses/unary-success-unknown-enum.json b/packages/vertexai/test-utils/mock-responses/unary-success-unknown-enum.json deleted file mode 100644 index 92ced8ce3b8..00000000000 --- a/packages/vertexai/test-utils/mock-responses/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" - } - ] - } -}