Add mock-responses with finish message#61
Conversation
Coverage Diff |
There was a problem hiding this comment.
Code Review
This pull request introduces new mock response files for the Google AI (Gemini) API, covering both streaming success and unary failure scenarios. The review feedback highlights that the finishMessage field is non-standard for the Gemini API and should be removed to ensure the mocks accurately reflect the actual API schema. Additionally, it is recommended to include standard fields such as modelVersion and usageMetadata for consistency.
| @@ -0,0 +1,3 @@ | |||
| data: {"candidates": [{"content": {"parts": [{"text": "Hello"}],"role": "model"}}],"modelVersion": "gemini-2.0-flash"} | |||
|
|
|||
| data: {"candidates": [{"content": {"parts": [{"text": " world!"}],"role": "model"},"finishReason": "STOP","finishMessage": "Finished successfully"}],"modelVersion": "gemini-2.0-flash"} | |||
There was a problem hiding this comment.
The finishMessage field is not a standard part of the Google AI (Gemini) API response schema for a Candidate. Standard fields include content, finishReason, safetyRatings, etc. If this mock is intended to represent the raw API response, consider removing this field to maintain accuracy.
data: {"candidates": [{"content": {"parts": [{"text": " world!"}],"role": "model"},"finishReason": "STOP"}],"modelVersion": "gemini-2.0-flash"}
| { | ||
| "candidates": [ | ||
| { | ||
| "finishReason": "OTHER", | ||
| "finishMessage": "Model failed to generate content due to internal error." | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Similar to the streaming mock, finishMessage is not a standard field in the Gemini API. Additionally, for consistency with other mock responses in this repository (such as the Vertex AI examples), it is recommended to include the modelVersion and usageMetadata fields while removing the non-standard finishMessage.
| { | |
| "candidates": [ | |
| { | |
| "finishReason": "OTHER", | |
| "finishMessage": "Model failed to generate content due to internal error." | |
| } | |
| ] | |
| } | |
| { | |
| "candidates": [ | |
| { | |
| "finishReason": "OTHER" | |
| } | |
| ], | |
| "usageMetadata": { | |
| "promptTokenCount": 0, | |
| "totalTokenCount": 0 | |
| }, | |
| "modelVersion": "gemini-2.0-flash" | |
| } |
rlazo
left a comment
There was a problem hiding this comment.
Feel free to submit, ignore Android test
No description provided.