bosa-connectors-binary 0.0.10__cp312-cp312-win_amd64.whl → 0.1.0__cp312-cp312-win_amd64.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: libmagic (>=1.0,<2.0) ; sys_platform == "win32"
16
17
  Requires-Dist: pydantic (>=2.9.2,<3.0.0)
17
18
  Requires-Dist: python-magic-bin (>=0.4.14,<0.5.0) ; sys_platform == "win32"
@@ -33,6 +34,30 @@ A Python SDK for seamlessly connecting to APIs that implement BOSA's Plugin Arch
33
34
  - Retry support for requests that fail (429 or 5xx)
34
35
  - Response fields filtering based on action and output
35
36
 
37
+ ## Prerequisite
38
+ After the `bosa-api` ready, you can perform the following tasks:
39
+ - Ensure Bosa API is running. If you want to test locally, or you can use Staging or Production environments.
40
+ - Create Client
41
+ - You can send a `create-client` request to the `bosa-api` using Postman with the following header and body:
42
+ - Header
43
+ - `x-api-user`: KEY1
44
+ - Body
45
+ - `name`: "`{client name}`"
46
+ - Response :
47
+ ```json
48
+ {
49
+ "data": {
50
+ "id": "{client_id}",
51
+ "name": "admin",
52
+ "api_key": "{client_api_key}",
53
+ "is_active": true
54
+ },
55
+ "meta": null
56
+ }
57
+ ```
58
+ - Register the user, see the details [here](/python/bosa-connectors/README.md#user-authentication).
59
+
60
+
36
61
  ## Installation
37
62
 
38
63
  ### Prerequisites
@@ -81,9 +106,10 @@ bosa = BosaConnector(api_base_url="YOUR_BOSA_API_BASE_URL", api_key="YOUR_API_KE
81
106
 
82
107
  After initializing the connector, you can authenticate with your BOSA API key.
83
108
 
109
+
84
110
  ```python
85
111
  # User token from authentication
86
- user_token = "Enter your key here from authentication, or refer to User Authentication section below"
112
+ user_token = "Enter your key (bearer token) here from authentication, or refer to User Authentication section below"
87
113
 
88
114
  # Check if a user has an integration for a connector
89
115
  has_integration = bosa.user_has_integration("github", user_token)
@@ -113,21 +139,16 @@ It is the basic way to execute actions, where you need to provide the connector
113
139
  ```python
114
140
  # Prepare input parameters
115
141
  params = {
116
- "owner": "gdp-admin",
117
- "author": "samuellusandi",
118
- "per_page": 1,
119
- "sort": "author_date",
120
- "created_date_start": "2025-02-01",
121
- "created_date_end": "2025-02-02"
142
+ "repo": "my-local-repo", # try to use your local repo for testing
143
+ "owner": "rexywjy",
122
144
  }
123
145
 
124
146
  # Execute the action with user token
125
- data, status = bosa.execute("github", "search_commits", token=user_token, max_attempts=1, input_=params)
126
-
127
- # Print the result
147
+ data, status = bosa.execute("github", "list_collaborators", token=user_token, max_attempts=1, input_=params)
128
148
  print(data)
129
149
  print(status)
130
150
  ```
151
+ More details about parameters and actions in bosa-api docs `{domain}/docs`
131
152
 
132
153
  ### Alternative Approach (Fluent Interface)
133
154
 
@@ -337,18 +358,25 @@ The connector includes built-in error handling for:
337
358
  The BOSA Connector supports user-based authentication which allows for user-specific actions and third-party integrations:
338
359
 
339
360
  ```python
340
- # Create a new BOSA user
361
+ # Step 1: Create a new BOSA user
341
362
  user_data = bosa.create_bosa_user("username")
342
363
  # Save the secret for later use
343
364
  user_secret = user_data.secret
344
365
 
345
- # Authenticate a user and get their token
366
+ # Step 2: Authenticate the user and obtain their token
346
367
  token = bosa.authenticate_bosa_user("username", user_secret)
347
368
 
348
- # Get user information
369
+ # Step 3: Retrieve user information using the obtained token
349
370
  user_info = bosa.get_user_info(token.token)
350
371
  ```
351
372
 
373
+ ### ❗ Important Notes
374
+
375
+ ***🛡️ 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.
376
+
377
+ ***⚠️ 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.
378
+
379
+
352
380
  ## Integration Management
353
381
 
354
382
  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.cp312-win_amd64.pyd,sha256=jtIegp5srJ-pxdWDVPZaANFggSLF4iSXinObm8tZePI,853504
3
+ bosa_connectors.pyi,sha256=klto3AY3o5l8lA5NKYApY68UZ8FyQR07O37aQafpJZA,676
4
+ bosa_connectors_binary-0.1.0.dist-info/METADATA,sha256=bPYRcYCOilmkZllXZIKw-8MZOQIaU6KFvMpY2bnrLDw,16082
5
+ bosa_connectors_binary-0.1.0.dist-info/WHEEL,sha256=4N0hGcnWMI_Ty6ATf4qJqqSl-UNI-Ln828iTWGIywmU,98
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.cp312-win_amd64.pyd,sha256=2nGKJZd87T8-P2Udhyf6mkSKel_4T2QA0pqVtSbKz0M,825856
3
- bosa_connectors.pyi,sha256=DVKPEVM_E3Q_f92puZ_mV4XD7Beo4LYPSEnoYz_BPKE,627
4
- bosa_connectors_binary-0.0.10.dist-info/METADATA,sha256=nJAWEce4l6JoF2rqwM2hRu-Q4Wd1OjET1XbmbxcqqGs,14599
5
- bosa_connectors_binary-0.0.10.dist-info/WHEEL,sha256=4N0hGcnWMI_Ty6ATf4qJqqSl-UNI-Ln828iTWGIywmU,98
6
- bosa_connectors_binary-0.0.10.dist-info/RECORD,,