pinecall 0.11.46 → 0.11.48
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/pinecall/agent/config.rb +2 -1
- data/lib/pinecall/blocks.rb +3 -2
- data/lib/pinecall/rules.rb +15 -5
- data/lib/pinecall/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a6e873d8b10a615c2e5d2af74900c534f839d0fd73e7cd11ccb927351382b55b
|
|
4
|
+
data.tar.gz: df1f20f55172935a3157dfbd53a47ad20e8239438ab17c46010a57b319895930
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 360dee83b0723d337e897761326b684d150104439416abf5647675ce0aa6d2d30d839309f8a0a78d99144e9107c17fe476a9b2252d03a86b6c45ca92e8764af5
|
|
7
|
+
data.tar.gz: 32429f80b5646f49906ae1c6ada19f78f7eb27b23788b4a5af2e8def9cba487b4742034708b8e2e38f92d9b4a22c13149ee93c1d167d875809ad25f709f4093b
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ Every change a person using this gem would notice. The format is
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version numbers and tags are the
|
|
5
5
|
maintainer's call.
|
|
6
6
|
|
|
7
|
+
## [0.11.48] — an agent writes first by SMS, and a person's message on a thread reaches the contact (2026-11-18)
|
|
8
|
+
|
|
9
|
+
- Released with the runtime: nothing of this package changed.
|
|
10
|
+
|
|
11
|
+
## [0.11.47] — an agent says the languages its callers speak, a channel takes the agent's own words, and a stop word ends the conversation on any gateway (2026-11-18)
|
|
12
|
+
|
|
13
|
+
- **`channel_rules` takes the agent's own words for a channel.** `channel_rules whatsapp: "…"` says how the
|
|
14
|
+
agent writes there in place of the framework's own way, and every channel it leaves out keeps the
|
|
15
|
+
framework's (`voice`, `chat`, `whatsapp`, `sms`); `channel_rules false` still leaves the block out on every
|
|
16
|
+
channel. `Pinecall::Rules::CHANNEL_RULES` is the framework's own text by those names.
|
|
17
|
+
|
|
7
18
|
## [0.11.46] — a contact who texts STOP is written to no more, a written conversation opens on the one before, and the audio of an MMS is heard (2026-11-18)
|
|
8
19
|
|
|
9
20
|
- **`optOut` on a WhatsApp or SMS conversation**, and `call.summary` says an SMS conversation's `sms_segments`.
|
|
@@ -9,7 +9,8 @@ module Pinecall
|
|
|
9
9
|
# agent's settings for that field.
|
|
10
10
|
module Config
|
|
11
11
|
# `phone`, `whatsapp` and `web` are accepted for compatibility but ignored. `channel_rules
|
|
12
|
-
#
|
|
12
|
+
# whatsapp: "…"` says the agent's own words for that channel, and `channel_rules false` leaves the
|
|
13
|
+
# `<channel>` block out of the prompt.
|
|
13
14
|
AS_WRITTEN = %i[phone whatsapp web channel_rules].freeze
|
|
14
15
|
|
|
15
16
|
# The settings a class may declare. Must match the TypeScript package's `ENVIRONMENT`.
|
data/lib/pinecall/blocks.rb
CHANGED
|
@@ -92,10 +92,11 @@ module Pinecall
|
|
|
92
92
|
# Static because a call never changes its channel or medium. With no call (an offline prompt), a
|
|
93
93
|
# phone call's.
|
|
94
94
|
def channel(agent)
|
|
95
|
-
|
|
95
|
+
own = agent.class.channel_rules
|
|
96
|
+
return nil if own == false
|
|
96
97
|
|
|
97
98
|
call = agent.call? ? agent.call : nil
|
|
98
|
-
tagged("channel", Rules.channel_rules_for(call&.channel || "phone", call&.medium || "voice"))
|
|
99
|
+
tagged("channel", Rules.channel_rules_for(call&.channel || "phone", call&.medium || "voice", own.is_a?(Hash) ? own : {}))
|
|
99
100
|
end
|
|
100
101
|
|
|
101
102
|
# Every declared tool's docstring, visible or not; schemas travel separately on the wire.
|
data/lib/pinecall/rules.rb
CHANGED
|
@@ -30,14 +30,24 @@ module Pinecall
|
|
|
30
30
|
ON_SMS = "You are answering by SMS. Plain text only: no markdown, no lists, no emoji unless the person uses " \
|
|
31
31
|
"them. One short message, a few sentences at most."
|
|
32
32
|
|
|
33
|
+
# The framework's own rules, by the name an agent writes its own under: a spoken call, a website's
|
|
34
|
+
# written chat, WhatsApp, SMS.
|
|
35
|
+
CHANNEL_RULES = { voice: SPOKEN, chat: ON_A_WEBSITE, whatsapp: ON_WHATSAPP, sms: ON_SMS }.freeze
|
|
36
|
+
|
|
33
37
|
module_function
|
|
34
38
|
|
|
35
|
-
#
|
|
36
|
-
def
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
+
# The name a channel's rules are written under: `whatsapp`, `sms`, a website's `chat`, else `voice`.
|
|
40
|
+
def channel_name_of(channel, medium)
|
|
41
|
+
return channel.to_sym if %w[whatsapp sms].include?(channel.to_s)
|
|
42
|
+
|
|
43
|
+
channel.to_s == "web" && medium.to_s == "text" ? :chat : :voice
|
|
44
|
+
end
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
# How to write on this channel and medium: the agent's own words for it, else WhatsApp's formatting,
|
|
47
|
+
# a website's Markdown, or speech.
|
|
48
|
+
def channel_rules_for(channel, medium, own = {})
|
|
49
|
+
name = channel_name_of(channel, medium)
|
|
50
|
+
own.transform_keys(&:to_sym).fetch(name, CHANNEL_RULES.fetch(name))
|
|
41
51
|
end
|
|
42
52
|
end
|
|
43
53
|
end
|
data/lib/pinecall/version.rb
CHANGED