blob: 28c9b81493abdfb3393f9f3e93e1bc7b6758ef52 [file] [log] [blame]
// Copyright 2016 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.modular;
using fuchsia.media;
struct QueryResponse {
vector<Proposal> proposals;
string? natural_language_response;
// An optional request for an AudioRenderer to play the voice/audio response
// to the query as answered by this agent. The agent must close this
// AudioRenderer once the response has ended, unless Suggestion Engine closes
// it earlier due to policy.
request<fuchsia.media.AudioRenderer>? audio_response;
};
// An interface enabling Agents and Modules to contribute Proposals reactively
// to the Suggestion engine based on a user query.
interface QueryHandler {
// Produces a list of Proposals in response to a query. The query may be empty
// in the case of an initial ask, and this method is called every time the
// query changes.
//
// Proposals given in the callback have their lifecycle tied to this query.
// After the query has completed, the proposals are dismissed. When the query
// changes, any proposals missing from the subsequent callback are likewise
// dismissed. These Proposals are distinct from Next/Interruption proposals,
// even if they may share IDs.
//
// Alternately, the client is free to call Propose on its
// ProposalPublisher to make persistent Proposals. However, these
// proposals may be subject to more stringent filtering by the Suggestion
// Engine. TODO(rosswang): spec/revisit.
1: OnQuery(UserInput query) -> (QueryResponse response);
};