Skip to content

Improve booking server and Firebase integration - #189

Merged
JolandaVerhoef merged 5 commits into
mainfrom
feature/a2ui-booking-server
Oct 15, 2026
Merged

JolandaVerhoef merged 5 commits into
mainfrom
feature/a2ui-booking-server

Conversation

@JolandaVerhoef

Copy link
Copy Markdown
Collaborator

No description provided.

…nager

- Adds A2uiSchemaManager in server/main.py to load booking_catalog.json and generate system prompt
- Configures specialized ADK Agents for flights, hotels, activities, and dining with interactive make_update_ui tool
- Streams native A2UI protocol events (createSurface, updateComponents) over SSE
- Updates BookingAssistantViewModel to parse and render native A2UI protocol payloads directly
- Updates server/requirements.txt to include a2ui-agent>=0.9.0 and google-adk>=0.1.0

@ksemenova ksemenova left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall with few minor comments.

For code readability suggesting to replace the low-level JSONObject traversal with typed data classes (e.g., using kotlinx.serialization or a dedicated mapper)

Log.w("JetPackerApplication", "Firebase not initialized")
}
} catch (e: Exception) {
Log.w("JetPackerApplication", "Firebase initialization error", e)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If initialization fails how the app should work? Do we need to exit here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah the rest of the features will still work so no need to fully cancel. We should just make sure not to crash

} catch (e: Exception) {
log("FirebaseAuth.getInstance failed: ${e.message}")
Log.e("BookingAssistant", "FirebaseAuth.getInstance failed", e)
return ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we return an empty token here? should it return the exception?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically we choose to catch the exception here instead of at the caller site so that we can run the app even when firebase is not initialized and at least test the other features. Not the best user experience as the firebase features would not work, but that's not our demo scenario anyway.

componentsList.add(A2uiComponentPayload(id = id, type = type, properties = propsMap))
}
}
val firstComp = componentsList.firstOrNull()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we process only the first component?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the backend is written so it only returns the one component, so we should just retrieve that one.

@JolandaVerhoef

Copy link
Copy Markdown
Collaborator Author

Looks good overall with few minor comments.

For code readability suggesting to replace the low-level JSONObject traversal with typed data classes (e.g., using kotlinx.serialization or a dedicated mapper)

I removed that whole traversal all-together :)

@ksemenova ksemenova left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

…side execution

- Adds /v2/* routes in openapi.yaml pointing to parallel Cloud Run service jetpacker-server-v2
- Makes OIDC streaming audience dynamic via CLOUD_RUN_AUDIENCE in server/main.py
- Uses inspect.signature for dynamic ADK initialization and adds booking/ root agent discovery module
- Introduces BackendEndpoint selector (PARALLEL_STAGING, PRODUCTION, LOCAL) in BookingAssistantViewModel defaulting to /v2
- Adds deployment instructions for production and parallel staging backends to README.md
@JolandaVerhoef
JolandaVerhoef merged commit e89e9fd into main Oct 15, 2026
8 checks passed
@JolandaVerhoef
JolandaVerhoef deleted the feature/a2ui-booking-server branch October 15, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants