Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
philippzagar committed Feb 21, 2024
1 parent 8888ab0 commit fed1f0c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Sources/SpeziChat/ChatView+SpeechButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI


/// The underlying `ViewModifier` of `View/speechToolbarButton(enabled:muted:)`.
struct ChatViewSpeechButtonModifier: ViewModifier {
private struct ChatViewSpeechButtonModifier: ViewModifier {
let enabled: Bool
@Binding var muted: Bool

Expand Down
6 changes: 3 additions & 3 deletions Sources/SpeziChat/ChatView+SpeechOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import SpeziSpeechSynthesizer
import SwiftUI


/// The underlying `ViewModifier` of ``ChatView/speak(_:muted:)``.
struct ChatViewSpeechModifier: ViewModifier {
/// The underlying `ViewModifier` of `View/speak(_:muted:)`.
private struct ChatViewSpeechModifier: ViewModifier {
let chat: Chat
let muted: Bool

Expand Down Expand Up @@ -53,7 +53,7 @@ struct ChatViewSpeechModifier: ViewModifier {
}


extension ChatView {
extension View {
/// Provides text-to-speech capabilities to the ``ChatView``.
///
/// Attaching the modifier to a ``ChatView`` will enable the automatic speech output of the latest added ``ChatEntity/Role-swift.enum/assistant`` ``Chat`` message that is ``ChatEntity/complete``.
Expand Down
2 changes: 1 addition & 1 deletion Sources/SpeziChat/ChatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import SwiftUI
///
/// Speech-to-text capabilities can be activated via the `speechToText` `Bool` parameter in ``init(_:disableInput:speechToText:exportFormat:messagePlaceholder:messagePendingAnimation:)``. By default, this capability is activated and therefore a small microphone button is shown next to the text input field.
///
/// Text-to-speech capabilities can be configured via the ``ChatView/speak(_:muted:)`` `ViewModifier`. If present, the latest ``ChatEntity/complete`` ``ChatEntity/Role-swift.enum/assistant`` message in the ``Chat`` will be synthesized to natural language speech.
/// Text-to-speech capabilities can be configured via the `View/speak(_:muted:)` `ViewModifier`. If present, the latest ``ChatEntity/complete`` ``ChatEntity/Role-swift.enum/assistant`` message in the ``Chat`` will be synthesized to natural language speech.
/// In addition, the `View/speechToolbarButton(enabled:muted:)` `ViewModifier` automatically adds a toolbar `Button` to mute or unmute the speech synthesizer, if not disabled via the `enabled` parameter.
/// The `muted` flag enables to track the state of the `Button` or adjust it from the outside.
///
Expand Down
4 changes: 0 additions & 4 deletions Sources/SpeziChat/SpeziChat.docc/SpeziChat.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,3 @@ struct MessageInputTestView: View {

- ``MessageInputView``
- ``MessageInputViewHeightKey``

### Accessibility

- ``ChatView/speak(_:muted:)``

0 comments on commit fed1f0c

Please sign in to comment.