kaicalls 0.1.0__tar.gz
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.
- kaicalls-0.1.0/.gitignore +116 -0
- kaicalls-0.1.0/PKG-INFO +118 -0
- kaicalls-0.1.0/README.md +94 -0
- kaicalls-0.1.0/kaicalls/__init__.py +18 -0
- kaicalls-0.1.0/kaicalls/client.py +888 -0
- kaicalls-0.1.0/pyproject.toml +34 -0
- kaicalls-0.1.0/tests/test_client.py +196 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.*
|
|
7
|
+
.yarn/*
|
|
8
|
+
!.yarn/patches
|
|
9
|
+
!.yarn/plugins
|
|
10
|
+
!.yarn/releases
|
|
11
|
+
!.yarn/versions
|
|
12
|
+
|
|
13
|
+
# testing
|
|
14
|
+
/coverage
|
|
15
|
+
|
|
16
|
+
# next.js
|
|
17
|
+
/.next/
|
|
18
|
+
/out/
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
*.pem
|
|
26
|
+
|
|
27
|
+
# debug
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
yarn-debug.log*
|
|
30
|
+
yarn-error.log*
|
|
31
|
+
.pnpm-debug.log*
|
|
32
|
+
|
|
33
|
+
# env files (can opt-in for committing if needed)
|
|
34
|
+
.env*
|
|
35
|
+
.env.sentry-build-plugin
|
|
36
|
+
|
|
37
|
+
# vercel
|
|
38
|
+
.vercel
|
|
39
|
+
|
|
40
|
+
# typescript
|
|
41
|
+
*.tsbuildinfo
|
|
42
|
+
next-env.d.ts
|
|
43
|
+
src/mcp-tools/node_modules
|
|
44
|
+
scripts/node_modules
|
|
45
|
+
workspace/**/node_modules
|
|
46
|
+
# Google service account credentials
|
|
47
|
+
client_secret*.json
|
|
48
|
+
client_secret_1036960304490-6hju14mbs0bahbdteek1pl22ba47lc08.apps.googleusercontent.com.json
|
|
49
|
+
|
|
50
|
+
# Voice/audio service credentials
|
|
51
|
+
vocalscribe-*.json
|
|
52
|
+
|
|
53
|
+
# misc
|
|
54
|
+
/Voice Calls BBB/
|
|
55
|
+
|
|
56
|
+
# API keys
|
|
57
|
+
scripts/.bbb-api-key
|
|
58
|
+
|
|
59
|
+
# Temp files
|
|
60
|
+
logs/
|
|
61
|
+
*.zip
|
|
62
|
+
call-logs-*.json
|
|
63
|
+
settings.json
|
|
64
|
+
|
|
65
|
+
# Remotion projects
|
|
66
|
+
remotion-projects/
|
|
67
|
+
/remotion-projects/*
|
|
68
|
+
|
|
69
|
+
# Cleanup staging
|
|
70
|
+
_delete/
|
|
71
|
+
nul
|
|
72
|
+
.claude/worktrees/
|
|
73
|
+
|
|
74
|
+
# Video files in workspace (store locally, don't push to git)
|
|
75
|
+
workspace/**/*.mp4
|
|
76
|
+
workspace/**/*.mov
|
|
77
|
+
workspace/**/*.avi
|
|
78
|
+
workspace/**/*.mkv
|
|
79
|
+
workspace/**/*.webm
|
|
80
|
+
workspace/**/*.wmv
|
|
81
|
+
|
|
82
|
+
# Rincón client work — local-only, do not commit
|
|
83
|
+
scripts/one-off/*rincon*
|
|
84
|
+
scripts/one-off/rincon*
|
|
85
|
+
.planning/rincon-*/
|
|
86
|
+
|
|
87
|
+
# Local scratch data dumps
|
|
88
|
+
tmp_*.json
|
|
89
|
+
/tmp/
|
|
90
|
+
/lighthouse-result.json
|
|
91
|
+
/abp_calls.json
|
|
92
|
+
/agent_patch.json
|
|
93
|
+
/steph_calls_raw.json
|
|
94
|
+
/_audit_out/
|
|
95
|
+
/.codex-tmp/
|
|
96
|
+
/.tmp-audit/
|
|
97
|
+
/.tmp-lead-audit/
|
|
98
|
+
/scripts/one-off/_audit_out/
|
|
99
|
+
|
|
100
|
+
# Claude Code runtime state
|
|
101
|
+
.claude/scheduled_tasks.lock
|
|
102
|
+
.claude/tmp/
|
|
103
|
+
.claude/settings.local.json
|
|
104
|
+
|
|
105
|
+
# Per-client scratch data (workspace/daily-errors is tracked, see exclusion below)
|
|
106
|
+
workspace/clients/
|
|
107
|
+
|
|
108
|
+
# Python cache
|
|
109
|
+
__pycache__/
|
|
110
|
+
|
|
111
|
+
# SDK build artifacts
|
|
112
|
+
sdk/typescript/node_modules/
|
|
113
|
+
sdk/typescript/dist/
|
|
114
|
+
sdk/python/dist/
|
|
115
|
+
sdk/python/*.egg-info/
|
|
116
|
+
sdk/python/**/__pycache__/
|
kaicalls-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kaicalls
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official KaiCalls SDK — give your AI agent a phone. Outbound calls, agents, leads, SMS, transcripts, and webhooks.
|
|
5
|
+
Project-URL: Homepage, https://www.kaicalls.com
|
|
6
|
+
Project-URL: Documentation, https://www.kaicalls.com/docs/api
|
|
7
|
+
Project-URL: Repository, https://github.com/cgallic/kai_calls
|
|
8
|
+
Author-email: KaiCalls <support@kaicalls.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: ai,calls,kaicalls,phone,receptionist,sms,voice
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Communications :: Telephony
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Requires-Dist: requests>=2.25
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# kaicalls
|
|
26
|
+
|
|
27
|
+
Official Python SDK for the [KaiCalls](https://www.kaicalls.com) API — give your AI agent a phone. Outbound calls, agents, leads, SMS, transcripts, webhooks, and platform APIs.
|
|
28
|
+
|
|
29
|
+
- Python 3.9+, one dependency (`requests`)
|
|
30
|
+
- Docs: <https://www.kaicalls.com/docs/api> · Live OpenAPI: `GET /api/v1/openapi.json`
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install kaicalls
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from kaicalls import KaiCalls
|
|
42
|
+
|
|
43
|
+
kai = KaiCalls(api_key="kc_live_...")
|
|
44
|
+
|
|
45
|
+
# Make an outbound call — the agent auto-enriches with CRM context
|
|
46
|
+
call = kai.calls.create(
|
|
47
|
+
agent_id="uuid-abc123",
|
|
48
|
+
to="+15125551234",
|
|
49
|
+
name="John Smith",
|
|
50
|
+
context="Following up on his kitchen remodel inquiry",
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# Block until the call finishes, then read the AI summary
|
|
54
|
+
result = kai.calls.wait(call.id)
|
|
55
|
+
print(result.summary)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Responses support attribute access (`call.id`, `result.summary`, `call.quality_dimensions.empathy`) and behave like dicts.
|
|
59
|
+
|
|
60
|
+
## No account yet? Sign up via the API
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from kaicalls import KaiCalls, signup
|
|
64
|
+
|
|
65
|
+
account = signup(
|
|
66
|
+
business_name="Smith Law Firm",
|
|
67
|
+
email="contact@smithlaw.com",
|
|
68
|
+
plan_id="starter",
|
|
69
|
+
)
|
|
70
|
+
# account.api_key works immediately; send the owner to account.checkout_url
|
|
71
|
+
kai = KaiCalls(api_key=account.api_key)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## What's wrapped
|
|
75
|
+
|
|
76
|
+
| Resource | Methods |
|
|
77
|
+
|----------|---------|
|
|
78
|
+
| `kai.calls` | `create`, `get`, `list`, `wait` |
|
|
79
|
+
| `kai.recordings` | `get` |
|
|
80
|
+
| `kai.agents` | `list`, `get`, `create`, `update`, `versions` |
|
|
81
|
+
| `kai.leads` | `list`, `get`, `create`, `update`, `audit` |
|
|
82
|
+
| `kai.sms` | `send`, `update_prompt`, `conversations`, `messages` |
|
|
83
|
+
| `kai.transcripts` | `list` |
|
|
84
|
+
| `kai.phone_numbers` | `list`, `available`, `assign`, `release` |
|
|
85
|
+
| `kai.workspaces` | `list`, `get`, `create`, `update` (lifecycle actions) |
|
|
86
|
+
| `kai.webhooks` | `list`, `create`, `delete`, `test`, `rotate_secret` |
|
|
87
|
+
| `kai.analytics` | `dashboard`, `calls`, `funnel`, `agents`, `weekly`, `businesses` |
|
|
88
|
+
| `kai.evals` | `create`, `list`, `get`, `update`, `delete`, `run`, `get_run` |
|
|
89
|
+
| `kai.events` | `list`, `deliveries`, `replay`, `backfill` |
|
|
90
|
+
| `kai.communication_runs` | `validate`, `preview`, `create`, `list`, `pause`, `cancel`, `jobs`, `attempts` |
|
|
91
|
+
| `kai.discovery` | `capabilities`, `openapi`, `schemas`, `health` |
|
|
92
|
+
| `kai.account` | `balance`, `usage` |
|
|
93
|
+
|
|
94
|
+
Anything not wrapped yet is reachable through the escape hatch:
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
kai.request("GET", "/api/sdr/pipeline", query={"businessId": "uuid-biz"})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Errors
|
|
101
|
+
|
|
102
|
+
All non-2xx responses raise `KaiCallsError` with `.status`, `.code` (e.g. `unauthorized`, `forbidden`, `rate_limited`), and `.body`.
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from kaicalls import KaiCallsError
|
|
106
|
+
|
|
107
|
+
try:
|
|
108
|
+
kai.calls.create(agent_id=agent_id, to=to)
|
|
109
|
+
except KaiCallsError as err:
|
|
110
|
+
if err.code == "rate_limited":
|
|
111
|
+
... # back off and retry
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Notes
|
|
115
|
+
|
|
116
|
+
- Get an API key at <https://www.kaicalls.com/dashboard/settings/api>. New keys default to read-only scopes — request write scopes (`calls:write`, `sms:write`, …) when creating the key.
|
|
117
|
+
- Phone numbers are E.164 (`+15125551234`).
|
|
118
|
+
- API reference: <https://www.kaicalls.com/docs/api> · Errors: <https://www.kaicalls.com/docs/api/errors>
|
kaicalls-0.1.0/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# kaicalls
|
|
2
|
+
|
|
3
|
+
Official Python SDK for the [KaiCalls](https://www.kaicalls.com) API — give your AI agent a phone. Outbound calls, agents, leads, SMS, transcripts, webhooks, and platform APIs.
|
|
4
|
+
|
|
5
|
+
- Python 3.9+, one dependency (`requests`)
|
|
6
|
+
- Docs: <https://www.kaicalls.com/docs/api> · Live OpenAPI: `GET /api/v1/openapi.json`
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install kaicalls
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from kaicalls import KaiCalls
|
|
18
|
+
|
|
19
|
+
kai = KaiCalls(api_key="kc_live_...")
|
|
20
|
+
|
|
21
|
+
# Make an outbound call — the agent auto-enriches with CRM context
|
|
22
|
+
call = kai.calls.create(
|
|
23
|
+
agent_id="uuid-abc123",
|
|
24
|
+
to="+15125551234",
|
|
25
|
+
name="John Smith",
|
|
26
|
+
context="Following up on his kitchen remodel inquiry",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Block until the call finishes, then read the AI summary
|
|
30
|
+
result = kai.calls.wait(call.id)
|
|
31
|
+
print(result.summary)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Responses support attribute access (`call.id`, `result.summary`, `call.quality_dimensions.empathy`) and behave like dicts.
|
|
35
|
+
|
|
36
|
+
## No account yet? Sign up via the API
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from kaicalls import KaiCalls, signup
|
|
40
|
+
|
|
41
|
+
account = signup(
|
|
42
|
+
business_name="Smith Law Firm",
|
|
43
|
+
email="contact@smithlaw.com",
|
|
44
|
+
plan_id="starter",
|
|
45
|
+
)
|
|
46
|
+
# account.api_key works immediately; send the owner to account.checkout_url
|
|
47
|
+
kai = KaiCalls(api_key=account.api_key)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## What's wrapped
|
|
51
|
+
|
|
52
|
+
| Resource | Methods |
|
|
53
|
+
|----------|---------|
|
|
54
|
+
| `kai.calls` | `create`, `get`, `list`, `wait` |
|
|
55
|
+
| `kai.recordings` | `get` |
|
|
56
|
+
| `kai.agents` | `list`, `get`, `create`, `update`, `versions` |
|
|
57
|
+
| `kai.leads` | `list`, `get`, `create`, `update`, `audit` |
|
|
58
|
+
| `kai.sms` | `send`, `update_prompt`, `conversations`, `messages` |
|
|
59
|
+
| `kai.transcripts` | `list` |
|
|
60
|
+
| `kai.phone_numbers` | `list`, `available`, `assign`, `release` |
|
|
61
|
+
| `kai.workspaces` | `list`, `get`, `create`, `update` (lifecycle actions) |
|
|
62
|
+
| `kai.webhooks` | `list`, `create`, `delete`, `test`, `rotate_secret` |
|
|
63
|
+
| `kai.analytics` | `dashboard`, `calls`, `funnel`, `agents`, `weekly`, `businesses` |
|
|
64
|
+
| `kai.evals` | `create`, `list`, `get`, `update`, `delete`, `run`, `get_run` |
|
|
65
|
+
| `kai.events` | `list`, `deliveries`, `replay`, `backfill` |
|
|
66
|
+
| `kai.communication_runs` | `validate`, `preview`, `create`, `list`, `pause`, `cancel`, `jobs`, `attempts` |
|
|
67
|
+
| `kai.discovery` | `capabilities`, `openapi`, `schemas`, `health` |
|
|
68
|
+
| `kai.account` | `balance`, `usage` |
|
|
69
|
+
|
|
70
|
+
Anything not wrapped yet is reachable through the escape hatch:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
kai.request("GET", "/api/sdr/pipeline", query={"businessId": "uuid-biz"})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Errors
|
|
77
|
+
|
|
78
|
+
All non-2xx responses raise `KaiCallsError` with `.status`, `.code` (e.g. `unauthorized`, `forbidden`, `rate_limited`), and `.body`.
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from kaicalls import KaiCallsError
|
|
82
|
+
|
|
83
|
+
try:
|
|
84
|
+
kai.calls.create(agent_id=agent_id, to=to)
|
|
85
|
+
except KaiCallsError as err:
|
|
86
|
+
if err.code == "rate_limited":
|
|
87
|
+
... # back off and retry
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Notes
|
|
91
|
+
|
|
92
|
+
- Get an API key at <https://www.kaicalls.com/dashboard/settings/api>. New keys default to read-only scopes — request write scopes (`calls:write`, `sms:write`, …) when creating the key.
|
|
93
|
+
- Phone numbers are E.164 (`+15125551234`).
|
|
94
|
+
- API reference: <https://www.kaicalls.com/docs/api> · Errors: <https://www.kaicalls.com/docs/api/errors>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Official KaiCalls SDK — give your AI agent a phone.
|
|
2
|
+
|
|
3
|
+
Usage::
|
|
4
|
+
|
|
5
|
+
from kaicalls import KaiCalls
|
|
6
|
+
|
|
7
|
+
kai = KaiCalls(api_key="kc_live_...")
|
|
8
|
+
call = kai.calls.create(agent_id="uuid-abc123", to="+15125551234", name="John Smith")
|
|
9
|
+
result = kai.calls.wait(call.id)
|
|
10
|
+
print(result.summary)
|
|
11
|
+
|
|
12
|
+
Docs: https://www.kaicalls.com/docs/api
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from .client import KaiCalls, KaiCallsError, KaiObject, signup
|
|
16
|
+
|
|
17
|
+
__all__ = ["KaiCalls", "KaiCallsError", "KaiObject", "signup"]
|
|
18
|
+
__version__ = "0.1.0"
|