lexsi-sdk 0.1.16__py3-none-any.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.
- lexsi_sdk/__init__.py +5 -0
- lexsi_sdk/client/__init__.py +0 -0
- lexsi_sdk/client/client.py +176 -0
- lexsi_sdk/common/__init__.py +0 -0
- lexsi_sdk/common/config/.env.prod +3 -0
- lexsi_sdk/common/constants.py +143 -0
- lexsi_sdk/common/enums.py +8 -0
- lexsi_sdk/common/environment.py +49 -0
- lexsi_sdk/common/monitoring.py +81 -0
- lexsi_sdk/common/trigger.py +75 -0
- lexsi_sdk/common/types.py +122 -0
- lexsi_sdk/common/utils.py +93 -0
- lexsi_sdk/common/validation.py +110 -0
- lexsi_sdk/common/xai_uris.py +197 -0
- lexsi_sdk/core/__init__.py +0 -0
- lexsi_sdk/core/agent.py +62 -0
- lexsi_sdk/core/alert.py +56 -0
- lexsi_sdk/core/case.py +618 -0
- lexsi_sdk/core/dashboard.py +131 -0
- lexsi_sdk/core/guardrails/__init__.py +0 -0
- lexsi_sdk/core/guardrails/guard_template.py +299 -0
- lexsi_sdk/core/guardrails/guardrail_autogen.py +554 -0
- lexsi_sdk/core/guardrails/guardrails_langgraph.py +525 -0
- lexsi_sdk/core/guardrails/guardrails_openai.py +541 -0
- lexsi_sdk/core/guardrails/openai_runner.py +1328 -0
- lexsi_sdk/core/model_summary.py +110 -0
- lexsi_sdk/core/organization.py +549 -0
- lexsi_sdk/core/project.py +5131 -0
- lexsi_sdk/core/synthetic.py +387 -0
- lexsi_sdk/core/text.py +595 -0
- lexsi_sdk/core/tracer.py +208 -0
- lexsi_sdk/core/utils.py +36 -0
- lexsi_sdk/core/workspace.py +325 -0
- lexsi_sdk/core/wrapper.py +766 -0
- lexsi_sdk/core/xai.py +306 -0
- lexsi_sdk/version.py +34 -0
- lexsi_sdk-0.1.16.dist-info/METADATA +100 -0
- lexsi_sdk-0.1.16.dist-info/RECORD +40 -0
- lexsi_sdk-0.1.16.dist-info/WHEEL +5 -0
- lexsi_sdk-0.1.16.dist-info/top_level.txt +1 -0
lexsi_sdk/core/xai.py
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
import httpx
|
|
5
|
+
import pandas as pd
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
import requests
|
|
8
|
+
from lexsi_sdk.client.client import APIClient
|
|
9
|
+
from lexsi_sdk.common.environment import Environment
|
|
10
|
+
from lexsi_sdk.core.organization import Organization
|
|
11
|
+
from lexsi_sdk.common.xai_uris import (
|
|
12
|
+
AVAILABLE_BATCH_SERVERS_URI,
|
|
13
|
+
AVAILABLE_CUSTOM_SERVERS_URI,
|
|
14
|
+
AVAILABLE_SYNTHETIC_CUSTOM_SERVERS_URI,
|
|
15
|
+
CLEAR_NOTIFICATIONS_URI,
|
|
16
|
+
CREATE_ORGANIZATION_URI,
|
|
17
|
+
GET_CASE_PROFILE_URI,
|
|
18
|
+
GET_NOTIFICATIONS_URI,
|
|
19
|
+
LOGIN_URI,
|
|
20
|
+
UPLOAD_DATA_PROJECT_URI,
|
|
21
|
+
USER_ORGANIZATION_URI,
|
|
22
|
+
)
|
|
23
|
+
import getpass
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class XAI(BaseModel):
|
|
27
|
+
"""Base class to connect with Lexsi.ai platform"""
|
|
28
|
+
|
|
29
|
+
env: Environment = Environment()
|
|
30
|
+
api_client: APIClient = APIClient()
|
|
31
|
+
|
|
32
|
+
def __init__(self, **kwargs):
|
|
33
|
+
"""Initialize the API client using environment-derived settings."""
|
|
34
|
+
super().__init__(**kwargs)
|
|
35
|
+
|
|
36
|
+
debug = self.env.get_debug()
|
|
37
|
+
base_url = self.env.get_base_url()
|
|
38
|
+
|
|
39
|
+
self.api_client = APIClient(debug=debug, base_url=base_url)
|
|
40
|
+
|
|
41
|
+
def login(self):
|
|
42
|
+
"""login to Lexsi.ai platform
|
|
43
|
+
|
|
44
|
+
:param api_key: API key, defaults to XAI_ACCESS_TOKEN environment variable
|
|
45
|
+
"""
|
|
46
|
+
access_token = os.environ.get("XAI_ACCESS_TOKEN", None) or getpass.getpass(
|
|
47
|
+
"Enter your Lexsi Ai Access Token: "
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
if not access_token:
|
|
51
|
+
raise ValueError("Either set XAI_ACCESS_TOKEN or pass the Access token")
|
|
52
|
+
|
|
53
|
+
res = self.api_client.post(LOGIN_URI, payload={"access_token": access_token})
|
|
54
|
+
self.api_client.update_headers(res["access_token"])
|
|
55
|
+
self.api_client.set_access_token(access_token)
|
|
56
|
+
|
|
57
|
+
print("Authenticated successfully.")
|
|
58
|
+
|
|
59
|
+
def organizations(self) -> pd.DataFrame:
|
|
60
|
+
"""Get all organizations associated with user
|
|
61
|
+
|
|
62
|
+
:return: Organization details dataframe
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
res = self.api_client.get(USER_ORGANIZATION_URI)
|
|
66
|
+
|
|
67
|
+
if not res["success"]:
|
|
68
|
+
raise Exception(res.get("details", "Failed to get organizations"))
|
|
69
|
+
|
|
70
|
+
res["details"].insert(
|
|
71
|
+
0,
|
|
72
|
+
{
|
|
73
|
+
"name": "Personal",
|
|
74
|
+
"organization_owner": True,
|
|
75
|
+
"organization_admin": True,
|
|
76
|
+
"current_users": 1,
|
|
77
|
+
"created_by": "you",
|
|
78
|
+
},
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
organization_df = pd.DataFrame(
|
|
82
|
+
res["details"],
|
|
83
|
+
columns=[
|
|
84
|
+
"name",
|
|
85
|
+
"organization_owner",
|
|
86
|
+
"organization_admin",
|
|
87
|
+
"current_users",
|
|
88
|
+
"created_by",
|
|
89
|
+
"created_at",
|
|
90
|
+
],
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return organization_df
|
|
94
|
+
|
|
95
|
+
def organization(self, organization_name: str) -> Organization:
|
|
96
|
+
"""Select specific organization
|
|
97
|
+
|
|
98
|
+
:param organization_name: Name of the organization to be used
|
|
99
|
+
:return: Organization object
|
|
100
|
+
"""
|
|
101
|
+
if organization_name == "personal":
|
|
102
|
+
return Organization(
|
|
103
|
+
api_client=self.api_client,
|
|
104
|
+
**{
|
|
105
|
+
"name": "Personal",
|
|
106
|
+
"organization_owner": True,
|
|
107
|
+
"organization_admin": True,
|
|
108
|
+
"current_users": 1,
|
|
109
|
+
"created_by": "you",
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
organizations = self.api_client.get(USER_ORGANIZATION_URI)
|
|
114
|
+
|
|
115
|
+
if not organizations["success"]:
|
|
116
|
+
raise Exception(organizations.get("details", "Failed to get organizations"))
|
|
117
|
+
|
|
118
|
+
user_organization = [
|
|
119
|
+
Organization(api_client=self.api_client, **organization)
|
|
120
|
+
for organization in organizations["details"]
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
organization = next(
|
|
124
|
+
filter(
|
|
125
|
+
lambda organization: organization.name == organization_name,
|
|
126
|
+
user_organization,
|
|
127
|
+
),
|
|
128
|
+
None,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
if organization is None:
|
|
132
|
+
raise Exception("Organization Not Found")
|
|
133
|
+
|
|
134
|
+
return organization
|
|
135
|
+
|
|
136
|
+
def create_organization(self, organization_name: str) -> Organization:
|
|
137
|
+
"""Create New Organization
|
|
138
|
+
|
|
139
|
+
:param organization_name: Name of the new organization
|
|
140
|
+
:return: Organization object
|
|
141
|
+
"""
|
|
142
|
+
payload = {"organization_name": organization_name}
|
|
143
|
+
res = self.api_client.post(CREATE_ORGANIZATION_URI, payload)
|
|
144
|
+
|
|
145
|
+
if not res["success"]:
|
|
146
|
+
raise Exception(res.get("details", "Failed to create organization"))
|
|
147
|
+
|
|
148
|
+
return Organization(api_client=self.api_client, **res["organization_details"])
|
|
149
|
+
|
|
150
|
+
def get_notifications(self) -> pd.DataFrame:
|
|
151
|
+
"""get user notifications
|
|
152
|
+
|
|
153
|
+
:return: notification details dataFrame
|
|
154
|
+
"""
|
|
155
|
+
res = self.api_client.get(GET_NOTIFICATIONS_URI)
|
|
156
|
+
|
|
157
|
+
if not res["success"]:
|
|
158
|
+
raise Exception("Error while getting user notifications.")
|
|
159
|
+
|
|
160
|
+
notifications = res["details"]
|
|
161
|
+
|
|
162
|
+
if not notifications:
|
|
163
|
+
return "No notifications found."
|
|
164
|
+
|
|
165
|
+
return pd.DataFrame(notifications).reindex(
|
|
166
|
+
columns=["project_name", "message", "time"]
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def clear_notifications(self) -> str:
|
|
170
|
+
"""clear user notifications
|
|
171
|
+
|
|
172
|
+
:return: response
|
|
173
|
+
"""
|
|
174
|
+
res = self.api_client.post(CLEAR_NOTIFICATIONS_URI)
|
|
175
|
+
|
|
176
|
+
if not res["success"]:
|
|
177
|
+
raise Exception("Error while clearing user notifications.")
|
|
178
|
+
|
|
179
|
+
return res["details"]
|
|
180
|
+
|
|
181
|
+
def available_batch_servers(self) -> dict:
|
|
182
|
+
"""available custom batch servers
|
|
183
|
+
|
|
184
|
+
:return: response
|
|
185
|
+
"""
|
|
186
|
+
res = self.api_client.get(AVAILABLE_BATCH_SERVERS_URI)
|
|
187
|
+
return res["details"]
|
|
188
|
+
|
|
189
|
+
def available_custom_servers(self) -> dict:
|
|
190
|
+
"""available custom servers
|
|
191
|
+
|
|
192
|
+
:return: response
|
|
193
|
+
"""
|
|
194
|
+
res = self.api_client.get(AVAILABLE_CUSTOM_SERVERS_URI)
|
|
195
|
+
return res
|
|
196
|
+
|
|
197
|
+
def available_synthetic_custom_servers(self) -> dict:
|
|
198
|
+
"""available synthetic custom servers
|
|
199
|
+
|
|
200
|
+
:return: response
|
|
201
|
+
"""
|
|
202
|
+
res = self.api_client.get(AVAILABLE_SYNTHETIC_CUSTOM_SERVERS_URI)
|
|
203
|
+
return res["details"]
|
|
204
|
+
|
|
205
|
+
def register_case(
|
|
206
|
+
self,
|
|
207
|
+
token: str,
|
|
208
|
+
client_id: str,
|
|
209
|
+
unique_identifier: Optional[str] = None,
|
|
210
|
+
project_name: str = None,
|
|
211
|
+
tag: Optional[str] = None,
|
|
212
|
+
data: Optional[str] = None,
|
|
213
|
+
processed_data: Optional[bool] = False,
|
|
214
|
+
merge: Optional[bool] = False,
|
|
215
|
+
image_class: Optional[str] = None,
|
|
216
|
+
prompt: Optional[str] = None,
|
|
217
|
+
serverless_instance_type: Optional[str] = None,
|
|
218
|
+
explainability_method: Optional[str] = None,
|
|
219
|
+
explain_model: Optional[bool] = False,
|
|
220
|
+
session_id: Optional[str] = None,
|
|
221
|
+
xai: Optional[str] = None,
|
|
222
|
+
file_path: Optional[str] = None
|
|
223
|
+
):
|
|
224
|
+
"""Register a new case entry with raw or processed payloads."""
|
|
225
|
+
form_data = {
|
|
226
|
+
"client_id": client_id,
|
|
227
|
+
"project_name": project_name,
|
|
228
|
+
"unique_identifier": unique_identifier,
|
|
229
|
+
"tag": tag,
|
|
230
|
+
"data": json.dumps(data) if isinstance(data, list) else data,
|
|
231
|
+
"processed_data": str(processed_data).lower(),
|
|
232
|
+
"merge": str(merge).lower(),
|
|
233
|
+
"image_class": image_class,
|
|
234
|
+
"prompt": prompt,
|
|
235
|
+
"serverless_instance_type": serverless_instance_type,
|
|
236
|
+
"explainability_method": explainability_method,
|
|
237
|
+
"explain_model": str(explain_model).lower(),
|
|
238
|
+
"session_id": str(session_id).lower(),
|
|
239
|
+
"xai": xai
|
|
240
|
+
}
|
|
241
|
+
headers = {
|
|
242
|
+
"x-api-token": token
|
|
243
|
+
}
|
|
244
|
+
form_data = {k: v for k, v in form_data.items() if v is not None}
|
|
245
|
+
files = {}
|
|
246
|
+
if file_path:
|
|
247
|
+
files["in_file"] = open(file_path, "rb")
|
|
248
|
+
# response = requests.post(
|
|
249
|
+
# self.env.get_base_url() + "/" + UPLOAD_DATA_PROJECT_URI,
|
|
250
|
+
# data=form_data,
|
|
251
|
+
# files=files if files else None,
|
|
252
|
+
# headers=headers
|
|
253
|
+
# ).json()
|
|
254
|
+
|
|
255
|
+
with httpx.Client(http2=True, timeout=None) as client:
|
|
256
|
+
response = client.post(
|
|
257
|
+
self.env.get_base_url() + "/" + UPLOAD_DATA_PROJECT_URI,
|
|
258
|
+
data=form_data,
|
|
259
|
+
files=files or None,
|
|
260
|
+
headers=headers,
|
|
261
|
+
)
|
|
262
|
+
response.raise_for_status()
|
|
263
|
+
response = response.json()
|
|
264
|
+
|
|
265
|
+
if files:
|
|
266
|
+
files["in_file"].close()
|
|
267
|
+
return response
|
|
268
|
+
|
|
269
|
+
def case_profile(
|
|
270
|
+
self,
|
|
271
|
+
token: str,
|
|
272
|
+
client_id: str,
|
|
273
|
+
unique_identifier: Optional[str] = None,
|
|
274
|
+
project_name: str = None,
|
|
275
|
+
tag: str = None,
|
|
276
|
+
xai: Optional[List[str]] = None,
|
|
277
|
+
refresh: Optional[bool] = None
|
|
278
|
+
):
|
|
279
|
+
"""Fetch case profile details for a given identifier and tag."""
|
|
280
|
+
headers = {
|
|
281
|
+
"x-api-token": token
|
|
282
|
+
}
|
|
283
|
+
payload = {
|
|
284
|
+
"client_id": client_id,
|
|
285
|
+
"project_name": project_name,
|
|
286
|
+
"unique_identifier": unique_identifier,
|
|
287
|
+
"tag": tag,
|
|
288
|
+
"xai": xai,
|
|
289
|
+
"refresh": refresh
|
|
290
|
+
}
|
|
291
|
+
# res = requests.post(
|
|
292
|
+
# self.env.get_base_url() + "/" + GET_CASE_PROFILE_URI,
|
|
293
|
+
# headers=headers,
|
|
294
|
+
# json=payload
|
|
295
|
+
# ).json()
|
|
296
|
+
|
|
297
|
+
with httpx.Client(http2=True, timeout=None) as client:
|
|
298
|
+
res = client.post(
|
|
299
|
+
self.env.get_base_url() + "/" + GET_CASE_PROFILE_URI,
|
|
300
|
+
headers=headers,
|
|
301
|
+
json=payload,
|
|
302
|
+
)
|
|
303
|
+
res.raise_for_status()
|
|
304
|
+
res = res.json()
|
|
305
|
+
|
|
306
|
+
return res["details"]
|
lexsi_sdk/version.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '0.1.16'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 16)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lexsi-sdk
|
|
3
|
+
Version: 0.1.16
|
|
4
|
+
Summary: Full stack ML Observability with Lexsi.ai
|
|
5
|
+
Author-email: Lexsi Labs <support@lexsi.ai>
|
|
6
|
+
License: Lexsi Labs Source Available License (LSAL) v1.0
|
|
7
|
+
Keywords: lexsi,lexsi-sdk,lexsi_sdk,ML observability,observability,machine learning
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: pydantic>=1.10.13
|
|
19
|
+
Requires-Dist: httpx
|
|
20
|
+
Requires-Dist: pyjwt>=2.3.0
|
|
21
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
22
|
+
Requires-Dist: requests>=2.31.0
|
|
23
|
+
Requires-Dist: pandas>=1.5.3
|
|
24
|
+
Requires-Dist: plotly>=5.15.0
|
|
25
|
+
Requires-Dist: ipython>=7.34.0
|
|
26
|
+
Requires-Dist: Pillow>=10.4.0
|
|
27
|
+
Requires-Dist: google-genai>=1.24.0
|
|
28
|
+
Requires-Dist: anthropic>=0.57.1
|
|
29
|
+
Requires-Dist: openai>=1.93.1
|
|
30
|
+
Requires-Dist: groq>=0.29.0
|
|
31
|
+
Requires-Dist: xai-sdk>=1.0.0
|
|
32
|
+
Requires-Dist: together>=1.3.14
|
|
33
|
+
Requires-Dist: replicate>=1.0.7
|
|
34
|
+
Requires-Dist: huggingface-hub>=0.33.2
|
|
35
|
+
Requires-Dist: mistralai>=1.9.1
|
|
36
|
+
Requires-Dist: boto3>=1.39.4
|
|
37
|
+
Requires-Dist: opentelemetry-sdk>=1.36.0
|
|
38
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.36.0
|
|
39
|
+
Requires-Dist: openinference-instrumentation-langchain>=0.1.50
|
|
40
|
+
Requires-Dist: openinference-instrumentation-autogen-agentchat>=0.1.4
|
|
41
|
+
Requires-Dist: openinference-instrumentation-crewai>=0.1.11
|
|
42
|
+
Requires-Dist: openinference-instrumentation-dspy>=0.1.28
|
|
43
|
+
Requires-Dist: openinference-instrumentation-llama-index>=4.3.4
|
|
44
|
+
Requires-Dist: openinference-instrumentation-openai-agents>=1.2.0
|
|
45
|
+
Requires-Dist: openinference-instrumentation-smolagents>=0.1.16
|
|
46
|
+
Provides-Extra: docs
|
|
47
|
+
Requires-Dist: mkdocs>=1.6; extra == "docs"
|
|
48
|
+
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
|
|
49
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
|
|
50
|
+
Requires-Dist: pymdown-extensions>=10.0; extra == "docs"
|
|
51
|
+
|
|
52
|
+
## [Lexsi ai](https://lexsi.ai): ML Observability for mission-critical ‘AI’
|
|
53
|
+
|
|
54
|
+
Lexsi Ai is a full-stack ML Observability platform that integrates with your MLOPs platform to Explain, Monitor, Audit and Improve your ML models.
|
|
55
|
+
|
|
56
|
+
Lexsi Ai has multiple components to address the complex observability required for mission-critical ‘AI’.
|
|
57
|
+
|
|
58
|
+
1. **ML Explainability:** Lexsi Ai offers diverse explainability options like- Bactrace(Specialized for deep learning models), SHAPE, Decision View, Observations (New way to correlate expert functioning vs model functioning) and Similar Cases (reference as explanations).
|
|
59
|
+
2. **ML Monitoring:** Monitor your models for drifts, performance & bias. The tool offers diverse options for drift (data/model) like - PSI, KL Divergence, Chi-square test,
|
|
60
|
+
3. **Synthetic ‘AI’:** Deploy advanced synthetic ‘AI’ techniques like GPT-2 & GANs on your tabular data to generate high-quality synthetic datasets. Test the quality and privacy of these data sets using our Anonymity tests, column tests etc.
|
|
61
|
+
4. **ML Risk policies:** Define advanced risk policies on your models.
|
|
62
|
+
5. **AutoML:** Lexsi Ai also provides fully low-code and no-code options to build ML models on your data. For advanced users, it also provides more options to fine-tune it.
|
|
63
|
+
|
|
64
|
+
Lexsi Ai also acts as a common workflow and provides insights acceptable by all stakeholders - Data Science, IT, Risk, Operations and compliance teams, making the rollout and maintenance of AI/ML models seamless and clutter-free.
|
|
65
|
+
|
|
66
|
+
### Quickstart:
|
|
67
|
+
Get started with Lexsi Ai with a few easy steps:
|
|
68
|
+
|
|
69
|
+
1. Sign up and log in to your new Lexsi Ai account.
|
|
70
|
+
2. After logging in, generate an Access Token for your user account.
|
|
71
|
+
3. Set the environment variable **XAI_ACCESS_TOKEN** with the generated value.
|
|
72
|
+
|
|
73
|
+
Once you've completed these steps, you're all set! Now, you can easily log in and start using the Lexsi Ai SDK:
|
|
74
|
+
|
|
75
|
+
1. Log in by importing the "xai" object instance from the "lexsi_sdk" package.
|
|
76
|
+
2. Call the "login" method. This method automatically takes the access token value from the "XAI_ACCESS_TOKEN" environment variable and stores the JWT in the object instance. This means that all your future SDK operations will be authorized automatically, making it simple and hassle-free!
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
from lexsi_sdk import xai as lexsi
|
|
81
|
+
|
|
82
|
+
## login() function authenticates user using token that can be generated in app.lexsi_sdk.com/sdk
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
lexsi.login()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
Enter your Lexsi ai Access Token: ··········
|
|
89
|
+
Authenticated successfully.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Cookbook:
|
|
93
|
+
In this section, you can review the examples of implementation of Lexsi Ai-SDK.
|
|
94
|
+
|
|
95
|
+
1. [Full features overview of Lexsi Ai](https://colab.research.google.com/drive/1Dy5eL-FJVnFV0K5yOfGGVoAmiS_Icaz3?usp=sharing)
|
|
96
|
+
2. Using Lexsi Ai in Loan Underwriting (Coming Soon)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Contribution guidelines:
|
|
100
|
+
At Lexsi Ai, we're passionate about open source and value community contributions! Explore our contribution guide for insights into the development workflow and Lexsi Ai library internals. For bug reports or feature requests, head to GitHub Issues or reach out to us at [support@Lexsi Ai.com](support@Lexsi Ai.com).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
lexsi_sdk/__init__.py,sha256=yLsuSehO_HEGuddDqDmbyGXRKIdYzGs9En0i-1ELb3s,147
|
|
2
|
+
lexsi_sdk/version.py,sha256=Fs2Vm6Mr4ZbSKXw60jeeSx9iEU9elx4fQcMl_5xXMJI,706
|
|
3
|
+
lexsi_sdk/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
lexsi_sdk/client/client.py,sha256=jFnAkiUkSpsECetXroXld1Wf3jj1FyLpfOgaSzTh9Zs,5722
|
|
5
|
+
lexsi_sdk/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
lexsi_sdk/common/constants.py,sha256=vqsAhKlcUSeTwLQuXyLX8s4hMHtcDvFyRZ1EqTlDiiY,2705
|
|
7
|
+
lexsi_sdk/common/enums.py,sha256=oVtQBPvly9GFnbnLF9zvhc9UH1j8_mqUnRnkDtF5UIQ,145
|
|
8
|
+
lexsi_sdk/common/environment.py,sha256=zWIreENVA6-EwK5EWv6LYw01wmd8s5X0cFwRRBuT2JE,1181
|
|
9
|
+
lexsi_sdk/common/monitoring.py,sha256=P4wa3Ypxp3DqUiLE5z-zkJlwRGrD3NTlBCluEIoihfI,1797
|
|
10
|
+
lexsi_sdk/common/trigger.py,sha256=-b1SXVG7QsDVtmvdm45fSV2-WeIoKoEu29PDezH-M5Q,1611
|
|
11
|
+
lexsi_sdk/common/types.py,sha256=Nkbo2sMLy-szcvCee2j8xpM9vfpUTC7_Ns95zGmGaLg,3214
|
|
12
|
+
lexsi_sdk/common/utils.py,sha256=qH5PtzOcKPn6u-9hNFSlGNtDeBAGvqJTEWXCBDrw8lk,2933
|
|
13
|
+
lexsi_sdk/common/validation.py,sha256=IjoeOZF7txzMsr0zOZ3QSJwDIT2Q6MHEYhoE27y9RUY,4323
|
|
14
|
+
lexsi_sdk/common/xai_uris.py,sha256=mu-hw_fpx8745qBF3-Feqy4pw4V3EXiV3A5CcIny5Is,10086
|
|
15
|
+
lexsi_sdk/common/config/.env.prod,sha256=PiTaP8HHtGFF7sAgPY0S3wJtjMgGu1EJETZ2h2DkCu8,65
|
|
16
|
+
lexsi_sdk/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
lexsi_sdk/core/agent.py,sha256=sFCA3kKBdIyBDxNZT6Fslf_tvTufrFGCAG9N15Hykpw,1699
|
|
18
|
+
lexsi_sdk/core/alert.py,sha256=LV5KBLtpGmU5g2Dc0OkFTTznJp4FHC1Ev46XA-hRuMM,1700
|
|
19
|
+
lexsi_sdk/core/case.py,sha256=xuffHfVRC2AVLBnjPUJK8WmgH_UsTT7HuI1DLvWj5n4,19846
|
|
20
|
+
lexsi_sdk/core/dashboard.py,sha256=ZxbetZ_jmaHGmBY2nNqBzCqJozfd-9Wco8Y3tb9KgFc,4413
|
|
21
|
+
lexsi_sdk/core/model_summary.py,sha256=aILsrhdQCVeVtU71yW3WFXMTTf8sAYjnc9oBkUbdpyw,3487
|
|
22
|
+
lexsi_sdk/core/organization.py,sha256=kUP6-RAf63chITx2rjV-A8zEpWGOj7QzCxgovZatoM4,18972
|
|
23
|
+
lexsi_sdk/core/project.py,sha256=jlQdLxyVwFXGgJro-xdu7DRGhjVgGWIWUj-kISQDqek,186034
|
|
24
|
+
lexsi_sdk/core/synthetic.py,sha256=ItqzctgMZd-G98fmVnNLHi4sO3yGL0y70OVKpfNAP6U,11431
|
|
25
|
+
lexsi_sdk/core/text.py,sha256=bbfu-SIthVnuvwEGTFeruQJAU1YHGSwgBnnMFKGgwTY,20172
|
|
26
|
+
lexsi_sdk/core/tracer.py,sha256=LxcgD6mmlyFdzsqA3aa99iXb0ljMF8nDeNgfPcedfnc,9258
|
|
27
|
+
lexsi_sdk/core/utils.py,sha256=qaxINJKVvhtIV90FDA2NyXyCEmnP82MSipIx5lwgC7Y,1452
|
|
28
|
+
lexsi_sdk/core/workspace.py,sha256=7wbkF9tFwqy0vn0fQekR5eCJbMi7vgF-pAyK2OEESh0,10581
|
|
29
|
+
lexsi_sdk/core/wrapper.py,sha256=Tqwyp_n5wsk50nNSTpE9wL6NzolbWz7JG_OIc7uKZII,33109
|
|
30
|
+
lexsi_sdk/core/xai.py,sha256=SCbHVmWn28IQKU9IVnE4nUYpR2dQEMlc-iAbMBmqMGA,9925
|
|
31
|
+
lexsi_sdk/core/guardrails/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
+
lexsi_sdk/core/guardrails/guard_template.py,sha256=6o48oHEBnYZrWAZ6eMvHZRGX2YOUUykWWgCa1cqFJUw,8572
|
|
33
|
+
lexsi_sdk/core/guardrails/guardrail_autogen.py,sha256=-PKnauWtcA0_z_SVTjzkvMOU5FwxCeF30xX-L4GKWic,25183
|
|
34
|
+
lexsi_sdk/core/guardrails/guardrails_langgraph.py,sha256=lJDXXbjSTb4NvhmdnRs-XLECmZu1E66k6EZc4rP_Dqg,24972
|
|
35
|
+
lexsi_sdk/core/guardrails/guardrails_openai.py,sha256=9eVzNAPry1EzF1H2HVuqBIRzpdmfi65VoEc6qWtXsQE,25062
|
|
36
|
+
lexsi_sdk/core/guardrails/openai_runner.py,sha256=6DV-u9E5MEPq6NSrJYywTipLpc9l5bbgy0RhVBSvY0A,54433
|
|
37
|
+
lexsi_sdk-0.1.16.dist-info/METADATA,sha256=YxZiBERQ6305sBQidlzYHE4EPHJGgHvaO6nrAGhuq6U,5260
|
|
38
|
+
lexsi_sdk-0.1.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
39
|
+
lexsi_sdk-0.1.16.dist-info/top_level.txt,sha256=2zF9T78ZDgJfZvOWKkuSFDqR5LZGAmIx9sFPhSsT5Yk,10
|
|
40
|
+
lexsi_sdk-0.1.16.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lexsi_sdk
|