rapida-python 0.1.27__tar.gz → 0.1.29__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.
- {rapida_python-0.1.27 → rapida_python-0.1.29}/PKG-INFO +38 -19
- {rapida_python-0.1.27 → rapida_python-0.1.29}/README.md +37 -18
- {rapida_python-0.1.27 → rapida_python-0.1.29}/pyproject.toml +1 -1
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/agentkit/__init__.py +4 -2
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida_python.egg-info/PKG-INFO +38 -19
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/__init__.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/__init__.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/assistant.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/call.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/endpoint.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/invoke.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/__init__.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/agentkit_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/agentkit_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/agentkit_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_analysis_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_analysis_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_analysis_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_deployment_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_deployment_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_deployment_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_knowledge_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_knowledge_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_knowledge_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_provider_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_provider_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_provider_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_tool_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_tool_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_tool_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_webhook_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_webhook_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_webhook_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/audit_logging_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/audit_logging_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/audit_logging_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/billing_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/billing_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/billing_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/common_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/common_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/common_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/connect_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/connect_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/connect_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/document_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/document_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/document_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/endpoint_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/endpoint_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/endpoint_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/integration_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/integration_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/integration_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/invoker_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/invoker_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/invoker_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/knowledge_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/knowledge_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/knowledge_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/notification_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/notification_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/notification_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/talk_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/talk_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/talk_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/vault_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/vault_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/vault_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/web_api_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/web_api_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/web_api_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/webrtc_pb2.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/webrtc_pb2.pyi +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/webrtc_pb2_grpc.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/configs/__init__.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/connections/__init__.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/utils/__init__.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/utils/rapida_environment.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/utils/rapida_header.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/utils/rapida_region.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/utils/rapida_source.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/utils/rapida_value.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/version.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida_python.egg-info/SOURCES.txt +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida_python.egg-info/dependency_links.txt +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida_python.egg-info/requires.txt +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/rapida_python.egg-info/top_level.txt +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/setup.cfg +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/setup.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/tests/test_configs.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/tests/test_connections.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/tests/test_proto_imports.py +0 -0
- {rapida_python-0.1.27 → rapida_python-0.1.29}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rapida-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.29
|
|
4
4
|
Summary: RapidaAI SDK to integrate rapida.ai APIs
|
|
5
5
|
Author-email: RapidaAI <code@rapida.ai>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -31,7 +31,7 @@ Requires-Dist: mypy; extra == "dev"
|
|
|
31
31
|
|
|
32
32
|
# Rapida Python SDK
|
|
33
33
|
|
|
34
|
-
[](https://github.com/rapidaai/rapida-python/actions/workflows/build.yml)
|
|
34
|
+
[](https://github.com/rapidaai/rapida-python/actions/workflows/python-build.yml)
|
|
35
35
|
|
|
36
36
|
The Rapida Python SDK provides a powerful interface for interacting with Rapida AI services. This SDK simplifies the process of making API calls, handling authentication, and managing responses from Rapida endpoints.
|
|
37
37
|
|
|
@@ -48,18 +48,13 @@ pip install rapida-python
|
|
|
48
48
|
Here's how to get started with the Rapida Python SDK:
|
|
49
49
|
|
|
50
50
|
```python
|
|
51
|
-
from rapida import
|
|
52
|
-
ConnectionConfig,
|
|
53
|
-
)
|
|
54
|
-
from pprint import pprint
|
|
55
|
-
|
|
51
|
+
from rapida import ConnectionConfig
|
|
56
52
|
|
|
57
53
|
connection_config = ConnectionConfig.default_connection_config(
|
|
58
54
|
ConnectionConfig.with_sdk(
|
|
59
|
-
"{your-api-key-here}"
|
|
55
|
+
"{your-api-key-here}"
|
|
60
56
|
)
|
|
61
57
|
)
|
|
62
|
-
|
|
63
58
|
```
|
|
64
59
|
|
|
65
60
|
## Authentication
|
|
@@ -71,8 +66,11 @@ You can configure the Rapida SDK to authenticate using your **API Key** or **Per
|
|
|
71
66
|
```python
|
|
72
67
|
import os
|
|
73
68
|
from rapida.connections import ConnectionConfig
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
|
|
70
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
71
|
+
ConnectionConfig.with_sdk(
|
|
72
|
+
os.environ["RAPIDA_API_KEY"] # API Key from environment variables
|
|
73
|
+
)
|
|
76
74
|
)
|
|
77
75
|
```
|
|
78
76
|
|
|
@@ -82,25 +80,46 @@ connection_config = ConnectionConfig.with_sdk(
|
|
|
82
80
|
import os
|
|
83
81
|
from rapida.connections import ConnectionConfig
|
|
84
82
|
|
|
85
|
-
connection_config = ConnectionConfig.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
84
|
+
ConnectionConfig.with_personal_token(
|
|
85
|
+
os.environ["RAPIDA_AUTHORIZATION_TOKEN"], # Authorization Token
|
|
86
|
+
os.environ["RAPIDA_AUTH_ID"], # Authentication ID
|
|
87
|
+
os.environ["RAPIDA_PROJECT_ID"], # Project ID
|
|
88
|
+
)
|
|
89
89
|
)
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
## Configuration Options
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
`ConnectionConfig` accepts multiple options for configuring the SDK:
|
|
95
95
|
|
|
96
96
|
- `with_sdk(api_key: str)`: Sets the API key for authentication.
|
|
97
97
|
- `with_personal_token(auth_token: str, auth_id: str, project_id: str)`: Configures the connection for personal tokens.
|
|
98
|
-
- `
|
|
99
|
-
- `
|
|
98
|
+
- `with_webplugin_client(api_key: str, user_id: Optional[str] = None)`: Configures web plugin client authentication.
|
|
99
|
+
- `with_debugger(authorization: str, user_id: str, project_id: str)`: Configures debugger authentication.
|
|
100
|
+
- `with_custom_endpoint(endpoint: Optional[dict] = None, debug: Optional[bool] = None)`: Overrides the default assistant, web, and endpoint API hosts.
|
|
101
|
+
- `with_local()`: Uses local service endpoints and insecure gRPC channels for local development.
|
|
102
|
+
- `default_connection_config(auth)`: Creates a `ConnectionConfig` with the supplied auth metadata.
|
|
103
|
+
|
|
104
|
+
Example using custom endpoints:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from rapida import ConnectionConfig
|
|
108
|
+
|
|
109
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
110
|
+
ConnectionConfig.with_sdk("{your-api-key-here}")
|
|
111
|
+
).with_custom_endpoint(
|
|
112
|
+
{
|
|
113
|
+
"assistant": "assistant.example.com:50051",
|
|
114
|
+
"web": "api.example.com:50051",
|
|
115
|
+
"endpoint": "endpoint.example.com:50051",
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
```
|
|
100
119
|
|
|
101
120
|
## Compatibility
|
|
102
121
|
|
|
103
|
-
This SDK requires **Python 3.
|
|
122
|
+
This SDK requires **Python 3.9 or later**. Ensure your system meets this requirement:
|
|
104
123
|
|
|
105
124
|
```bash
|
|
106
125
|
python --version
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Rapida Python SDK
|
|
2
2
|
|
|
3
|
-
[](https://github.com/rapidaai/rapida-python/actions/workflows/build.yml)
|
|
3
|
+
[](https://github.com/rapidaai/rapida-python/actions/workflows/python-build.yml)
|
|
4
4
|
|
|
5
5
|
The Rapida Python SDK provides a powerful interface for interacting with Rapida AI services. This SDK simplifies the process of making API calls, handling authentication, and managing responses from Rapida endpoints.
|
|
6
6
|
|
|
@@ -17,18 +17,13 @@ pip install rapida-python
|
|
|
17
17
|
Here's how to get started with the Rapida Python SDK:
|
|
18
18
|
|
|
19
19
|
```python
|
|
20
|
-
from rapida import
|
|
21
|
-
ConnectionConfig,
|
|
22
|
-
)
|
|
23
|
-
from pprint import pprint
|
|
24
|
-
|
|
20
|
+
from rapida import ConnectionConfig
|
|
25
21
|
|
|
26
22
|
connection_config = ConnectionConfig.default_connection_config(
|
|
27
23
|
ConnectionConfig.with_sdk(
|
|
28
|
-
"{your-api-key-here}"
|
|
24
|
+
"{your-api-key-here}"
|
|
29
25
|
)
|
|
30
26
|
)
|
|
31
|
-
|
|
32
27
|
```
|
|
33
28
|
|
|
34
29
|
## Authentication
|
|
@@ -40,8 +35,11 @@ You can configure the Rapida SDK to authenticate using your **API Key** or **Per
|
|
|
40
35
|
```python
|
|
41
36
|
import os
|
|
42
37
|
from rapida.connections import ConnectionConfig
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
|
|
39
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
40
|
+
ConnectionConfig.with_sdk(
|
|
41
|
+
os.environ["RAPIDA_API_KEY"] # API Key from environment variables
|
|
42
|
+
)
|
|
45
43
|
)
|
|
46
44
|
```
|
|
47
45
|
|
|
@@ -51,25 +49,46 @@ connection_config = ConnectionConfig.with_sdk(
|
|
|
51
49
|
import os
|
|
52
50
|
from rapida.connections import ConnectionConfig
|
|
53
51
|
|
|
54
|
-
connection_config = ConnectionConfig.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
53
|
+
ConnectionConfig.with_personal_token(
|
|
54
|
+
os.environ["RAPIDA_AUTHORIZATION_TOKEN"], # Authorization Token
|
|
55
|
+
os.environ["RAPIDA_AUTH_ID"], # Authentication ID
|
|
56
|
+
os.environ["RAPIDA_PROJECT_ID"], # Project ID
|
|
57
|
+
)
|
|
58
58
|
)
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## Configuration Options
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
`ConnectionConfig` accepts multiple options for configuring the SDK:
|
|
64
64
|
|
|
65
65
|
- `with_sdk(api_key: str)`: Sets the API key for authentication.
|
|
66
66
|
- `with_personal_token(auth_token: str, auth_id: str, project_id: str)`: Configures the connection for personal tokens.
|
|
67
|
-
- `
|
|
68
|
-
- `
|
|
67
|
+
- `with_webplugin_client(api_key: str, user_id: Optional[str] = None)`: Configures web plugin client authentication.
|
|
68
|
+
- `with_debugger(authorization: str, user_id: str, project_id: str)`: Configures debugger authentication.
|
|
69
|
+
- `with_custom_endpoint(endpoint: Optional[dict] = None, debug: Optional[bool] = None)`: Overrides the default assistant, web, and endpoint API hosts.
|
|
70
|
+
- `with_local()`: Uses local service endpoints and insecure gRPC channels for local development.
|
|
71
|
+
- `default_connection_config(auth)`: Creates a `ConnectionConfig` with the supplied auth metadata.
|
|
72
|
+
|
|
73
|
+
Example using custom endpoints:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from rapida import ConnectionConfig
|
|
77
|
+
|
|
78
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
79
|
+
ConnectionConfig.with_sdk("{your-api-key-here}")
|
|
80
|
+
).with_custom_endpoint(
|
|
81
|
+
{
|
|
82
|
+
"assistant": "assistant.example.com:50051",
|
|
83
|
+
"web": "api.example.com:50051",
|
|
84
|
+
"endpoint": "endpoint.example.com:50051",
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
```
|
|
69
88
|
|
|
70
89
|
## Compatibility
|
|
71
90
|
|
|
72
|
-
This SDK requires **Python 3.
|
|
91
|
+
This SDK requires **Python 3.9 or later**. Ensure your system meets this requirement:
|
|
73
92
|
|
|
74
93
|
```bash
|
|
75
94
|
python --version
|
|
@@ -171,12 +171,13 @@ class AuthorizationInterceptor(ServerInterceptor):
|
|
|
171
171
|
return continuation(handler_call_details)
|
|
172
172
|
|
|
173
173
|
def _abort_handler(self):
|
|
174
|
-
def abort(
|
|
174
|
+
def abort(ignored_request_iterator, context):
|
|
175
175
|
context.abort(
|
|
176
176
|
grpc.StatusCode.UNAUTHENTICATED, "Invalid authorization token"
|
|
177
177
|
)
|
|
178
|
+
return iter(())
|
|
178
179
|
|
|
179
|
-
return grpc.
|
|
180
|
+
return grpc.stream_stream_rpc_method_handler(abort)
|
|
180
181
|
|
|
181
182
|
|
|
182
183
|
# ============================================================================
|
|
@@ -658,6 +659,7 @@ class AgentKitServer:
|
|
|
658
659
|
if self._server:
|
|
659
660
|
logger.info(f"Stopping server (grace={grace}s)...")
|
|
660
661
|
self._server.stop(grace)
|
|
662
|
+
self._server = None
|
|
661
663
|
logger.info("Server stopped")
|
|
662
664
|
|
|
663
665
|
def wait_for_termination(self, timeout: Optional[float] = None) -> bool:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rapida-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.29
|
|
4
4
|
Summary: RapidaAI SDK to integrate rapida.ai APIs
|
|
5
5
|
Author-email: RapidaAI <code@rapida.ai>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -31,7 +31,7 @@ Requires-Dist: mypy; extra == "dev"
|
|
|
31
31
|
|
|
32
32
|
# Rapida Python SDK
|
|
33
33
|
|
|
34
|
-
[](https://github.com/rapidaai/rapida-python/actions/workflows/build.yml)
|
|
34
|
+
[](https://github.com/rapidaai/rapida-python/actions/workflows/python-build.yml)
|
|
35
35
|
|
|
36
36
|
The Rapida Python SDK provides a powerful interface for interacting with Rapida AI services. This SDK simplifies the process of making API calls, handling authentication, and managing responses from Rapida endpoints.
|
|
37
37
|
|
|
@@ -48,18 +48,13 @@ pip install rapida-python
|
|
|
48
48
|
Here's how to get started with the Rapida Python SDK:
|
|
49
49
|
|
|
50
50
|
```python
|
|
51
|
-
from rapida import
|
|
52
|
-
ConnectionConfig,
|
|
53
|
-
)
|
|
54
|
-
from pprint import pprint
|
|
55
|
-
|
|
51
|
+
from rapida import ConnectionConfig
|
|
56
52
|
|
|
57
53
|
connection_config = ConnectionConfig.default_connection_config(
|
|
58
54
|
ConnectionConfig.with_sdk(
|
|
59
|
-
"{your-api-key-here}"
|
|
55
|
+
"{your-api-key-here}"
|
|
60
56
|
)
|
|
61
57
|
)
|
|
62
|
-
|
|
63
58
|
```
|
|
64
59
|
|
|
65
60
|
## Authentication
|
|
@@ -71,8 +66,11 @@ You can configure the Rapida SDK to authenticate using your **API Key** or **Per
|
|
|
71
66
|
```python
|
|
72
67
|
import os
|
|
73
68
|
from rapida.connections import ConnectionConfig
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
|
|
70
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
71
|
+
ConnectionConfig.with_sdk(
|
|
72
|
+
os.environ["RAPIDA_API_KEY"] # API Key from environment variables
|
|
73
|
+
)
|
|
76
74
|
)
|
|
77
75
|
```
|
|
78
76
|
|
|
@@ -82,25 +80,46 @@ connection_config = ConnectionConfig.with_sdk(
|
|
|
82
80
|
import os
|
|
83
81
|
from rapida.connections import ConnectionConfig
|
|
84
82
|
|
|
85
|
-
connection_config = ConnectionConfig.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
84
|
+
ConnectionConfig.with_personal_token(
|
|
85
|
+
os.environ["RAPIDA_AUTHORIZATION_TOKEN"], # Authorization Token
|
|
86
|
+
os.environ["RAPIDA_AUTH_ID"], # Authentication ID
|
|
87
|
+
os.environ["RAPIDA_PROJECT_ID"], # Project ID
|
|
88
|
+
)
|
|
89
89
|
)
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
## Configuration Options
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
`ConnectionConfig` accepts multiple options for configuring the SDK:
|
|
95
95
|
|
|
96
96
|
- `with_sdk(api_key: str)`: Sets the API key for authentication.
|
|
97
97
|
- `with_personal_token(auth_token: str, auth_id: str, project_id: str)`: Configures the connection for personal tokens.
|
|
98
|
-
- `
|
|
99
|
-
- `
|
|
98
|
+
- `with_webplugin_client(api_key: str, user_id: Optional[str] = None)`: Configures web plugin client authentication.
|
|
99
|
+
- `with_debugger(authorization: str, user_id: str, project_id: str)`: Configures debugger authentication.
|
|
100
|
+
- `with_custom_endpoint(endpoint: Optional[dict] = None, debug: Optional[bool] = None)`: Overrides the default assistant, web, and endpoint API hosts.
|
|
101
|
+
- `with_local()`: Uses local service endpoints and insecure gRPC channels for local development.
|
|
102
|
+
- `default_connection_config(auth)`: Creates a `ConnectionConfig` with the supplied auth metadata.
|
|
103
|
+
|
|
104
|
+
Example using custom endpoints:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from rapida import ConnectionConfig
|
|
108
|
+
|
|
109
|
+
connection_config = ConnectionConfig.default_connection_config(
|
|
110
|
+
ConnectionConfig.with_sdk("{your-api-key-here}")
|
|
111
|
+
).with_custom_endpoint(
|
|
112
|
+
{
|
|
113
|
+
"assistant": "assistant.example.com:50051",
|
|
114
|
+
"web": "api.example.com:50051",
|
|
115
|
+
"endpoint": "endpoint.example.com:50051",
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
```
|
|
100
119
|
|
|
101
120
|
## Compatibility
|
|
102
121
|
|
|
103
|
-
This SDK requires **Python 3.
|
|
122
|
+
This SDK requires **Python 3.9 or later**. Ensure your system meets this requirement:
|
|
104
123
|
|
|
105
124
|
```bash
|
|
106
125
|
python --version
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_analysis_pb2.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_analysis_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_analysis_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_api_pb2_grpc.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_deployment_pb2.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_deployment_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_deployment_pb2_grpc.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_knowledge_pb2.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_knowledge_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_knowledge_pb2_grpc.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_provider_pb2.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_provider_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_provider_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_tool_pb2_grpc.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_webhook_pb2.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_webhook_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/assistant_webhook_pb2_grpc.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/audit_logging_api_pb2.py
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/audit_logging_api_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/audit_logging_api_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/document_api_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/endpoint_api_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/integration_api_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/knowledge_api_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/notification_api_pb2.pyi
RENAMED
|
File without changes
|
{rapida_python-0.1.27 → rapida_python-0.1.29}/rapida/clients/protos/notification_api_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|