Skip to content

Add Omi Uber call chat tool app#7437

Open
sravan27 wants to merge 2 commits into
BasedHardware:mainfrom
sravan27:codex/uber-call-app-2316
Open

Add Omi Uber call chat tool app#7437
sravan27 wants to merge 2 commits into
BasedHardware:mainfrom
sravan27:codex/uber-call-app-2316

Conversation

@sravan27
Copy link
Copy Markdown

@sravan27 sravan27 commented May 21, 2026

Summary

  • Adds plugins/uber_call, a FastAPI Omi Chat Tools app for issue send uber app #2316.
  • Exposes /.well-known/omi-tools.json with a call_uber tool and /api/call_uber endpoint.
  • Uses Uber's official mobile deep-link flow instead of the restricted Ride Request API, so the user reviews and confirms pickup, destination, product, pricing, and payment inside Uber.
  • Includes a pure URL-builder module plus regression tests for required destination, current-location pickup, coordinates, product_id, generated web/app links, manifest shape, successful endpoint responses, and malformed geolocation validation.

/claim #2316

Demo

Short demo video: https://sravan27.github.io/money-27-proof/proof/omi_uber_call_demo.mp4

Example output from the endpoint smoke test:

manifest and endpoint smoke passed
https://m.uber.com/ul/?action=setPickup&pickup=my_location&dropoff[nickname]=SFO%20Airport&dropoff[formatted_address]=SFO%20Airport

Review Follow-Up

Greptile's review on the first commit called out three items. Commit 847e2c1 addresses them:

  • wraps pickup/dropoff geolocation parsing in the endpoint ValueError guard, so malformed lat/lng returns HTTP 400 instead of a 500;
  • adds httpx>=0.27.0 to plugins/uber_call/requirements.txt for fastapi.testclient.TestClient;
  • adds "type": "object" to the Omi tool manifest parameter schema;
  • adds plugins/uber_call/test_main.py endpoint tests for manifest shape, successful request, and malformed geolocation handling.

Validation

python3 -m unittest plugins/uber_call/test_uber_links.py plugins/uber_call/test_main.py
uv run --with fastapi --with httpx --with pydantic python -m unittest \
  plugins/uber_call/test_uber_links.py \
  plugins/uber_call/test_main.py
python3 -m py_compile \
  plugins/uber_call/uber_links.py \
  plugins/uber_call/test_uber_links.py \
  plugins/uber_call/main.py \
  plugins/uber_call/test_main.py
git diff --check

Focused local result with FastAPI dependencies:

Ran 6 tests in 0.021s

OK

