Repository navigation
Settings redesign, first-open setup and Wi-Fi-only downloads - #26
Merged
Merged
Conversation
The user names the server's base address and the model in Settings and pastes their key; the app sends a plain text Chat Completions request to <base>/chat/completions and reads the text on the device, so no image ever leaves the phone. - EngineId.CUSTOM (offered, user key, no default model): the user must name both the model and the address. - CustomEndpoint (core:model) reduces an address to its base: a pasted …/chat/completions is stripped, the path the user wrote is kept, no version segment is ever appended, and HTTPS is required. - CustomOpenAiEngine (core:engine) is a standalone LlmEngine: text only, and a server that refuses the optional temperature is asked once more without it. - The base URL lives in DataStore (an address, not a secret); the key stays in the existing SecureKeyStore. - The key sheet gains an address field for this engine only, and one save callback carries the key, the model and the address through a single ViewModel coroutine. Existing engines are untouched.
…ry, warn about tiny models A server at home is not a hosted provider. It may answer with a bare object instead of an array, with the array inside a code fence, wrapped in a "translations" key, or with the translation under "english" or "translation". It may also put brackets inside the text of a bubble, which a naive cut would mistake for the array. The parser now tries the reply as a whole, then as the outermost array, then as the outermost object, and takes the first that yields a usable list of items. What the reply must still carry is unchanged: every requested id exactly once, nothing invented, nothing reordered. A wrong type anywhere makes the reply unusable rather than throwing, so a bad reply can no longer crash the app with a serialization error instead of saying "malformed". The retry no longer depends on the conversation. Some local servers rewrite a multi-turn history — the original input dropped, the order reversed — so a retry that said "your previous reply was wrong" could never work. The Custom AI engine now sends one fresh request that carries the input and the correction together, and the system prompt shows what a reply looks like when there is a single item. The hosted providers keep the three-turn retry they had. A reply whose content is a list of parts is read, and a reply with empty model/created/usage fields is accepted. The sheet warns when the model name gives away a model of about a billion parameters or less, which usually cannot follow the translation format. The warning does not stop the save.
✅ Unit tests: PASS848 of 848 passed · line coverage 59.6% (logic 68.5%, Compose UI 46.6%) · branch coverage 43.9% Full HTML report (expected vs actual for every test) · Workflow run
JVM unit tests ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Settings becomes a searchable hub of eight pages. First open now explains what the app will download and asks
which network to use.
Settings
SettingsHub,SettingsPages):searchSettings);PRIVACY.mdandLICENSES.mdare copied into the APK at build time(
copyLegalDocs) and rendered byLegalPage/MarkdownLite, with a View on GitHub link. Same files as onGitHub.
model, key).
CustomProvider.of), so nothing new is stored.export screen offers "Default: …",
Download/Panelglass(the way out if the default folder is gone) and Choosefolder.
First open and downloads
per-app language recreates the screen straight away.
and Chinese packs 31 MB each) and asks Wi-Fi only (default) or Wi-Fi or mobile data. Nothing downloads
before an answer; Later asks again at the next open.
(
DownloadNetwork→ DownloadManagersetAllowedOverMetered, ML KitrequireWifi).Wi-Fi-only request.
name-1.partis found throughCOLUMN_LOCAL_URI, and stray copiesare deleted;
Small Fixes
the Models page bar no longer goes stale.
records one recent pair.
ExportFolders). Dead code is removed.