openvip 1.0.0rc1__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.
Files changed (44) hide show
  1. openvip-1.0.0rc1/PKG-INFO +172 -0
  2. openvip-1.0.0rc1/README.md +144 -0
  3. openvip-1.0.0rc1/openvip/__init__.py +76 -0
  4. openvip-1.0.0rc1/openvip/api/__init__.py +8 -0
  5. openvip-1.0.0rc1/openvip/api/control_api.py +312 -0
  6. openvip-1.0.0rc1/openvip/api/messages_api.py +596 -0
  7. openvip-1.0.0rc1/openvip/api/speech_api.py +312 -0
  8. openvip-1.0.0rc1/openvip/api/status_api.py +526 -0
  9. openvip-1.0.0rc1/openvip/api_client.py +805 -0
  10. openvip-1.0.0rc1/openvip/api_response.py +21 -0
  11. openvip-1.0.0rc1/openvip/client.py +373 -0
  12. openvip-1.0.0rc1/openvip/configuration.py +596 -0
  13. openvip-1.0.0rc1/openvip/exceptions.py +218 -0
  14. openvip-1.0.0rc1/openvip/messages.py +79 -0
  15. openvip-1.0.0rc1/openvip/models/__init__.py +23 -0
  16. openvip-1.0.0rc1/openvip/models/ack.py +98 -0
  17. openvip-1.0.0rc1/openvip/models/control_request.py +95 -0
  18. openvip-1.0.0rc1/openvip/models/error.py +100 -0
  19. openvip-1.0.0rc1/openvip/models/speech_request.py +125 -0
  20. openvip-1.0.0rc1/openvip/models/speech_response.py +97 -0
  21. openvip-1.0.0rc1/openvip/models/status.py +94 -0
  22. openvip-1.0.0rc1/openvip/models/transcription.py +141 -0
  23. openvip-1.0.0rc1/openvip/py.typed +0 -0
  24. openvip-1.0.0rc1/openvip/rest.py +263 -0
  25. openvip-1.0.0rc1/openvip.egg-info/PKG-INFO +172 -0
  26. openvip-1.0.0rc1/openvip.egg-info/SOURCES.txt +43 -0
  27. openvip-1.0.0rc1/openvip.egg-info/dependency_links.txt +1 -0
  28. openvip-1.0.0rc1/openvip.egg-info/requires.txt +4 -0
  29. openvip-1.0.0rc1/openvip.egg-info/top_level.txt +1 -0
  30. openvip-1.0.0rc1/pyproject.toml +110 -0
  31. openvip-1.0.0rc1/setup.cfg +7 -0
  32. openvip-1.0.0rc1/test/test_ack.py +53 -0
  33. openvip-1.0.0rc1/test/test_control_api.py +38 -0
  34. openvip-1.0.0rc1/test/test_control_request.py +52 -0
  35. openvip-1.0.0rc1/test/test_error.py +53 -0
  36. openvip-1.0.0rc1/test/test_messages_api.py +45 -0
  37. openvip-1.0.0rc1/test/test_speech_api.py +38 -0
  38. openvip-1.0.0rc1/test/test_speech_request.py +57 -0
  39. openvip-1.0.0rc1/test/test_speech_response.py +53 -0
  40. openvip-1.0.0rc1/test/test_status.py +56 -0
  41. openvip-1.0.0rc1/test/test_status_api.py +45 -0
  42. openvip-1.0.0rc1/test/test_transcription.py +66 -0
  43. openvip-1.0.0rc1/tests/test_client.py +406 -0
  44. openvip-1.0.0rc1/tests/test_messages.py +98 -0