No Uber API keys, OAuth tokens, payment credentials, secrets, hidden context, or private runtime data are included.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR adds plugins/uber_call, a new self-contained FastAPI Omi Chat Tools plugin that converts a natural-language destination into an Uber deep-link (both m.uber.com/ul/ and uber:// scheme) without requiring any Uber API credentials.

  • uber_links.py is a pure URL-builder with proper percent-encoding, my_location pickup fallback, optional coordinate and product-ID support, and whitespace-destination rejection.
  • main.py exposes /.well-known/omi-tools.json and POST /api/call_uber; build_location is called outside the ValueError guard, so malformed geolocation values produce a 500 instead of a 400.
  • requirements.txt omits httpx, which fastapi.testclient.TestClient requires.

Confidence Score: 3/5

Safe to merge after fixing the unguarded ValueError in the geolocation path — current code returns 500 on malformed lat/lng from the Omi device payload.

The core URL-building logic in uber_links.py is solid and well-tested, but main.py calls build_location before the try/except ValueError block, so any non-numeric value arriving in the geolocation dict propagates as an unhandled exception yielding a 500 response.

plugins/uber_call/main.py — the error handling around build_location calls needs attention before this goes to production.

Important Files Changed

Filename Overview
plugins/uber_call/main.py FastAPI app exposing Omi Chat Tools manifest and /api/call_uber endpoint; build_location called outside try/except ValueError block so malformed geolocation coordinates cause unhandled 500; manifest JSON Schema missing type object
plugins/uber_call/uber_links.py Pure URL-builder module; logic is clean and well-structured; _normalize_float can raise ValueError for non-numeric strings but callers are responsible for catching it
plugins/uber_call/test_uber_links.py Unit tests cover happy path, coordinate preservation, missing destination, and whitespace destination; no integration tests for FastAPI endpoints
plugins/uber_call/requirements.txt Missing httpx which is required by fastapi.testclient.TestClient used in the validation script
plugins/uber_call/README.md Clear documentation covering setup, Omi App Store configuration, example output, safety notes, and test instructions

Sequence Diagram

sequenceDiagram
    participant U as User
    participant O as Omi Platform
    participant A as uber_call FastAPI
    participant UL as uber_links.py
    participant UB as Uber App

    U->>O: Call Uber to SFO Airport
    O->>A: GET /.well-known/omi-tools.json
    A-->>O: call_uber tool manifest
    O->>A: POST /api/call_uber
    A->>UL: build_location pickup
    A->>UL: build_location dropoff
    A->>UL: build_uber_deep_links
    UL-->>A: UberDeepLinks web_link app_link
    A-->>O: result web_link app_link
    O-->>U: Uber is ready. Open link to confirm
    U->>UB: Opens deep link confirms ride
Loading

Reviews (1): Last reviewed commit: "Add Omi Uber call chat tool app" | Re-trigger Greptile

Comment thread plugins/uber_call/main.py Outdated
Comment on lines +118 to +133
pickup = build_location(
latitude=pickup_latitude,
longitude=pickup_longitude,
formatted_address=pickup_address,
nickname=(
"Current location"
if pickup_address or (pickup_latitude is not None and pickup_longitude is not None)
else None
),
)
dropoff = build_location(
latitude=payload.dropoff_latitude,
longitude=payload.dropoff_longitude,
formatted_address=payload.dropoff_address or payload.destination,
nickname=payload.destination or payload.dropoff_address,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Unhandled ValueError from malformed geolocation data causes 500

build_location is called before the try/except ValueError block that guards build_uber_deep_links. If _geo_value extracts a non-numeric string for latitude or longitude (e.g., the Omi device sends "latitude": "unknown" in the geolocation dict), _normalize_float will call float("unknown") and raise a ValueError that is never caught, resulting in an unhandled 500 instead of a clean 400. Move both build_location calls inside the try/except, or add a separate try/except around them.

Comment thread plugins/uber_call/main.py
Comment on lines +60 to +61
"parameters": {
"properties": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The parameters object in the manifest is missing "type": "object", which is required by the JSON Schema specification. Some Omi tool parsers and validators that strictly check the schema structure may reject or mishandle the manifest.

Suggested change
"parameters": {
"properties": {
"parameters": {
"type": "object",
"properties": {

Comment on lines +1 to +2
fastapi>=0.111.0
uvicorn[standard]>=0.30.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 httpx is not listed as a dependency but is required by fastapi.testclient.TestClient (used in the PR's own validation script). Without it, from fastapi.testclient import TestClient will raise an ImportError in any environment that installs only what is in requirements.txt.

Suggested change
fastapi>=0.111.0
uvicorn[standard]>=0.30.0
fastapi>=0.111.0
httpx>=0.27.0
uvicorn[standard]>=0.30.0

Copy link
Copy Markdown
Collaborator

@kodjima33 kodjima33 left a comment

Choose a reason for hiding this comment

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

thanks for the Uber call chat tool app

@sravan27
Copy link
Copy Markdown
Author

Hi @kodjima33 — thanks for the approval, glad the Uber call app is useful! 🙏

Quick status so it's easy to action:

  • The PR is mergeable and self-contained (plugins/uber_call, a FastAPI Omi Chat Tools app — no changes to the core app).
  • It includes /claim #2316 and a short demo video in the description.

I know #2316 got parked during the old-issue cleanup. Since the app is now built, reviewed, and approved, would you be open to merging it and reactivating the $1K bounty on #2316? Happy to rebase or make any final tweaks you'd like first.

Either way, thanks for the review — the app works against Uber's official deep-link flow, so the user always confirms pickup/destination/price/payment inside Uber.

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