pinecall 0.0.1 → 0.0.2
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 +6 -0
- data/README.md +15 -15
- data/lib/pinecall/serve.rb +1 -1
- data/lib/pinecall/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4205f3b294e177f7c8a8f20cebd3328905325b641ad75cd599b85df123d936bb
|
|
4
|
+
data.tar.gz: 755d0797bdea90ec719041d361dbee4303f94a90397fff5a436fb7bcd3b94aaf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e15725d85b5b9c5c333c117885e7473e357505482beb8b174444832cd553dcb6d5872b98efd97b5b3ee125efb83fc817c1c30801d153c5580e3d546c6ec869d
|
|
7
|
+
data.tar.gz: 739b4d2818d539d9055631e37eb49ea9c9e2f5c68319d4fc73a449f5ede5027d80af84c9246096428f914fed381d51103a3525c7babc2f0f794df4e4b1e27eef
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ version number is the human's call.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.0.2] — A refused registration is a sentence (2026-10-09)
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **A registration the gateway refuses is one sentence and exit 2** from the serve entry — a slug that
|
|
13
|
+
belongs to another org, a key it does not take — instead of a stack trace and exit 1.
|
|
14
|
+
|
|
9
15
|
## [0.0.1] — The first release: an agent as a Ruby class (2026-10-09)
|
|
10
16
|
|
|
11
17
|
### Fixed
|
data/README.md
CHANGED
|
@@ -7,24 +7,24 @@ the part of the prompt that changes during the call.
|
|
|
7
7
|
```ruby
|
|
8
8
|
require "pinecall"
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# You are the front desk of Clínica Norte. Formal, short sentences.
|
|
11
11
|
class ClinicaNorte < Pinecall::Agent
|
|
12
12
|
stage :identify, :book
|
|
13
13
|
state :patient, visibility: :pii
|
|
14
14
|
state :slots, []
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# Finds the patient by name and phone. Ask for both before calling it.
|
|
17
17
|
tool stage: :identify, pii: %i[name phone]
|
|
18
18
|
def find_patient(name:, phone:)
|
|
19
|
-
self.patient = Agenda.
|
|
19
|
+
self.patient = Agenda.find(name, phone)
|
|
20
20
|
self.stage = :book if patient
|
|
21
21
|
patient
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# Free slots on one day.
|
|
25
25
|
tool stage: :book, preview: 2
|
|
26
26
|
def free_slots(day:)
|
|
27
|
-
self.slots = Agenda.
|
|
27
|
+
self.slots = Agenda.free(day)
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
```
|
|
@@ -33,18 +33,18 @@ end
|
|
|
33
33
|
|
|
34
34
|
```erb
|
|
35
35
|
<% if stage == :identify -%>
|
|
36
|
-
|
|
36
|
+
Greet the caller and ask for their name and phone. Nothing else until the patient is identified.
|
|
37
37
|
<% end -%>
|
|
38
38
|
|
|
39
|
-
<% if remembers?("
|
|
40
|
-
|
|
39
|
+
<% if remembers?("usual doctor") -%>
|
|
40
|
+
Offer their usual doctor's slots first.
|
|
41
41
|
<% end -%>
|
|
42
42
|
|
|
43
43
|
<% if slots.any? -%>
|
|
44
|
-
##
|
|
44
|
+
## Free slots, in order
|
|
45
45
|
|
|
46
|
-
<% slots.each do |
|
|
47
|
-
<%=
|
|
46
|
+
<% slots.each do |slot| -%>
|
|
47
|
+
<%= slot.when %> with <%= slot.doctor %>
|
|
48
48
|
<% end -%>
|
|
49
49
|
<% end -%>
|
|
50
50
|
```
|
|
@@ -55,7 +55,7 @@ its text changes.
|
|
|
55
55
|
|
|
56
56
|
Memory and knowledge-base results never enter the prompt. The platform runs `recall` and `search`
|
|
57
57
|
and returns their results to the model as tool results, so retrieved text is treated as data, not
|
|
58
|
-
instructions. A view can ask `remembers?("
|
|
58
|
+
instructions. A view can ask `remembers?("usual doctor")` and write its own sentence about the
|
|
59
59
|
answer.
|
|
60
60
|
|
|
61
61
|
## Five minutes
|
|
@@ -95,7 +95,7 @@ held to the runtime's golden call log. Tools are the only code that may change s
|
|
|
95
95
|
```ruby
|
|
96
96
|
pc = Pinecall::Client.new(url: "https://cloud.pinecall.io", api_key: ENV.fetch("PINECALL_KEY"))
|
|
97
97
|
agent = pc.agent("clinica-norte", tools: [])
|
|
98
|
-
agent.on("turn.user") { |data, call| call.say("
|
|
98
|
+
agent.on("turn.user") { |data, call| call.say("I heard: #{data[:text]}") }
|
|
99
99
|
pc.connect
|
|
100
100
|
```
|
|
101
101
|
|
|
@@ -110,9 +110,9 @@ gateway = Pinecall::Testing::Gateway.new
|
|
|
110
110
|
Pinecall.mount(ClinicaNorte, client: gateway)
|
|
111
111
|
|
|
112
112
|
call = gateway.call_started(from: "+34600123456")
|
|
113
|
-
call.tool("free_slots", day: "
|
|
113
|
+
call.tool("free_slots", day: "Tuesday")
|
|
114
114
|
|
|
115
|
-
assert_includes call.prompt, "
|
|
115
|
+
assert_includes call.prompt, "Tuesday at ten"
|
|
116
116
|
assert_equal %w[propose], call.tools
|
|
117
117
|
```
|
|
118
118
|
|
data/lib/pinecall/serve.rb
CHANGED
data/lib/pinecall/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pinecall
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pinecall
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: websocket-driver
|
|
@@ -96,7 +95,6 @@ metadata:
|
|
|
96
95
|
source_code_uri: https://github.com/pinecall/ruby
|
|
97
96
|
changelog_uri: https://github.com/pinecall/ruby/blob/main/CHANGELOG.md
|
|
98
97
|
rubygems_mfa_required: 'true'
|
|
99
|
-
post_install_message:
|
|
100
98
|
rdoc_options: []
|
|
101
99
|
require_paths:
|
|
102
100
|
- lib
|
|
@@ -111,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
111
109
|
- !ruby/object:Gem::Version
|
|
112
110
|
version: '0'
|
|
113
111
|
requirements: []
|
|
114
|
-
rubygems_version: 3.
|
|
115
|
-
signing_key:
|
|
112
|
+
rubygems_version: 3.6.9
|
|
116
113
|
specification_version: 4
|
|
117
114
|
summary: 'Write a voice agent as a Ruby class: fields are state, tools are verbs,
|
|
118
115
|
the view is the prompt'
|