@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.4
2
+ Name: openvip
3
+ Version: 1.0.0rc1
4
+ Summary: Python SDK for the Open Voice Interaction Protocol (OpenVIP)
5
+ Author-email: OpenVIP <dev@openvip.dev>
6
+ License: MIT
7
+ Project-URL: Homepage, https://openvip.dev
8
+ Project-URL: Repository, https://github.com/openvip-dev/sdks
9
+ Project-URL: Issues, https://github.com/openvip-dev/sdks/issues
10
+ Keywords: openvip,voice,speech,transcription,stt,tts
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: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
25
+ Requires-Dist: python-dateutil>=2.8.2
26
+ Requires-Dist: pydantic>=2.11
27
+ Requires-Dist: typing-extensions>=4.7.1
28
+
29
+ # openvip
30
+ Open Voice Interaction Protocol (OpenVIP) HTTP API specification.
31
+
32
+ This API allows applications to send and receive voice interaction messages.
33
+
34
+ ## Quick Start
35
+
36
+ ```bash
37
+ # Subscribe to messages (SSE) — this IS the registration
38
+ curl http://localhost:8770/agents/my-agent-id/messages
39
+
40
+ # Send a message to an agent
41
+ curl -X POST http://localhost:8770/agents/my-agent-id/messages \\
42
+ -H \"Content-Type: application/json\" \\
43
+ -d '{\"openvip\": \"1.0\", \"type\": \"transcription\", \"id\": \"uuid\", \"timestamp\": \"2026-02-06T10:30:00Z\", \"text\": \"hello\"}'
44
+
45
+ # Text-to-speech
46
+ curl -X POST http://localhost:8770/speech \\
47
+ -H \"Content-Type: application/json\" \\
48
+ -d '{\"openvip\": \"1.0\", \"type\": \"speech\", \"text\": \"hello world\", \"language\": \"en\"}'
49
+ ```
50
+
51
+ ## Agent Lifecycle
52
+
53
+ Agents are **ephemeral**. An agent exists only while its SSE connection is open.
54
+ No explicit registration is needed — connecting to the SSE endpoint registers the agent.
55
+ Disconnecting automatically de-registers it.
56
+
57
+
58
+ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
59
+
60
+ - API version: 1.0
61
+ - Package version: 1.0.0
62
+ - Generator version: 7.21.0-SNAPSHOT
63
+ - Build package: org.openapitools.codegen.languages.PythonClientCodegen
64
+ For more information, please visit [https://openvip.org](https://openvip.org)
65
+
66
+ ## Requirements.
67
+
68
+ Python 3.9+
69
+
70
+ ## Installation & Usage
71
+ ### pip install
72
+
73
+ If the python package is hosted on a repository, you can install directly using:
74
+
75
+ ```sh
76
+ pip install git+https://github.com/openvip-dev/sdks.git
77
+ ```
78
+ (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/openvip-dev/sdks.git`)
79
+
80
+ Then import the package:
81
+ ```python
82
+ import openvip
83
+ ```
84
+
85
+ ### Setuptools
86
+
87
+ Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
88
+
89
+ ```sh
90
+ python setup.py install --user
91
+ ```
92
+ (or `sudo python setup.py install` to install the package for all users)
93
+
94
+ Then import the package:
95
+ ```python
96
+ import openvip
97
+ ```
98
+
99
+ ### Tests
100
+
101
+ Execute `pytest` to run the tests.
102
+
103
+ ## Getting Started
104
+
105
+ Please follow the [installation procedure](#installation--usage) and then run the following:
106
+
107
+ ```python
108
+
109
+ import openvip
110
+ from openvip.rest import ApiException
111
+ from pprint import pprint
112
+
113
+ # Defining the host is optional and defaults to http://localhost:8770
114
+ # See configuration.py for a list of all supported configuration parameters.
115
+ configuration = openvip.Configuration(
116
+ host = "http://localhost:8770"
117
+ )
118
+
119
+
120
+
121
+ # Enter a context with an instance of the API client
122
+ with openvip.ApiClient(configuration) as api_client:
123
+ # Create an instance of the API class
124
+ api_instance = openvip.ControlApi(api_client)
125
+ control_request = {"command":"stt.stop"} # ControlRequest |
126
+
127
+ try:
128
+ # Send control command
129
+ api_response = api_instance.send_control(control_request)
130
+ print("The response of ControlApi->send_control:\n")
131
+ pprint(api_response)
132
+ except ApiException as e:
133
+ print("Exception when calling ControlApi->send_control: %s\n" % e)
134
+
135
+ ```
136
+
137
+ ## Documentation for API Endpoints
138
+
139
+ All URIs are relative to *http://localhost:8770*
140
+
141
+ Class | Method | HTTP request | Description
142
+ ------------ | ------------- | ------------- | -------------
143
+ *ControlApi* | [**send_control**](docs/ControlApi.md#send_control) | **POST** /control | Send control command
144
+ *MessagesApi* | [**send_message**](docs/MessagesApi.md#send_message) | **POST** /agents/{agent_id}/messages | Send message to agent
145
+ *MessagesApi* | [**subscribe_agent**](docs/MessagesApi.md#subscribe_agent) | **GET** /agents/{agent_id}/messages | Subscribe to agent messages (SSE)
146
+ *SpeechApi* | [**text_to_speech**](docs/SpeechApi.md#text_to_speech) | **POST** /speech | Text-to-speech request
147
+ *StatusApi* | [**get_status**](docs/StatusApi.md#get_status) | **GET** /status | Get engine status
148
+ *StatusApi* | [**subscribe_status**](docs/StatusApi.md#subscribe_status) | **GET** /status/stream | Subscribe to status changes (SSE)
149
+
150
+
151
+ ## Documentation For Models
152
+
153
+ - [Ack](docs/Ack.md)
154
+ - [ControlRequest](docs/ControlRequest.md)
155
+ - [Error](docs/Error.md)
156
+ - [SpeechRequest](docs/SpeechRequest.md)
157
+ - [SpeechResponse](docs/SpeechResponse.md)
158
+ - [Status](docs/Status.md)
159
+ - [Transcription](docs/Transcription.md)
160
+
161
+
162
+ <a id="documentation-for-authorization"></a>
163
+ ## Documentation For Authorization
164
+
165
+ Endpoints do not require authorization.
166
+
167
+
168
+ ## Author
169
+
170
+
171
+
172
+
@@ -0,0 +1,144 @@
1
+ # openvip
2
+ Open Voice Interaction Protocol (OpenVIP) HTTP API specification.
3
+
4
+ This API allows applications to send and receive voice interaction messages.
5
+
6
+ ## Quick Start
7
+
8
+ ```bash
9
+ # Subscribe to messages (SSE) — this IS the registration
10
+ curl http://localhost:8770/agents/my-agent-id/messages
11
+
12
+ # Send a message to an agent
13
+ curl -X POST http://localhost:8770/agents/my-agent-id/messages \\
14
+ -H \"Content-Type: application/json\" \\
15
+ -d '{\"openvip\": \"1.0\", \"type\": \"transcription\", \"id\": \"uuid\", \"timestamp\": \"2026-02-06T10:30:00Z\", \"text\": \"hello\"}'
16
+
17
+ # Text-to-speech
18
+ curl -X POST http://localhost:8770/speech \\
19
+ -H \"Content-Type: application/json\" \\
20
+ -d '{\"openvip\": \"1.0\", \"type\": \"speech\", \"text\": \"hello world\", \"language\": \"en\"}'
21
+ ```
22
+
23
+ ## Agent Lifecycle
24
+
25
+ Agents are **ephemeral**. An agent exists only while its SSE connection is open.
26
+ No explicit registration is needed — connecting to the SSE endpoint registers the agent.
27
+ Disconnecting automatically de-registers it.
28
+
29
+
30
+ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
31
+
32
+ - API version: 1.0
33
+ - Package version: 1.0.0
34
+ - Generator version: 7.21.0-SNAPSHOT
35
+ - Build package: org.openapitools.codegen.languages.PythonClientCodegen
36
+ For more information, please visit [https://openvip.org](https://openvip.org)
37
+
38
+ ## Requirements.
39
+
40
+ Python 3.9+
41
+
42
+ ## Installation & Usage
43
+ ### pip install
44
+
45
+ If the python package is hosted on a repository, you can install directly using:
46
+
47
+ ```sh
48
+ pip install git+https://github.com/openvip-dev/sdks.git
49
+ ```
50
+ (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/openvip-dev/sdks.git`)
51
+
52
+ Then import the package:
53
+ ```python
54
+ import openvip
55
+ ```
56
+
57
+ ### Setuptools
58
+
59
+ Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
60
+
61
+ ```sh
62
+ python setup.py install --user
63
+ ```
64
+ (or `sudo python setup.py install` to install the package for all users)
65
+
66
+ Then import the package:
67
+ ```python
68
+ import openvip
69
+ ```
70
+
71
+ ### Tests
72
+
73
+ Execute `pytest` to run the tests.
74
+
75
+ ## Getting Started
76
+
77
+ Please follow the [installation procedure](#installation--usage) and then run the following:
78
+
79
+ ```python
80
+
81
+ import openvip
82
+ from openvip.rest import ApiException
83
+ from pprint import pprint
84
+
85
+ # Defining the host is optional and defaults to http://localhost:8770
86
+ # See configuration.py for a list of all supported configuration parameters.
87
+ configuration = openvip.Configuration(
88
+ host = "http://localhost:8770"
89
+ )
90
+
91
+
92
+
93
+ # Enter a context with an instance of the API client
94
+ with openvip.ApiClient(configuration) as api_client:
95
+ # Create an instance of the API class
96
+ api_instance = openvip.ControlApi(api_client)
97
+ control_request = {"command":"stt.stop"} # ControlRequest |
98
+
99
+ try:
100
+ # Send control command
101
+ api_response = api_instance.send_control(control_request)
102
+ print("The response of ControlApi->send_control:\n")
103
+ pprint(api_response)
104
+ except ApiException as e:
105
+ print("Exception when calling ControlApi->send_control: %s\n" % e)
106
+
107
+ ```
108
+
109
+ ## Documentation for API Endpoints
110
+
111
+ All URIs are relative to *http://localhost:8770*
112
+
113
+ Class | Method | HTTP request | Description
114
+ ------------ | ------------- | ------------- | -------------
115
+ *ControlApi* | [**send_control**](docs/ControlApi.md#send_control) | **POST** /control | Send control command
116
+ *MessagesApi* | [**send_message**](docs/MessagesApi.md#send_message) | **POST** /agents/{agent_id}/messages | Send message to agent
117
+ *MessagesApi* | [**subscribe_agent**](docs/MessagesApi.md#subscribe_agent) | **GET** /agents/{agent_id}/messages | Subscribe to agent messages (SSE)
118
+ *SpeechApi* | [**text_to_speech**](docs/SpeechApi.md#text_to_speech) | **POST** /speech | Text-to-speech request
119
+ *StatusApi* | [**get_status**](docs/StatusApi.md#get_status) | **GET** /status | Get engine status
120
+ *StatusApi* | [**subscribe_status**](docs/StatusApi.md#subscribe_status) | **GET** /status/stream | Subscribe to status changes (SSE)
121
+
122
+
123
+ ## Documentation For Models
124
+
125
+ - [Ack](docs/Ack.md)
126
+ - [ControlRequest](docs/ControlRequest.md)
127
+ - [Error](docs/Error.md)
128
+ - [SpeechRequest](docs/SpeechRequest.md)
129
+ - [SpeechResponse](docs/SpeechResponse.md)
130
+ - [Status](docs/Status.md)
131
+ - [Transcription](docs/Transcription.md)
132
+
133
+
134
+ <a id="documentation-for-authorization"></a>
135
+ ## Documentation For Authorization
136
+
137
+ Endpoints do not require authorization.
138
+
139
+
140
+ ## Author
141
+
142
+
143
+
144
+
@@ -0,0 +1,76 @@
1
+ """OpenVIP SDK — Open Voice Interaction Protocol client for Python.
2
+
3
+ Example::
4
+
5
+ from openvip import Client, create_transcription
6
+
7
+ # High-level client
8
+ client = Client("http://localhost:8770")
9
+ client.speak("Hello world", language="en")
10
+ status = client.get_status()
11
+ client.start_listening()
12
+
13
+ # Message factories
14
+ msg = create_transcription("turn on the light", language="en")
15
+ client.send_message("my-agent", msg)
16
+
17
+ # SSE subscription (agent messages)
18
+ for message in client.subscribe("my-agent"):
19
+ print(message.text)
20
+
21
+ # SSE subscription (status changes)
22
+ for status in client.subscribe_status(reconnect=True):
23
+ print(status.state, status.connected_agents)
24
+ """
25
+
26
+ __version__ = "1.0.0"
27
+
28
+ # Convenience API (hand-written)
29
+ from openvip.client import Client as Client
30
+ from openvip.client import DuplicateAgentError as DuplicateAgentError
31
+ from openvip.messages import (
32
+ PROTOCOL_VERSION as PROTOCOL_VERSION,
33
+ create_speech_request as create_speech_request,
34
+ create_transcription as create_transcription,
35
+ )
36
+
37
+ # Generated models
38
+ from openvip.models.ack import Ack as Ack
39
+ from openvip.models.control_request import ControlRequest as ControlRequest
40
+ from openvip.models.error import Error as Error
41
+ from openvip.models.speech_request import SpeechRequest as SpeechRequest
42
+ from openvip.models.speech_response import SpeechResponse as SpeechResponse
43
+ from openvip.models.status import Status as Status
44
+ from openvip.models.transcription import Transcription as Transcription
45
+
46
+ # Generated low-level API (available if needed)
47
+ from openvip.api.control_api import ControlApi as ControlApi
48
+ from openvip.api.messages_api import MessagesApi as MessagesApi
49
+ from openvip.api.speech_api import SpeechApi as SpeechApi
50
+ from openvip.api.status_api import StatusApi as StatusApi
51
+ from openvip.api_client import ApiClient as ApiClient
52
+ from openvip.configuration import Configuration as Configuration
53
+
54
+ __all__ = [
55
+ # Convenience (use these)
56
+ "Client",
57
+ "DuplicateAgentError",
58
+ "create_transcription",
59
+ "create_speech_request",
60
+ "PROTOCOL_VERSION",
61
+ # Models
62
+ "Ack",
63
+ "ControlRequest",
64
+ "Error",
65
+ "SpeechRequest",
66
+ "SpeechResponse",
67
+ "Status",
68
+ "Transcription",
69
+ # Low-level generated API
70
+ "ControlApi",
71
+ "MessagesApi",
72
+ "SpeechApi",
73
+ "StatusApi",
74
+ "ApiClient",
75
+ "Configuration",
76
+ ]
@@ -0,0 +1,8 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from openvip.api.control_api import ControlApi
5
+ from openvip.api.messages_api import MessagesApi
6
+ from openvip.api.speech_api import SpeechApi
7
+ from openvip.api.status_api import StatusApi
8
+