Module: Legion::Extensions::Agentic::Language::InnerSpeech::Runners::InnerSpeech
- Includes:
- Helpers::Constants, Helpers::Lex
- Included in:
- Client
- Defined in:
- lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb
Constant Summary
Helpers::Constants::AUTOMATIC_SPEED, Helpers::Constants::CONDENSATION_RATIO, Helpers::Constants::CONTROLLED_SPEED, Helpers::Constants::EGOCENTRIC_SPEED, Helpers::Constants::MAX_HISTORY, Helpers::Constants::MAX_STREAM_LENGTH, Helpers::Constants::MAX_UTTERANCES, Helpers::Constants::RUMINATION_THRESHOLD, Helpers::Constants::SALIENCE_DECAY, Helpers::Constants::SALIENCE_FLOOR, Helpers::Constants::SPEECH_MODES, Helpers::Constants::URGENCY_LABELS, Helpers::Constants::VOICE_TYPES
Instance Method Summary
collapse
Instance Method Details
#break_inner_rumination(redirect_topic: :general) ⇒ Object
53
54
55
56
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 53
def break_inner_rumination(redirect_topic: :general, **)
result = voice.break_rumination(redirect_topic: redirect_topic)
{ success: true, rumination_broken: result }
end
|
#inner_debate(content_a:, content_b:, topic: :general) ⇒ Object
34
35
36
37
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 34
def inner_debate(content_a:, content_b:, topic: :general, **)
results = voice.debate(content_a: content_a, content_b: content_b, topic: topic)
{ success: true, utterances: results.map(&:id), count: results.size }
end
|
#inner_interrupt(content:) ⇒ Object
46
47
48
49
50
51
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 46
def inner_interrupt(content:, **)
utterance = voice.interrupt(content: content)
return { success: false, reason: :stream_full } unless utterance
{ success: true, utterance_id: utterance.id }
end
|
#inner_narrative ⇒ Object
63
64
65
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 63
def inner_narrative(**)
{ success: true, narrative: voice.narrative, condensed: voice.condensed_narrative }
end
|
#inner_plan(content:, topic: :general) ⇒ Object
20
21
22
23
24
25
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 20
def inner_plan(content:, topic: :general, **)
utterance = voice.plan(content: content, topic: topic)
return { success: false, reason: :stream_full } unless utterance
{ success: true, utterance_id: utterance.id }
end
|
#inner_question(content:, topic: :general) ⇒ Object
27
28
29
30
31
32
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 27
def inner_question(content:, topic: :general, **)
utterance = voice.question(content: content, topic: topic)
return { success: false, reason: :stream_full } unless utterance
{ success: true, utterance_id: utterance.id }
end
|
#inner_speak(content:, mode: :narrating, topic: :general) ⇒ Object
13
14
15
16
17
18
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 13
def inner_speak(content:, mode: :narrating, topic: :general, **)
utterance = voice.speak(content: content, mode: mode, topic: topic)
return { success: false, reason: :stream_full } unless utterance
{ success: true, utterance_id: utterance.id, mode: utterance.mode }
end
|
#inner_speech_stats ⇒ Object
72
73
74
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 72
def inner_speech_stats(**)
{ success: true }.merge(voice.to_h)
end
|
#recent_inner_speech(count: 5) ⇒ Object
58
59
60
61
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 58
def recent_inner_speech(count: 5, **)
speech = voice.recent_speech(count: count)
{ success: true, utterances: speech, count: speech.size }
end
|
#switch_inner_voice(voice_type:) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 39
def switch_inner_voice(voice_type:, **)
result = voice.switch_voice(voice: voice_type)
return { success: false, reason: :invalid_voice } unless result
{ success: true, active_voice: result }
end
|
#update_inner_speech ⇒ Object
67
68
69
70
|
# File 'lib/legion/extensions/agentic/language/inner_speech/runners/inner_speech.rb', line 67
def update_inner_speech(**)
result = voice.tick
{ success: true }.merge(result)
end
|