Skip to content

Commit d6dd282

Browse files
committed
Checking in
1 parent ec2109f commit d6dd282

File tree

2 files changed

+90
-7
lines changed

2 files changed

+90
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vapi Python SDK
22

3-
This package lets you start Vapi calls directly in your Python application. Currently supports Linux with PulseAudio.
3+
This package lets you start Vapi calls directly in your Python application.
44

55
## Installation
66

README.rst

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,101 @@ Vapi Python SDK
1414
:alt: Documentation Status
1515

1616

17+
This package lets you start Vapi calls directly from Python.
1718

19+
Installation
20+
------------
1821

19-
This package lets you start Vapi calls directly from Python.
22+
You can install the package via pip:
23+
24+
.. code-block:: bash
25+
26+
pip install vapi_python
27+
28+
Usage
29+
-----
30+
31+
First, import the Vapi class from the package:
32+
33+
.. code-block:: python
34+
35+
from vapi_python import Vapi
36+
37+
Then, create a new instance of the Vapi class, passing your API Key as a parameter to the constructor:
38+
39+
.. code-block:: python
40+
41+
vapi = Vapi(api_key='your-api-key')
42+
43+
You can start a new call by calling the `start` method and passing an `assistant` object or `assistantId`. You can find the available options here: `docs.vapi.ai <https://docs.vapi.ai/api-reference/assistants/create-assistant>`
44+
45+
.. code-block:: python
2046
47+
vapi.start(assistant_id='your-assistant-id')
2148
22-
* Free software: MIT license
23-
* Documentation: https://vapi-python.readthedocs.io.
49+
or
2450

51+
.. code-block:: python
2552
26-
Features
27-
--------
53+
assistant = {
54+
'firstMessage': 'Hey, how are you?',
55+
'context': 'You are a shopping assistant...',
56+
'model': 'gpt-3.5-turbo',
57+
'voice': 'jennifer-playht',
58+
"recordingEnabled": True,
59+
"interruptionsEnabled": False,
60+
"functions": [
61+
{
62+
"name": "setColor",
63+
"description": "Used to set the color",
64+
"parameters": {
65+
"type": "object",
66+
"properties": {
67+
"color": {
68+
"type": "string"
69+
}
70+
}
71+
}
72+
}
73+
]
74+
}
2875
29-
* TODO
76+
vapi.start(assistant=assistant)
77+
78+
The `start` method will initiate a new call.
79+
80+
You can stop the session by calling the `stop` method:
81+
82+
.. code-block:: python
83+
84+
vapi.stop()
85+
86+
This will stop the recording and close the connection.
87+
88+
License
89+
-------
90+
91+
MIT License
92+
93+
Copyright (c) 2023 Vapi Labs Inc.
94+
95+
Permission is hereby granted, free of charge, to any person obtaining a copy
96+
of this software and associated documentation files (the "Software"), to deal
97+
in the Software without restriction, including without limitation the rights
98+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99+
copies of the Software, and to permit persons to whom the Software is
100+
furnished to do so, subject to the following conditions:
101+
102+
The above copyright notice and this permission notice shall be included in all
103+
copies or substantial portions of the Software.
104+
105+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
106+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
107+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
108+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
109+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
110+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111+
SOFTWARE.
30112

31113
Credits
32114
-------
@@ -35,3 +117,4 @@ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypack
35117

36118
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
37119
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
120+

0 commit comments

Comments
 (0)