generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added exportFormat parameter to LLMChatView (#48)
# LLMChatView exportFormat parameter ## ♻️ Current situation & Problem Currently, the LLMChatView creates an instance of the ChatView by passing .pdf as the exportFormat. The result is that there is no way to change the export format or disable exporting entirely. ## ⚙️ Release Notes Instead of passing .pdf to the ChatView, LLMChatView now has an optional parameter exportFormat that is passed to the ChatView. By default, it is .pdf (so the .init signature need not change), but can now take any of .pdf, .json, .text, or .none. If exportFormat is .none, no export button will appear in the toolbar. ## 📚 Documentation The LLMChatView/init now has an optional new signature where the user passes in a value for exportFormat. ```swift struct LLMChatTestView: View { // Use the convenience property wrapper to instantiate the `LLMMockSession` @LLMSessionProvider(schema: LLMMockSchema()) var llm: LLMMockSession @State var muted = true var body: some View { LLMChatView(session: $llm, exportFormat: .none) .speak(llm.context, muted: muted) .speechToolbarButton(muted: $muted) } } ``` Alternatively, the exportFormat parameter may be omitted, in which case the LLMChatView will default to .pdf. ## ✅ Testing Export functionality is rigorously tested as part of the UI testing for the Spezi ChatView. ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [X] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Philipp Zagar <zagar@stanford.edu> Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
1 parent
d6819a1
commit dc37b91
Showing
3 changed files
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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