blob: 59900550f1f5f762c6938119b2a117912951a6d6 [file] [log] [blame]
Tsuyoshi Horo0a2451b2024-08-15 02:25:511// 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
10namespace content {
11
12// The implementation of `blink::mojom::AIWriter` which only echoes back the
13// input text used for testing.
14class 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 Lee968a2f52025-03-14 13:20:4527 void MeasureUsage(const std::string& input,
28 const std::string& context,
29 MeasureUsageCallback callback) override;
Tsuyoshi Horo0a2451b2024-08-15 02:25:5130};
31
32} // namespace content
33
34#endif // CONTENT_BROWSER_AI_ECHO_AI_WRITER_H_