wexa-sdk 0.1.2__py3-none-any.whl → 0.1.6__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.
wexa_sdk/agentflows.py CHANGED
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  from typing import Optional, TypedDict
2
3
  from .core.http import HttpClient
3
4
 
@@ -73,3 +74,49 @@ class AgentFlows:
73
74
 
74
75
  def update(self, id: str, body: dict):
75
76
  return self.http.request("PUT", f"/agentflow/{id}", json=body)
77
+
78
+ # Typed body for updating a skilled agent to enable IDE suggestions
79
+ class UpdateSkilledAgentBody(TypedDict, total=False):
80
+ """Body for updating a skilled agent within an AgentFlow.
81
+
82
+ Required (per API docs):
83
+ - role: str
84
+ - title: str
85
+ - skills: list[str]
86
+ - prompt: { template: str, variables: list, display_template: str }
87
+ - context: list
88
+ - triggers: list
89
+ - llm: { model: str, max_tokens: int, temperature: int }
90
+ - role_description: str
91
+ - memory: { memory_type: str }
92
+ - has_knowledge_base: bool
93
+ - is_user_specific_task: bool
94
+ - is_preview_mode_enabled: bool
95
+ """
96
+ role: str
97
+ title: str
98
+ skills: list[str]
99
+ prompt: dict
100
+ context: list
101
+ triggers: list
102
+ llm: dict
103
+ role_description: str
104
+ memory: dict
105
+ has_knowledge_base: bool
106
+ is_user_specific_task: bool
107
+ is_preview_mode_enabled: bool
108
+
109
+ def update_skilled_agent(self, agentflow_id: str, agent_id: str, *, projectID: str, body: UpdateSkilledAgentBody | dict):
110
+ """Update a skilled agent within an AgentFlow.
111
+
112
+ Endpoint: POST /agentflow/{agentflow_id}/update/skilled/{agent_id}?projectID=...
113
+
114
+ Args:
115
+ agentflow_id: ID of the AgentFlow
116
+ agent_id: ID of the skilled agent inside the AgentFlow
117
+ projectID: Project ID (query param, required)
118
+ body: Update payload, see UpdateSkilledAgentBody for suggested keys
119
+ """
120
+ params = {"projectID": projectID} if projectID else None
121
+ path = f"/agentflow/{agentflow_id}/update/skilled/{agent_id}"
122
+ return self.http.request("POST", path, params=params, json=body)
@@ -1,9 +1,35 @@
1
1
  from __future__ import annotations
2
- from typing import Any, Optional
2
+ from typing import Any, Optional, TypedDict
3
3
 
4
4
  from ..core.http import HttpClient
5
5
  from .google_drive import GoogleDrive
6
6
 
7
+ class ConnectorConfigBody(TypedDict, total=False):
8
+ """JSON body for configuring a connector via POST /actions/{CATEGORY}/config.
9
+
10
+ Required by backend (typical fields):
11
+ - name: str
12
+ - description: str
13
+ - category: str
14
+ - org_id: str
15
+ - projectID: str # NOTE: camelCase as required by backend
16
+ - logo: str
17
+ - ui_form: list
18
+
19
+ Optional/variable:
20
+ - config: dict
21
+ - enabled: bool
22
+ """
23
+ name: str
24
+ description: str
25
+ category: str
26
+ org_id: str
27
+ projectID: str
28
+ logo: str
29
+ ui_form: list
30
+ config: dict
31
+ enabled: bool
32
+
7
33
  class Connectors:
8
34
  def __init__(self, http: HttpClient):
9
35
  self.http = http
@@ -16,8 +42,10 @@ class Connectors:
16
42
  return self.http.request("POST", path, params=params, json=body)
17
43
 
18
44
  # POST /actions/{CATEGORY}/config?projectID=...
19
- def set_config(self, category: str, project_id: str, body: dict) -> Any:
20
- return self.http.request("POST", f"/actions/{category}/config", params={"projectID": project_id}, json=body)
45
+ def set_config(self, category: str, project_id: str, body: ConnectorConfigBody | dict) -> Any:
46
+ # Ensure body contains the required camelCase field expected by the backend
47
+ json_body = {**(body or {}), "projectID": project_id}
48
+ return self.http.request("POST", f"/actions/{category}/config", params={"projectID": project_id}, json=json_body)
21
49
 
22
50
  # GET /actions/{CATEGORY}/config/{projectID}
23
51
  def get_config(self, category: str, project_id: str) -> Any:
wexa_sdk/projects.py CHANGED
@@ -29,7 +29,9 @@ class Projects:
29
29
  # Per developers.wexa.ai: POST https://api.wexa.ai/v1/project
30
30
  def create(self, body: ProjectCreateBody):
