Skip to content

Adding ApiBuilder::from_cache method.#27

Merged
Narsil merged 2 commits into
mainfrom
allow_bypass_failing_init
Sep 19, 2023
Merged

Adding ApiBuilder::from_cache method.#27
Narsil merged 2 commits into
mainfrom
allow_bypass_failing_init

Conversation

@Narsil

@Narsil Narsil commented Sep 18, 2023

Copy link
Copy Markdown
Contributor

Turns out dirs::home_dir() can fail on Android apps (there is no $home_dir
set for them).

This is probably super niche, and I didn't find any good way to detect the location cache folder,
therefore I simply include these new functions to allow creating and API from a functional cache.

This is interesting anyway for anyone wanting to use a custom cache location.

@Narsil Narsil requested a review from McPatate September 18, 2023 05:40
@McPatate

McPatate commented Sep 18, 2023

Copy link
Copy Markdown
Member

I use the home crate in llm-ls, as they do in cargo:

    let home_dir = home::home_dir().ok_or(()).expect("failed to find home dir");

Or am I misunderstanding the issue?

@Narsil

Narsil commented Sep 18, 2023

Copy link
Copy Markdown
Contributor Author

This isn't linked to that.

It's just that APPS on mobile (iOS, android) are run as users which do NOT have home directories altogether.
on android at least ther

@Narsil Narsil merged commit 6861891 into main Sep 19, 2023
@McPatate McPatate deleted the allow_bypass_failing_init branch September 21, 2023 07:53
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