Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use SpeziLLM, SpeziChat, and Spezi 1.x #36

Merged
merged 27 commits into from
Mar 28, 2024
Merged

Conversation

vishnuravi
Copy link
Member

@vishnuravi vishnuravi commented Mar 17, 2024

Refactor to use SpeziLLM, SpeziChat, and Spezi 1.x

♻️ Current situation & Problem

The current application uses SpeziML, which has now been replaced by SpeziLLM. SpeziLLM provides significant additional functionality and will simplify the code. It also uses a pre-release version of Spezi, and should be migrated to the latest production release.

⚙️ Release Notes

  • The application has been upgraded to Spezi 1.x and refactored to use SpeziLLM.
  • The chat view has been migrated to SpeziChat, and an option to export the chat as a text file has been added.
  • The SettingsView has been recreated, adhering to Apple Design Guidelines and including additional options to switch the OpenAI model used and change the Open AI API key.
  • Strings have been migrated to a string catalogue for easier localization.
  • Unnecessary files and code have been cleaned up.

📚 Documentation

In-line documentation has been updated.

✅ Testing

  • Additional UI tests have been added for the new SettingsView and the HealthGPTView.
  • This PR introduces a --mockMode feature flag to allow for UI testing with mock LLM responses.

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@PSchmiedmayer
Copy link
Member

Nice; thank you for looking into this @vishnuravi! 🚀

@vishnuravi
Copy link
Member Author

Nice; thank you for looking into this @vishnuravi! 🚀

Was waiting for the bugfix in StanfordSpezi/SpeziLLM#50 to get merged and released to finish this. Should be able to finish now.

@PSchmiedmayer
Copy link
Member

Very nice; thanks for all the work here @vishnuravi 🚀

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 92.91%. Comparing base (0d5fee8) to head (132cd49).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   87.52%   92.91%   +5.40%     
==========================================
  Files          25       24       -1     
  Lines         785      832      +47     
==========================================
+ Hits          687      773      +86     
+ Misses         98       59      -39     
Files Coverage Δ
...ealthGPT/HealthGPT/HealthDataFetcher+Process.swift 100.00% <100.00%> (ø)
HealthGPT/HealthGPT/HealthDataFetcher.swift 89.75% <100.00%> (-0.33%) ⬇️
HealthGPT/HealthGPT/PromptGenerator.swift 100.00% <100.00%> (ø)
HealthGPT/HealthGPTAppDelegate.swift 100.00% <100.00%> (ø)
HealthGPT/HealthGPTApplication.swift 100.00% <100.00%> (ø)
HealthGPT/HealthGPTStandard.swift 0.00% <ø> (ø)
HealthGPT/Onboarding/Disclaimer.swift 90.33% <ø> (ø)
HealthGPT/Onboarding/OnboardingFlow.swift 82.36% <ø> (ø)
HealthGPT/Onboarding/OpenAIAPIKey.swift 100.00% <100.00%> (ø)
HealthGPT/Onboarding/OpenAIModelSelection.swift 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d5fee8...132cd49. Read the comment docs.

@vishnuravi vishnuravi marked this pull request as ready for review March 23, 2024 14:33
Copy link

@philippzagar philippzagar left a comment

Choose a reason for hiding this comment

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

Thanks @vishnuravi for the update to SpeziLLM, greatly appreciated!
Only had some minor comments and improvement suggestions, no need for a second round of review

HealthGPT/HealthGPT/HealthDataInterpreter.swift Outdated Show resolved Hide resolved
HealthGPT/HealthGPT/HealthGPTView.swift Show resolved Hide resolved
HealthGPT/HealthGPT/HealthGPTView.swift Outdated Show resolved Hide resolved
HealthGPT/HealthGPT/SettingsView.swift Show resolved Hide resolved
HealthGPT/HealthGPTAppDelegate.swift Outdated Show resolved Hide resolved
HealthGPT/HealthGPTStandard.swift Outdated Show resolved Hide resolved
HealthGPT/HealthGPT/HealthGPTView.swift Outdated Show resolved Hide resolved
HealthGPT/HealthGPTAppTestingSetup.swift Outdated Show resolved Hide resolved
@vishnuravi vishnuravi changed the title Refactor to use SpeziLLM Refactor to use SpeziLLM, SpeziChat, and Spezi 1.x Mar 28, 2024
@vishnuravi vishnuravi enabled auto-merge (squash) March 28, 2024 18:01
@vishnuravi vishnuravi merged commit cbc216e into main Mar 28, 2024
7 checks passed
@vishnuravi vishnuravi deleted the refactor branch March 28, 2024 20:17
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.

3 participants