bosa-connectors-binary 0.0.10__cp312-cp312-macosx_14_0_arm64.whl → 0.1.0__cp312-cp312-macosx_14_0_arm64.whl

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.
Binary file
bosa_connectors.pyi CHANGED
@@ -21,9 +21,11 @@ import requests
21
21
  import requests.exceptions
22
22
  import bosa_connectors.auth.ApiKeyAuthenticator
23
23
  import pydantic
24
+ import langchain_core
25
+ import langchain_core.tools
24
26
  import uuid
25
- import cgi
26
27
  import random
27
28
  import time
28
- import inspect
29
- import gllm_agents
29
+ import cgi
30
+ import legacy_cgi
31
+ import inspect
@@ -1,17 +1,18 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bosa-connectors-binary
3
- Version: 0.0.10
3
+ Version: 0.1.0
4
4
  Summary: BOSA Connectors
5
5
  Author: Bosa Engineers
6
6
  Author-email: bosa-eng@gdplabs.id
7
- Requires-Python: >=3.11,<3.13
7
+ Requires-Python: >=3.11,<3.14
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
11
  Provides-Extra: flag-embedding
12
12
  Provides-Extra: langchain-huggingface
13
13
  Provides-Extra: semantic-router
14
- Requires-Dist: gllm-agents-binary (==0.0.2)
14
+ Requires-Dist: langchain-core (>=0.3.61,<0.4.0)
15
+ Requires-Dist: legacy-cgi (>=2.6.3,<3.0.0)
15
16
  Requires-Dist: pydantic (>=2.9.2,<3.0.0)
16
17
  Requires-Dist: requests (>=2.31.0,<3.0.0)
17
18
  Description-Content-Type: text/markdown
@@ -31,6 +32,30 @@ A Python SDK for seamlessly connecting to APIs that implement BOSA's Plugin Arch
31
32
  - Retry support for requests that fail (429 or 5xx)
32
33
  - Response fields filtering based on action and output
33
34
 
