From d4d868a0a1a532eecf5f5aab4c26aed91440189a Mon Sep 17 00:00:00 2001 From: Sampson Date: Tue, 17 Dec 2024 07:32:25 -0600 Subject: [PATCH] addresses presubmit warning 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). --- .../engine/byom_api_client_unittest.cc | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/components/ai_chat/core/browser/engine/byom_api_client_unittest.cc b/components/ai_chat/core/browser/engine/byom_api_client_unittest.cc index d8c57956b6b6..43227a32135d 100644 --- a/components/ai_chat/core/browser/engine/byom_api_client_unittest.cc +++ b/components/ai_chat/core/browser/engine/byom_api_client_unittest.cc @@ -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?";