31
31
  """
32
- Expected body (example):
32
+ Create a project with a request body.
33
+
34
+ Example body:
33
35
  {
34
36
  "orgId": "67fdea40aac77be632954f0f",
35
37
  "projectName": "New",
@@ -49,10 +51,7 @@ class Projects:
49
51
  coworker_role: Optional[str] = None,
50
52
  status: Optional[str] = None,
51
53
  ):
52
- """Convenience wrapper with explicit kwargs for IDE hints.
53
-
54
- Builds the request body and calls create().
55
- """
54
+ """Convenience wrapper: builds the body and calls create(body)."""
56
55
  body: Dict[str, Any] = {"orgId": orgId, "projectName": projectName}
57
56
  if description is not None:
58
57
  body["description"] = description
@@ -79,6 +78,40 @@ class Projects:
79
78
  params = {"userId": user_id}
80
79
  return self.http.request("GET", "/v1/project/all", params=params)
81
80
 
81
+ def get_all(
82
+ self,
83
+ *,
84
+ status: Optional[str] = None,
85
+ user_id: Optional[str] = None,
86
+ org_id: Optional[str] = None,
87
+ page: Optional[int] = None,
88
+ limit: Optional[int] = None,
89
+ ):
90
+ """
91
+ Get all projects with optional filters and pagination.
92
+ GET /v1/project?status=...&userId=...&orgId=...&page=...&limit=...
93
+
94
+ Args:
95
+ status: Optional project status filter (e.g., "published").
96
+ user_id: Optional user filter.
97
+ org_id: Optional organization filter.
98
+ page: Optional page number (int).
99
+ limit: Optional page size (int).
100
+ """
101
+ params: Dict[str, Any] = {}
102
+ if status is not None:
103
+ params["status"] = status
104
+ if user_id is not None:
105
+ params["userId"] = user_id
106
+ if org_id is not None:
107
+ params["orgId"] = org_id
108
+ if page is not None:
109
+ params["page"] = page
110
+ if limit is not None:
111
+ params["limit"] = limit
112
+
113
+ return self.http.request("GET", "/v1/project", params=params)
114
+
82
115
  def get(self, project_id: str):
83
116
  return self.http.request("GET", f"/v1/project/{project_id}")
84
117
 
wexa_sdk/tables.py CHANGED
@@ -1,14 +1,70 @@
1
1
  from __future__ import annotations
2
- from typing import Any, Optional
2
+ from typing import Any, Optional, TypedDict, List, Dict, Union
3
3
 
4
4
  from .core.http import HttpClient
5
5
 
6
+ class ObjectField(TypedDict, total=False):
7
+ """Field descriptor for object-type columns."""
8
+ key: str
9
+ keyType: str
10
+
11
+
12
+ class AgentflowTrigger(TypedDict, total=False):
13
+ """Trigger configuration attached to a table or column.
14
+
15
+ Note: exact schemas for `condition` and `filters` may evolve; we leave them open.
16
+ """
17
+ _id: str
18
+ id: str
19
+ condition: Dict[str, Any]
20
+ name: Optional[str]
21
+ goal: str
22
+ agentflow_id: Optional[str]
23
+ filters: List[Dict[str, Any]]
24
+ schedule_time: Optional[str]
25
+ event: str
26
+ start_from_agent_id: Optional[str]
27
+ trigger_type: str # e.g. "coworker"
28
+
29
+
30
+ class Column(TypedDict, total=False):
31
+ """Column definition for a table."""
32
+ column_name: str
33
+ column_type: str
34
+ column_id: str
35
+ array_type: Optional[str]
36
+ default_value: Union[Any, List[Any], Dict[str, Any]]
37
+ object_fields: List[ObjectField]
38
+ triggers: List[AgentflowTrigger]
39
+ enum_options: List[str]
40
+
41
+
42
+ class CreateTableInput(TypedDict, total=False):
43
+ """Typed input for creating a table.
44
+
45
+ Required keys: projectID, table_name
46
+ Optional keys: columns, triggers
47
+ """
48
+ projectID: str
49
+ table_name: str
50
+ columns: List[Column]
51
+ triggers: List[AgentflowTrigger]
52
+
53
+
6
54
  class Tables:
7
55
  def __init__(self, http: HttpClient):
8
56
  self.http = http
9
57
 
10
58
  # Tables
11
- def create_table(self, project_id: str, spec: dict):
59
+ def create_table(self, project_id: str, spec: CreateTableInput):
60
+ """Create a new table.
61
+
62
+ Args:
63
+ project_id: The project ID (placed into query as `projectID`).
64
+ spec: Table specification containing at least `table_name`.
65
+
66
+ The backend expects `projectID` in both query params and JSON body.
67
+ """
12
68
  # API expects projectID as query param and in body with 'projectID' casing
13
69
  params = {"projectID": project_id}
14
70
  body = {"projectID": project_id, **spec}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wexa-sdk
3
- Version: 0.1.2
3
+ Version: 0.1.6
4
4
  Summary: Official Wexa Python SDK
5
5
  Author: Wexa
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
1
  wexa_sdk/__init__.py,sha256=dNvZ0fU4v0clBOuZWdd02SLxVfrBF2Ig-efQMOweq-I,1627
2
- wexa_sdk/agentflows.py,sha256=_1DJYXVi6Jyj9-jn0UtO1C7X_sdTcfdp0qdMtQZPQKo,2543
2
+ wexa_sdk/agentflows.py,sha256=G6F0TLTiSYFC0b9vJhHl-uClOhE9nXGjDENmiTz99FU,4351
3
3
  wexa_sdk/analytics.py,sha256=PVWvRvuyxOAbwxxAoILquESyb2Jw3cJGogbBu2ATRH4,345
4
4
  wexa_sdk/connectors_mgmt.py,sha256=7vCT4ilez2YjZnfFEzb0raglTwweqxomqtJOb36RVT4,2229
5
5
  wexa_sdk/executions.py,sha256=-bVXo7ESA8AYZtc-tPDi28qWKJg_eYEQCo1kSYgE1P8,2509
@@ -7,18 +7,18 @@ wexa_sdk/files.py,sha256=K2m6gxs_8XDhlW4W08DhSc-HwrMx3r2S5dOFvltLTqc,1235
7
7
  wexa_sdk/inbox.py,sha256=aKFmST2FX09mDYXyrqNpUYTsq6z0iJG4qtsCeMWKPdo,1957
8
8
  wexa_sdk/marketplace.py,sha256=jhpeSWLU_BLFJcbwx_vcLeUff3UEPkylyhVIm_Fcb5Y,1609
9
9
  wexa_sdk/project_members.py,sha256=TssDroghwYMsPRibZ1dNvKynzMtgIUN1TDFsmc2AuW4,514
10
- wexa_sdk/projects.py,sha256=zx5ncmhxbwSiFKU0QpVA01eKNxQW2zPYzPV_njGUCrc,2937
10
+ wexa_sdk/projects.py,sha256=RkatvCK-IdBXk5pc71HAkCi08p04ez_04nBbsMMpogs,4031
11
11
  wexa_sdk/settings.py,sha256=TDnqYeFBvrrj9kznTUTJxG29sJ02bHxBlqE55DgIfTg,290
12
12
  wexa_sdk/skills.py,sha256=ZOFdspJsns_X88nBMrhaFWWcTKuh5afk0hK73-Qzs9M,1799
13
- wexa_sdk/tables.py,sha256=JYGK1zWRWZgZGbiRyv-ko3XKdpxZv0piwb02h0v5ODw,2753
13
+ wexa_sdk/tables.py,sha256=nS2QMePJEkEC-VzrIIZLmf8LruqD83PfjyDHif5vEZE,4307
14
14
  wexa_sdk/tasks.py,sha256=YRXMxQwgpiflAxyUqedyo4LB6bsO7zsiM5uP0uE8_Ds,1349
15
15
  wexa_sdk/connectors/__init__.py,sha256=eEtSQ8oXlYnoD3CUxPCF3Il6bgGyN6zfKI3_Pu41jXo,51
16
- wexa_sdk/connectors/core.py,sha256=4dFp0CVCysUsIOT7l9V7bzXu1jRx9EBGZv2_bQkKPsQ,1188
16
+ wexa_sdk/connectors/core.py,sha256=7ghbFAPR1emgBL9PWStDp6AgZ5JDkiBWXQGaZ0B5Fek,1978
17
17
  wexa_sdk/connectors/google_drive.py,sha256=Dibfoy8uKcGygmjCnrolPhKq5Fy5ye5-ee_kI4XD7kY,945
18
18
  wexa_sdk/core/__init__.py,sha256=K-bUeDdR3iblN9BNwMQ-ZMbOcAJSAUkNwuoVz5L3fC4,39
19
19
  wexa_sdk/core/http.py,sha256=4O59C5VlVhxaQNkjJ0UpARZk3g-rEoOxEbwE0u9NWbY,3721
20
20
  wexa_sdk/models/__init__.py,sha256=yxQUjah8RTJh531y8QQXEeh5dp0d5k55dsrVvR4O1N8,75
21
- wexa_sdk-0.1.2.dist-info/METADATA,sha256=hIdfzWXxN8YiHvOXe2688JcF0V6fl4IhOr-D84UWXNE,581
22
- wexa_sdk-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- wexa_sdk-0.1.2.dist-info/top_level.txt,sha256=iXL6c0Kro-mkIoNbjT76txRuoilWB-P7AHhmvKtdXkA,9
24
- wexa_sdk-0.1.2.dist-info/RECORD,,
21
+ wexa_sdk-0.1.6.dist-info/METADATA,sha256=Jux9cTUOZgJbd2TNMREAyVwev-v8-k29eV1Kvs-JgJA,581
22
+ wexa_sdk-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ wexa_sdk-0.1.6.dist-info/top_level.txt,sha256=iXL6c0Kro-mkIoNbjT76txRuoilWB-P7AHhmvKtdXkA,9
24
+ wexa_sdk-0.1.6.dist-info/RECORD,,