Module: OllamaChat::Switches
- Included in:
- Chat
- Defined in:
- lib/ollama_chat/switches.rb
Defined Under Namespace
Modules: CheckSwitch Classes: CombinedSwitch, Switch
Instance Attribute Summary collapse
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
-
#embedding_enabled ⇒ Object
readonly
Returns the value of attribute embedding_enabled.
-
#embedding_paused ⇒ Object
readonly
Returns the value of attribute embedding_paused.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#markdown ⇒ Object
readonly
Returns the value of attribute markdown.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#think ⇒ Object
readonly
Returns the value of attribute think.
-
#voice ⇒ Object
readonly
Returns the value of attribute voice.
Instance Method Summary collapse
Instance Attribute Details
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
60 61 62 |
# File 'lib/ollama_chat/switches.rb', line 60 def @embedding end |
#embedding_enabled ⇒ Object (readonly)
Returns the value of attribute embedding_enabled.
62 63 64 |
# File 'lib/ollama_chat/switches.rb', line 62 def @embedding_enabled end |
#embedding_paused ⇒ Object (readonly)
Returns the value of attribute embedding_paused.
64 65 66 |
# File 'lib/ollama_chat/switches.rb', line 64 def @embedding_paused end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
66 67 68 |
# File 'lib/ollama_chat/switches.rb', line 66 def location @location end |
#markdown ⇒ Object (readonly)
Returns the value of attribute markdown.
56 57 58 |
# File 'lib/ollama_chat/switches.rb', line 56 def markdown @markdown end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
52 53 54 |
# File 'lib/ollama_chat/switches.rb', line 52 def stream @stream end |
#think ⇒ Object (readonly)
Returns the value of attribute think.
54 55 56 |
# File 'lib/ollama_chat/switches.rb', line 54 def think @think end |
#voice ⇒ Object (readonly)
Returns the value of attribute voice.
58 59 60 |
# File 'lib/ollama_chat/switches.rb', line 58 def voice @voice end |
Instance Method Details
#setup_switches(config) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/ollama_chat/switches.rb', line 68 def setup_switches(config) @stream = Switch.new( :stream, config:, msg: { true => "Streaming enabled.", false => "Streaming disabled.", } ) @think = Switch.new( :think, config:, msg: { true => "Thinking enabled.", false => "Thinking disabled.", } ) @markdown = Switch.new( :markdown, config:, msg: { true => "Using #{italic{'ANSI'}} markdown to output content.", false => "Using plaintext for outputting content.", } ) @voice = Switch.new( :stream, config: config.voice, msg: { true => "Voice output enabled.", false => "Voice output disabled.", } ) @embedding_enabled = Switch.new( :embedding_enabled, config:, msg: { true => "Embedding enabled.", false => "Embedding disabled.", } ) @embedding_paused = Switch.new( :embedding_paused, config:, msg: { true => "Embedding paused.", false => "Embedding resumed.", } ) @embedding = CombinedSwitch.new( value: -> { @embedding_enabled.on? && @embedding_paused.off? }, msg: { true => "Embedding is currently performed.", false => "Embedding is currently not performed.", } ) @location = Switch.new( :location, config: config.location.enabled, msg: { true => "Location and localtime enabled.", false => "Location and localtime disabled.", } ) end |