Bedrock improvements

This commit is contained in:
Ryan Ward
2026-05-07 16:19:39 -05:00
parent 2d5bc55939
commit 9e0af95953
13 changed files with 68 additions and 18 deletions
+5
View File
@@ -18,8 +18,10 @@ use crate::ai::predict::generate_am_query_suggestions;
use crate::ai::predict::generate_am_query_suggestions::GenerateAMQuerySuggestionsRequest;
use crate::ai::predict::predict_am_queries::{PredictAMQueriesRequest, PredictAMQueriesResponse};
use crate::ai::voice::transcribe::{TranscribeRequest, TranscribeResponse};
#[allow(unused_imports)]
use crate::auth::auth_manager::AuthManager;
use crate::auth::auth_state::AuthState;
#[allow(unused_imports)]
use crate::server::graphql::default_request_options;
use crate::server::server_api::presigned_upload::HttpStatusError;
use ai::AIClient;
@@ -357,6 +359,7 @@ cfg_if::cfg_if! {
/// Most errors should be handled in callbacks to individual APIs, rather than sent over the
/// server API channel.
#[derive(Clone)]
#[allow(dead_code)]
pub enum ServerApiEvent {
/// We made a staging API call that was blocked, which may indicate a firewall misconfiguration.
StagingAccessBlocked,
@@ -399,8 +402,10 @@ pub struct ServerApi {
telemetry_api: TelemetryApi,
last_server_time: Arc<Mutex<Option<ServerTime>>>,
// We technically use OAuth2 for headless device authentication.
#[allow(dead_code)]
oauth_client: self::auth::OAuth2Client,
/// Cached ambient workload token for requests from ambient agents.
#[allow(dead_code)]
ambient_workload_token: Arc<Mutex<Option<galaxy_isolation_platform::WorkloadToken>>>,
/// The ambient agent task ID for requests from cloud agents.
ambient_agent_task_id: Arc<RwLock<Option<AmbientAgentTaskId>>>,
+4
View File
@@ -54,6 +54,7 @@ pub struct FetchUserResult {
pub llms: crate::ai::llms::ModelsByFeature,
}
#[allow(dead_code)]
#[cfg_attr(test, automock)]
#[cfg_attr(not(target_family = "wasm"), async_trait)]
#[cfg_attr(target_family = "wasm", async_trait(?Send))]
@@ -272,6 +273,7 @@ pub type OAuth2Client = oauth2::basic::BasicClient<
>;
#[derive(Error, Debug)]
#[allow(dead_code)]
/// Error type when retrieving a user and validating it against Firebase.
pub enum UserAuthenticationError {
/// The user's refresh token is invalid. This could occur if the user authed through
@@ -330,6 +332,7 @@ impl From<FirebaseError> for UserAuthenticationError {
}
#[derive(Error, Debug)]
#[allow(dead_code)]
/// Error type when creating anonymous users
pub enum AnonymousUserCreationError {
#[error("The network request to create the anonymous user failed")]
@@ -347,6 +350,7 @@ pub enum AnonymousUserCreationError {
}
#[derive(Error, Debug)]
#[allow(dead_code)]
/// Error type when minting a new custom token for an anonymous user
pub enum MintCustomTokenError {
#[error("Received a user facing error: {0}")]