#ifndef SERVICES_ON_DEVICE_MODEL_BACKEND_SESSION_H_
#define SERVICES_ON_DEVICE_MODEL_BACKEND_SESSION_H_
#include "services/on_device_model/public/mojom/on_device_model.mojom.h"
namespace on_device_model {
class COMPONENT_EXPORT(ON_DEVICE_MODEL) BackendSession {
public:
virtual ~BackendSession() = default;
virtual void Append(
on_device_model::mojom::AppendOptionsPtr options,
mojo::PendingRemote<on_device_model::mojom::ContextClient> client,
base::OnceClosure on_complete) = 0;
virtual void Generate(
on_device_model::mojom::GenerateOptionsPtr input,
mojo::PendingRemote<on_device_model::mojom::StreamingResponder> response,
base::OnceClosure on_complete) = 0;
virtual void SizeInTokens(on_device_model::mojom::InputPtr input,
base::OnceCallback<void(uint32_t)> callback) = 0;
virtual void Score(const std::string& text,
base::OnceCallback<void(float)> callback) = 0;
virtual void GetProbabilitiesBlocking(
const std::string& input,
base::OnceCallback<void(const std::vector<float>&)> callback) = 0;
virtual std::unique_ptr<BackendSession> Clone() = 0;
virtual void AsrStream(
on_device_model::mojom::AsrStreamOptionsPtr options,
mojo::PendingRemote<on_device_model::mojom::AsrStreamResponder>
responder) = 0;
virtual void AsrAddAudioChunk(mojom::AudioDataPtr data) = 0;
};
}
#endif