#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_AI_MODEL_EXECUTION_RESPONDER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_AI_MODEL_EXECUTION_RESPONDER_H_
#include <tuple>
#include "base/functional/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/ai/model_streaming_responder.mojom-blink-forward.h"
#include "third_party/blink/renderer/bindings/core/v8/idl_types.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/modules/ai/ai_metrics.h"
#include "third_party/blink/renderer/modules/modules_export.h"
namespace base {
class SequencedTaskRunner;
}
namespace blink {
class AbortSignal;
class ReadableStream;
class ScriptState;
MODULES_EXPORT std::tuple<
ReadableStream*,
mojo::PendingRemote<blink::mojom::blink::ModelStreamingResponder>>
CreateModelExecutionStreamingResponder(
ScriptState* script_state,
AbortSignal* signal,
scoped_refptr<base::SequencedTaskRunner> task_runner,
AIMetrics::AISessionType session_type,
base::OnceCallback<void(std::optional<uint64_t> current_tokens)>
complete_callback);
MODULES_EXPORT std::tuple<
ScriptPromise<IDLString>,
mojo::PendingRemote<blink::mojom::blink::ModelStreamingResponder>>
CreateModelExecutionResponder(
ScriptState* script_state,
AbortSignal* signal,
scoped_refptr<base::SequencedTaskRunner> task_runner,
AIMetrics::AISessionType session_type,
base::OnceCallback<void(std::optional<uint64_t> current_tokens)>
complete_callback);
}
#endif