[iOS] Improve error handling in AI prototyping menu

- Prints a short message describing the error when the model execution
service request fails.
- Parses tab organization response more safely by returning an error
instead of crashing.
- Clears the response field when a request is made so it's clear that
the error occurred again, instead of the error message lingering.
- Removes unused on-device function.

Fixed: 392901832
Change-Id: I5a7e8be1ef244651db5cd1aeb1c562306be0a514
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226701
Reviewed-by: Nicolas MacBeth <nicolasmacbeth@google.com>
Commit-Queue: Adam Arcaro <adamta@google.com>
Cr-Commit-Position: refs/heads/main@{#1416487}
NOKEYCHECK=True
GitOrigin-RevId: 8d37b6bb9d89dccd26af0adc20cfbb21af7bc947
6 files changed
tree: f47ca5e621fde4e35aeff3b00f93115478922a96
  1. build/
  2. chrome/
  3. components/
  4. google_internal/
  5. intents/
  6. net/
  7. public/
  8. testing/
  9. third_party/
  10. tools/
  11. web/
  12. web_view/
  13. .swift-format
  14. BUILD.gn
  15. COMMON_METADATA
  16. DEPS
  17. DIR_METADATA
  18. features.gni
  19. OWNERS
  20. PRESUBMIT.py
  21. PRESUBMIT_test.py
  22. README.md
README.md

This directory holds code related to Chrome for iOS. See this document for a description of the structure underneath this directory.