Tsuyoshi Horo | 0a2451b | 2024-08-15 02:25:51 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_BROWSER_AI_ECHO_AI_WRITER_H_ |
| 6 | #define CONTENT_BROWSER_AI_ECHO_AI_WRITER_H_ |
| 7 | |
| 8 | #include "third_party/blink/public/mojom/ai/ai_writer.mojom.h" |
| 9 | |
| 10 | namespace content { |
| 11 | |
| 12 | // The implementation of `blink::mojom::AIWriter` which only echoes back the |
| 13 | // input text used for testing. |
| 14 | class EchoAIWriter : public blink::mojom::AIWriter { |
| 15 | public: |
| 16 | EchoAIWriter() = default; |
| 17 | EchoAIWriter(const EchoAIWriter&) = delete; |
| 18 | EchoAIWriter& operator=(const EchoAIWriter&) = delete; |
| 19 | |
| 20 | ~EchoAIWriter() override = default; |
| 21 | |
| 22 | // `blink::mojom::AIWriter` implementation. |
| 23 | void Write(const std::string& input, |
| 24 | const std::optional<std::string>& context, |
| 25 | mojo::PendingRemote<blink::mojom::ModelStreamingResponder> |
| 26 | pending_responder) override; |
Daseul Lee | 968a2f5 | 2025-03-14 13:20:45 | [diff] [blame] | 27 | void MeasureUsage(const std::string& input, |
| 28 | const std::string& context, |
| 29 | MeasureUsageCallback callback) override; |
Tsuyoshi Horo | 0a2451b | 2024-08-15 02:25:51 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | } // namespace content |
| 33 | |
| 34 | #endif // CONTENT_BROWSER_AI_ECHO_AI_WRITER_H_ |