Skip to content

Commit

Permalink
addresses presubmit warning
Browse files Browse the repository at this point in the history
Addressing a long-standing warning regarding the length of these lines. Unit tests still pass even with more familiar JSON formatting. As such, this change addresses the presubmit warnings associated with this file (and these lines in particular).
  • Loading branch information
jonathansampson committed Dec 17, 2024
1 parent a9d696c commit d4d868a
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions components/ai_chat/core/browser/engine/byom_api_client_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,49 @@ TEST_F(BYOMAPIUnitTest, PerformRequest) {
"test_model");

std::string server_chunk =
R"({"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0125", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":"It was played in Arlington, Texas."},"logprobs":null,"finish_reason":null}]})";
R"({
"id": "chatcmpl-123",
"object": "chat.completion.chunk",
"created": 1694268190,
"model": "gpt-3.5-turbo-0125",
"system_fingerprint": "fp_44709d6fcb",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": "It was played in Arlington, Texas."
},
"logprobs": null,
"finish_reason": null
}
]
})";

std::string server_completion =
R"({"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_44709d6fcb","choices":[{"index":0,"message":{"role":"assistant","content":"\n\nCan I assist you further?"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":12,"total_tokens":21}})";
R"({
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-3.5-turbo-0125",
"system_fingerprint": "fp_44709d6fcb",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nCan I assist you further?"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
})";

std::string expected_chunk_response = "It was played in Arlington, Texas.";
std::string expected_completion_response = "\n\nCan I assist you further?";
Expand Down

0 comments on commit d4d868a

Please sign in to comment.