Skip to content

Add provider configuration to Demo - #442

Open
GtechGovind wants to merge 1 commit into
MacPaw:mainfrom
GtechGovind:feat/demo-provider-configuration
Open

GtechGovind wants to merge 1 commit into
MacPaw:mainfrom
GtechGovind:feat/demo-provider-configuration

Conversation

@GtechGovind

Copy link
Copy Markdown

What

  • Add OpenAI, Gemini, and Custom provider choices to the Demo configuration UI.
  • Persist the selected provider, base URL, and API key across launches.
  • Parse custom base URLs into scheme, host, port, and base path, with validation for unsupported URLs and invalid ports.
  • Reconfigure every Demo client through one middleware-preserving factory and use relaxed decoding for compatible providers.
  • Add focused tests for provider presets, parsing behavior, configuration mapping, and URL validation.

Why

The Demo currently hardcodes OpenAI's default endpoint. This allows it to exercise Gemini's OpenAI-compatible endpoint or a custom endpoint without editing source code.

Closes #308.

Affected Areas

  • Demo API configuration UI and persistence
  • Demo client construction and reconfiguration
  • DemoChat provider endpoint parsing and tests

Testing

  • xcodebuild -scheme DemoChat -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.5' test — 8 test functions / 15 test invocations passed.
  • xcodebuild -project Demo/Demo.xcodeproj -scheme Demo -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO build — passed.
  • swift test — 187 XCTest tests and 25 Swift Testing tests passed.
  • git diff --check — passed.

Direct swift test --package-path Demo/DemoChat on macOS remains blocked by existing ExyteChat package metadata: ExyteChat declares macOS 10.13 while ActivityIndicatorView and Kingfisher require macOS 10.15. The focused DemoChat tests pass through the supported iOS simulator destination above.

@GtechGovind
GtechGovind marked this pull request as ready for review September 16, 2026 19:38
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.

Make Demo configurable for providers through UI

1 participant