35
+ ## Prerequisites
36
+ After the `bosa-api` ready, you can perform the following tasks:
37
+ - Ensure Bosa API is running. If you want to test locally, or you can use Staging or Production environments.
38
+ - Create Client
39
+ - You can send a `create-client` request to the `bosa-api` using Postman with the following header and body:
40
+ - Header
41
+ - `x-api-user`: KEY1
42
+ - Body
43
+ - `name`: "`{client name}`"
44
+ - Response :
45
+ ```json
46
+ {
47
+ "data": {
48
+ "id": "{client_id}",
49
+ "name": "admin",
50
+ "api_key": "{client_api_key}",
51
+ "is_active": true
52
+ },
53
+ "meta": null
54
+ }
55
+ ```
56
+ - Register the user, see the details [here](/python/bosa-connectors/README.md#user-authentication).
57
+
58
+
34
59
  ## Installation
35
60
 
36
61
  ### Prerequisites
@@ -79,9 +104,10 @@ bosa = BosaConnector(api_base_url="YOUR_BOSA_API_BASE_URL", api_key="YOUR_API_KE
79
104
 
80
105
  After initializing the connector, you can authenticate with your BOSA API key.
81
106
 
107
+
82
108
  ```python
83
109
  # User token from authentication
84
- user_token = "Enter your key here from authentication, or refer to User Authentication section below"
110
+ user_token = "Enter your key (bearer token) here from authentication, or refer to User Authentication section below"
85
111
 
86
112
  # Check if a user has an integration for a connector
87
113
  has_integration = bosa.user_has_integration("github", user_token)
@@ -111,21 +137,16 @@ It is the basic way to execute actions, where you need to provide the connector
111
137
  ```python
112
138
  # Prepare input parameters
113
139
  params = {
114
- "owner": "gdp-admin",
115
- "author": "samuellusandi",
116
- "per_page": 1,
117
- "sort": "author_date",
118
- "created_date_start": "2025-02-01",
119
- "created_date_end": "2025-02-02"
140
+ "repo": "my-local-repo", # try to use your local repo for testing
141
+ "owner": "rexywjy",
120
142
  }
121
143
 
122
144
  # Execute the action with user token
123
- data, status = bosa.execute("github", "search_commits", token=user_token, max_attempts=1, input_=params)
124
-
125
- # Print the result
145
+ data, status = bosa.execute("github", "list_collaborators", token=user_token, max_attempts=1, input_=params)
126
146
  print(data)
127
147
  print(status)
128
148
  ```
149
+ More details about parameters and actions in bosa-api docs `{domain}/docs`
129
150
 
130
151
  ### Alternative Approach (Fluent Interface)
131
152
 
@@ -335,18 +356,25 @@ The connector includes built-in error handling for:
335
356
  The BOSA Connector supports user-based authentication which allows for user-specific actions and third-party integrations:
336
357
 
337
358
  ```python
338
- # Create a new BOSA user
359
+ # Step 1: Create a new BOSA user
339
360
  user_data = bosa.create_bosa_user("username")
340
361
  # Save the secret for later use
341
362
  user_secret = user_data.secret
342
363
 
343
- # Authenticate a user and get their token
364
+ # Step 2: Authenticate the user and obtain their token
344
365
  token = bosa.authenticate_bosa_user("username", user_secret)
345
366
 
346
- # Get user information
367
+ # Step 3: Retrieve user information using the obtained token
347
368
  user_info = bosa.get_user_info(token.token)
348
369
  ```
349
370
 
371
+ ### ❗ Important Notes
372
+
373
+ ***🛡️ Best Practice:*** Since bearer tokens can have a long lifespan, it is highly recommended to **reuse existing tokens** whenever possible. While creating new tokens is functionally acceptable, be aware that older tokens may become dangling and can pose a security risk if they are exposed or misused.
374
+
375
+ ***⚠️ Security Reminder:*** When you register a new BOSA user, you will receive a token that starts with **"sk-user-..."**. It is essential to keep this token safe, as it **cannot be recovered if lost**, and currently, there is **no option to reset** it.
376
+
377
+
350
378
  ## Integration Management
351
379
 
352
380
  The BOSA Connector provides methods to manage third-party integrations for authenticated users:
@@ -0,0 +1,6 @@
1
+ bosa_connectors.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
2
+ bosa_connectors.cpython-312-darwin.so,sha256=oftysH4d_UqF58rTvAgz3gKrigijVCwDLe0snGDqPxk,1006072
3
+ bosa_connectors.pyi,sha256=klto3AY3o5l8lA5NKYApY68UZ8FyQR07O37aQafpJZA,676
4
+ bosa_connectors_binary-0.1.0.dist-info/METADATA,sha256=LUuzOJ78WglpDnC3USCNKDzotW2gy9-n7AV9GrB42qc,15944
5
+ bosa_connectors_binary-0.1.0.dist-info/WHEEL,sha256=yhFWDruQeL16y7AZmR-YzCRfHXG6441RPQ3U5xtqaLo,106
6
+ bosa_connectors_binary-0.1.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- bosa_connectors.build/.gitignore,sha256=aEiIwOuxfzdCmLZe4oB1JsBmCUxwG8x-u-HBCV9JT8E,1
2
- bosa_connectors.cpython-312-darwin.so,sha256=TaDTkxTmSexyuUwM18mqgRp36Am4gDYm9VjfdUMKYAU,952104
3
- bosa_connectors.pyi,sha256=DVKPEVM_E3Q_f92puZ_mV4XD7Beo4LYPSEnoYz_BPKE,627
4
- bosa_connectors_binary-0.0.10.dist-info/METADATA,sha256=9mJXL_lo0ApAGaELFdIdPlUJAY1EXk3gzcrhJkrqMEs,14460
5
- bosa_connectors_binary-0.0.10.dist-info/WHEEL,sha256=yhFWDruQeL16y7AZmR-YzCRfHXG6441RPQ3U5xtqaLo,106
6
- bosa_connectors_binary-0.0.10.dist-info/RECORD,,