agentic-fabriq-sdk 0.1.21__py3-none-any.whl → 0.1.22__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.
Potentially problematic release.
This version of agentic-fabriq-sdk might be problematic. Click here for more details.
- af_sdk/auth/applications.py +1 -1
- af_sdk/fabriq_client.py +0 -79
- {agentic_fabriq_sdk-0.1.21.dist-info → agentic_fabriq_sdk-0.1.22.dist-info}/METADATA +5 -5
- {agentic_fabriq_sdk-0.1.21.dist-info → agentic_fabriq_sdk-0.1.22.dist-info}/RECORD +6 -6
- {agentic_fabriq_sdk-0.1.21.dist-info → agentic_fabriq_sdk-0.1.22.dist-info}/WHEEL +0 -0
- {agentic_fabriq_sdk-0.1.21.dist-info → agentic_fabriq_sdk-0.1.22.dist-info}/entry_points.txt +0 -0
af_sdk/auth/applications.py
CHANGED
|
@@ -51,7 +51,7 @@ async def get_application_client(
|
|
|
51
51
|
|
|
52
52
|
Example:
|
|
53
53
|
>>> client = await get_application_client("my-slack-bot")
|
|
54
|
-
>>> result = await client.
|
|
54
|
+
>>> result = await client.invoke_connection("my-slack", method="post_message", parameters={...})
|
|
55
55
|
"""
|
|
56
56
|
# 1. Load application config
|
|
57
57
|
try:
|
af_sdk/fabriq_client.py
CHANGED
|
@@ -78,85 +78,6 @@ class FabriqClient:
|
|
|
78
78
|
r = await self._http.get("/tools", params=params, headers=self._extra_headers)
|
|
79
79
|
return r.json()
|
|
80
80
|
|
|
81
|
-
async def invoke_tool(
|
|
82
|
-
self,
|
|
83
|
-
tool_identifier: str,
|
|
84
|
-
*,
|
|
85
|
-
method: str,
|
|
86
|
-
parameters: Optional[Dict[str, Any]] = None,
|
|
87
|
-
context: Optional[Dict[str, Any]] = None,
|
|
88
|
-
connection_id: Optional[str] = None,
|
|
89
|
-
) -> Dict[str, Any]:
|
|
90
|
-
"""Invoke a tool by name or UUID.
|
|
91
|
-
|
|
92
|
-
Args:
|
|
93
|
-
tool_identifier: Tool name (e.g., 'slack') or UUID
|
|
94
|
-
method: Method name to invoke
|
|
95
|
-
parameters: Method parameters
|
|
96
|
-
context: Additional context
|
|
97
|
-
connection_id: Specific connection ID to use (for multi-connection tools)
|
|
98
|
-
|
|
99
|
-
Returns:
|
|
100
|
-
Tool invocation result
|
|
101
|
-
|
|
102
|
-
Examples:
|
|
103
|
-
result = await client.invoke_tool("slack", method="get_channels")
|
|
104
|
-
result = await client.invoke_tool("slack", method="post_message",
|
|
105
|
-
parameters={"channel": "test", "text": "Hello!"})
|
|
106
|
-
result = await client.invoke_tool("slack", method="get_channels",
|
|
107
|
-
connection_id="slacker")
|
|
108
|
-
"""
|
|
109
|
-
# Try to resolve tool name to UUID if not already a UUID
|
|
110
|
-
tool_id = tool_identifier
|
|
111
|
-
try:
|
|
112
|
-
from uuid import UUID
|
|
113
|
-
UUID(tool_identifier)
|
|
114
|
-
# It's already a UUID, use it directly
|
|
115
|
-
except ValueError:
|
|
116
|
-
# Not a UUID, try to look up by name
|
|
117
|
-
try:
|
|
118
|
-
tools_response = await self.list_tools()
|
|
119
|
-
except Exception as e:
|
|
120
|
-
raise ValueError(f"Failed to list tools for name resolution: {e}. Please use UUID directly.")
|
|
121
|
-
|
|
122
|
-
# Handle different response formats
|
|
123
|
-
if isinstance(tools_response, dict) and "tools" in tools_response:
|
|
124
|
-
tools = tools_response["tools"]
|
|
125
|
-
elif isinstance(tools_response, dict) and "items" in tools_response:
|
|
126
|
-
tools = tools_response["items"]
|
|
127
|
-
elif hasattr(tools_response, '__iter__') and not isinstance(tools_response, (str, dict)):
|
|
128
|
-
tools = list(tools_response)
|
|
129
|
-
else:
|
|
130
|
-
tools = []
|
|
131
|
-
|
|
132
|
-
# Find tool by name (case-insensitive)
|
|
133
|
-
matching_tools = [t for t in tools if isinstance(t, dict) and t.get("name", "").lower() == tool_identifier.lower()]
|
|
134
|
-
|
|
135
|
-
if not matching_tools:
|
|
136
|
-
available = [t.get('name') for t in tools if isinstance(t, dict) and t.get('name')]
|
|
137
|
-
raise ValueError(f"Tool '{tool_identifier}' not found. Available tools: {available}")
|
|
138
|
-
|
|
139
|
-
if len(matching_tools) > 1:
|
|
140
|
-
raise ValueError(f"Multiple tools found with name '{tool_identifier}'. Please use UUID instead.")
|
|
141
|
-
|
|
142
|
-
tool_id = matching_tools[0].get("id")
|
|
143
|
-
if not tool_id:
|
|
144
|
-
raise ValueError(f"Tool '{tool_identifier}' found but has no ID")
|
|
145
|
-
|
|
146
|
-
body = {"method": method}
|
|
147
|
-
if parameters is not None:
|
|
148
|
-
body["parameters"] = parameters
|
|
149
|
-
|
|
150
|
-
# Add connection_id to context if provided
|
|
151
|
-
if context is not None or connection_id is not None:
|
|
152
|
-
ctx = (context or {}).copy()
|
|
153
|
-
if connection_id is not None:
|
|
154
|
-
ctx["connection_id"] = connection_id
|
|
155
|
-
body["context"] = ctx
|
|
156
|
-
|
|
157
|
-
r = await self._http.post(f"/tools/{tool_id}/invoke", json=body, headers=self._extra_headers)
|
|
158
|
-
return r.json()
|
|
159
|
-
|
|
160
81
|
async def invoke_connection(
|
|
161
82
|
self,
|
|
162
83
|
connection_id: str,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentic-fabriq-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.22
|
|
4
4
|
Summary: Agentic Fabriq SDK: high-level client, CLI tool, DX helpers, and auth for AI agents
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: fabriq,agentic-fabriq,sdk,ai,agents,agentic,fabric,cli
|
|
@@ -88,12 +88,12 @@ async def main():
|
|
|
88
88
|
tools = await af.list_tools()
|
|
89
89
|
agents = await af.list_agents()
|
|
90
90
|
|
|
91
|
-
# Invoke tools
|
|
92
|
-
result = await af.
|
|
91
|
+
# Invoke tools using connection ID
|
|
92
|
+
result = await af.invoke_connection("my-slack", method="get_channels")
|
|
93
93
|
|
|
94
94
|
# Or post a message
|
|
95
|
-
await af.
|
|
96
|
-
"slack",
|
|
95
|
+
await af.invoke_connection(
|
|
96
|
+
"my-slack",
|
|
97
97
|
method="post_message",
|
|
98
98
|
parameters={"channel": "test", "text": "Hello from SDK!"}
|
|
99
99
|
)
|
|
@@ -15,7 +15,7 @@ af_cli/core/token_storage.py,sha256=WhOQLx5_9pn2lAlFX01Y5DmWO7B9BJYfEkASCsBQwaI,
|
|
|
15
15
|
af_cli/main.py,sha256=zFbbUhgmpGRp9VBGOyzSIK4NlguGsBI_SqZchyOu5Xc,5100
|
|
16
16
|
af_sdk/__init__.py,sha256=uKLl3Sqlg_TgmGZtI0Tt14JNXIhdHSb6dplw6acBDvU,1569
|
|
17
17
|
af_sdk/auth/__init__.py,sha256=laIiIwgxy0mEgRoXEakoEs7BuUYnyrlzHJbdf8Sqa5E,1137
|
|
18
|
-
af_sdk/auth/applications.py,sha256=
|
|
18
|
+
af_sdk/auth/applications.py,sha256=Tc5j47S5WWGFPOhsjEI40SZuCd5ynzzAohy1NS0DyAM,7474
|
|
19
19
|
af_sdk/auth/dpop.py,sha256=s0uiyxxuzsVQNtSexji1htJoxrALwlf1P9507xa-M3Y,1285
|
|
20
20
|
af_sdk/auth/oauth.py,sha256=WRTrrBzs9ieiNnWfxagP6Ag4oI9k0soYjEkjfS2y5Lg,8120
|
|
21
21
|
af_sdk/auth/token_cache.py,sha256=X36E6K0lWqMAqlJXC3i343y8oy-uFm1q-FEdVKXdL1Y,11300
|
|
@@ -27,7 +27,7 @@ af_sdk/dx/decorators.py,sha256=o_EmvE_8pp2vTgMJMgfTy5SXG_24yabuKdoytah02Hk,1294
|
|
|
27
27
|
af_sdk/dx/runtime.py,sha256=5oowtdWtTr12odBz6pXKexSVKf2smfQDw71-jBDKr8A,2471
|
|
28
28
|
af_sdk/events.py,sha256=onz1wWwATpm71HFfcEJLhvXBDSmE0M9RC92lMS-Sd3k,22609
|
|
29
29
|
af_sdk/exceptions.py,sha256=ZVjjBeq17CGK69N2OTkVTjPXqXSI_gA7cZk9rCvARcI,4381
|
|
30
|
-
af_sdk/fabriq_client.py,sha256=
|
|
30
|
+
af_sdk/fabriq_client.py,sha256=lDrMl1tx0mRzBjQte_loVosOadWOgREy_2iVVv0x2ko,7576
|
|
31
31
|
af_sdk/models/__init__.py,sha256=nSjgNEyYILZ6WIQF-oG5IT0CWV7JGuE0xNLw8sHPshM,707
|
|
32
32
|
af_sdk/models/audit.py,sha256=_wRahNV7M7ftc2AHFf7J3WzIJ5cUyZhFn_lZX9NITp8,1476
|
|
33
33
|
af_sdk/models/types.py,sha256=DPrl7XuFSYRrc8el8OX-ZNcZrIZwl8rTR9cH01uZFaU,5106
|
|
@@ -35,7 +35,7 @@ af_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
35
35
|
af_sdk/transport/__init__.py,sha256=HsOc6MmlxIS-PSYC_-6E36-dZYyT_auZeoXvGzVAqeg,104
|
|
36
36
|
af_sdk/transport/http.py,sha256=QB3eqQbwug95QHf5PG_714NKtlTjV9PzVTo8izJCylc,13203
|
|
37
37
|
af_sdk/vault.py,sha256=QVNGigIw8ND5sVXt05gvUY222b5-i9EbzLWNsDGdOU4,17926
|
|
38
|
-
agentic_fabriq_sdk-0.1.
|
|
39
|
-
agentic_fabriq_sdk-0.1.
|
|
40
|
-
agentic_fabriq_sdk-0.1.
|
|
41
|
-
agentic_fabriq_sdk-0.1.
|
|
38
|
+
agentic_fabriq_sdk-0.1.22.dist-info/METADATA,sha256=rZ0O5voq0PTXDLRAFCEBmjE9ynQKIZXaMJTmgvGJfII,3678
|
|
39
|
+
agentic_fabriq_sdk-0.1.22.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
40
|
+
agentic_fabriq_sdk-0.1.22.dist-info/entry_points.txt,sha256=XUO2EaJhUtUS5pwVIkhemC-nEeFbKgXXLW97gQCCGm8,41
|
|
41
|
+
agentic_fabriq_sdk-0.1.22.dist-info/RECORD,,
|
|
File without changes
|
{agentic_fabriq_sdk-0.1.21.dist-info → agentic_fabriq_sdk-0.1.22.dist-info}/entry_points.txt
RENAMED
|
File without changes
|