lex-microsoft_teams 0.6.15 → 0.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ad20d81a8d2c2a597d2415f896f8ae4c8209efde74efd99fd0c1b630cc2ce60
|
|
4
|
+
data.tar.gz: 44d7b8e2d0831df8116a44379096f9264d6d27302d8787fdc97a9652762f5c3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6d66af6d00faed231e1d889e60f906f22f03a79ff9ebced10745fd41cb0a260929f1fb25222e39a6a6c0705414799e768a36ab1f163cdf7c67980654c3ccbb7
|
|
7
|
+
data.tar.gz: 54fe1f02a29d2edb885bec85f56c94173b7857815d01532299fb05e985535eace1237a9322bc54a0752efdb68213e2e7701d27fecbd765f6bb250b4ae4361216
|
data/CHANGELOG.md
CHANGED
|
@@ -118,7 +118,7 @@ module Legion
|
|
|
118
118
|
def observe_message(chat_id:, owner_id:, text:, from:, peer_name:, timestamp: nil, **)
|
|
119
119
|
return { result: :skipped, reason: :observe_disabled } unless observe_enabled?
|
|
120
120
|
|
|
121
|
-
extraction = extract_from_message(text: text, from: from, peer_name: peer_name)
|
|
121
|
+
extraction = extract_from_message(text: text, from: from, peer_name: peer_name, owner_id: owner_id)
|
|
122
122
|
|
|
123
123
|
store_observation(
|
|
124
124
|
chat_id: chat_id, owner_id: owner_id, text: text,
|
|
@@ -178,7 +178,8 @@ module Legion
|
|
|
178
178
|
text,
|
|
179
179
|
instructions: session[:system_prompt],
|
|
180
180
|
model: config[:model],
|
|
181
|
-
intent: config[:intent]
|
|
181
|
+
intent: config[:intent],
|
|
182
|
+
caller: { id: session[:owner_id], extension: 'lex-microsoft_teams', mode: :bot_response }
|
|
182
183
|
)
|
|
183
184
|
response.content
|
|
184
185
|
rescue StandardError => e
|
|
@@ -219,13 +220,13 @@ module Legion
|
|
|
219
220
|
Legion::Settings.dig(:microsoft_teams, :bot, :observe, :notify) == true
|
|
220
221
|
end
|
|
221
222
|
|
|
222
|
-
def extract_from_message(text:, from:, peer_name:)
|
|
223
|
+
def extract_from_message(text:, from:, peer_name:, owner_id: nil)
|
|
223
224
|
return nil unless llm_available?
|
|
224
225
|
|
|
225
226
|
prompt = resolve_prompt(mode: :observe, conversation_id: nil)
|
|
226
227
|
context = "#{from[:name] || peer_name} said: #{text}"
|
|
227
228
|
|
|
228
|
-
response = llm_chat(context, instructions: prompt)
|
|
229
|
+
response = llm_chat(context, instructions: prompt, caller: { id: owner_id, extension: 'lex-microsoft_teams', mode: :observe })
|
|
229
230
|
parse_extraction(response.content)
|
|
230
231
|
rescue StandardError => e
|
|
231
232
|
log.error("Observation extraction failed: #{e.message}")
|
|
@@ -229,7 +229,8 @@ module Legion
|
|
|
229
229
|
result = client.transform(text: text, **definition)
|
|
230
230
|
result[:result] || result[:error] ? nil : result
|
|
231
231
|
elsif defined?(Legion::LLM)
|
|
232
|
-
Legion::LLM.ask(prompt: "#{definition[:prompt]}\n\nConversation with #{peer_name}:\n#{text}"
|
|
232
|
+
Legion::LLM.ask(prompt: "#{definition[:prompt]}\n\nConversation with #{peer_name}:\n#{text}",
|
|
233
|
+
caller: { extension: 'lex-microsoft_teams', runner: 'profile_ingest' })
|
|
233
234
|
end
|
|
234
235
|
rescue StandardError => e
|
|
235
236
|
log.debug("ProfileIngest: extract_conversation failed: #{e.message}")
|