agentic-fabriq-sdk 0.1.13__py3-none-any.whl → 0.1.15__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_cli/commands/agents.py +18 -18
- af_cli/commands/applications.py +323 -0
- af_cli/commands/auth.py +0 -6
- af_cli/commands/config.py +1 -1
- af_cli/commands/mcp_servers.py +5 -5
- af_cli/commands/secrets.py +6 -6
- af_cli/commands/tools.py +85 -11
- af_cli/main.py +2 -7
- af_sdk/__init__.py +15 -0
- af_sdk/auth/__init__.py +16 -0
- af_sdk/auth/application.py +264 -0
- af_sdk/auth/applications.py +264 -0
- af_sdk/fabriq_client.py +54 -1
- {agentic_fabriq_sdk-0.1.13.dist-info → agentic_fabriq_sdk-0.1.15.dist-info}/METADATA +14 -3
- {agentic_fabriq_sdk-0.1.13.dist-info → agentic_fabriq_sdk-0.1.15.dist-info}/RECORD +17 -14
- {agentic_fabriq_sdk-0.1.13.dist-info → agentic_fabriq_sdk-0.1.15.dist-info}/WHEEL +0 -0
- {agentic_fabriq_sdk-0.1.13.dist-info → agentic_fabriq_sdk-0.1.15.dist-info}/entry_points.txt +0 -0
af_sdk/fabriq_client.py
CHANGED
|
@@ -80,12 +80,65 @@ class FabriqClient:
|
|
|
80
80
|
|
|
81
81
|
async def invoke_tool(
|
|
82
82
|
self,
|
|
83
|
-
|
|
83
|
+
tool_identifier: str,
|
|
84
84
|
*,
|
|
85
85
|
method: str,
|
|
86
86
|
parameters: Optional[Dict[str, Any]] = None,
|
|
87
87
|
context: Optional[Dict[str, Any]] = None,
|
|
88
88
|
) -> Dict[str, Any]:
|
|
89
|
+
"""Invoke a tool by name or UUID.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
tool_identifier: Tool name (e.g., 'slack') or UUID
|
|
93
|
+
method: Method name to invoke
|
|
94
|
+
parameters: Method parameters
|
|
95
|
+
context: Additional context
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Tool invocation result
|
|
99
|
+
|
|
100
|
+
Examples:
|
|
101
|
+
result = await client.invoke_tool("slack", method="get_channels")
|
|
102
|
+
result = await client.invoke_tool("slack", method="post_message",
|
|
103
|
+
parameters={"channel": "test", "text": "Hello!"})
|
|
104
|
+
"""
|
|
105
|
+
# Try to resolve tool name to UUID if not already a UUID
|
|
106
|
+
tool_id = tool_identifier
|
|
107
|
+
try:
|
|
108
|
+
from uuid import UUID
|
|
109
|
+
UUID(tool_identifier)
|
|
110
|
+
# It's already a UUID, use it directly
|
|
111
|
+
except ValueError:
|
|
112
|
+
# Not a UUID, try to look up by name
|
|
113
|
+
try:
|
|
114
|
+
tools_response = await self.list_tools()
|
|
115
|
+
except Exception as e:
|
|
116
|
+
raise ValueError(f"Failed to list tools for name resolution: {e}. Please use UUID directly.")
|
|
117
|
+
|
|
118
|
+
# Handle different response formats
|
|
119
|
+
if isinstance(tools_response, dict) and "tools" in tools_response:
|
|
120
|
+
tools = tools_response["tools"]
|
|
121
|
+
elif isinstance(tools_response, dict) and "items" in tools_response:
|
|
122
|
+
tools = tools_response["items"]
|
|
123
|
+
elif hasattr(tools_response, '__iter__') and not isinstance(tools_response, (str, dict)):
|
|
124
|
+
tools = list(tools_response)
|
|
125
|
+
else:
|
|
126
|
+
tools = []
|
|
127
|
+
|
|
128
|
+
# Find tool by name (case-insensitive)
|
|
129
|
+
matching_tools = [t for t in tools if isinstance(t, dict) and t.get("name", "").lower() == tool_identifier.lower()]
|
|
130
|
+
|
|
131
|
+
if not matching_tools:
|
|
132
|
+
available = [t.get('name') for t in tools if isinstance(t, dict) and t.get('name')]
|
|
133
|
+
raise ValueError(f"Tool '{tool_identifier}' not found. Available tools: {available}")
|
|
134
|
+
|
|
135
|
+
if len(matching_tools) > 1:
|
|
136
|
+
raise ValueError(f"Multiple tools found with name '{tool_identifier}'. Please use UUID instead.")
|
|
137
|
+
|
|
138
|
+
tool_id = matching_tools[0].get("id")
|
|
139
|
+
if not tool_id:
|
|
140
|
+
raise ValueError(f"Tool '{tool_identifier}' found but has no ID")
|
|
141
|
+
|
|
89
142
|
body = {"method": method}
|
|
90
143
|
if parameters is not None:
|
|
91
144
|
body["parameters"] = parameters
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentic-fabriq-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.15
|
|
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
|
|
@@ -27,7 +27,7 @@ Requires-Dist: opentelemetry-instrumentation-httpx (>=0.41b0)
|
|
|
27
27
|
Requires-Dist: pydantic (>=2.4.0)
|
|
28
28
|
Requires-Dist: rich (>=13.7.0)
|
|
29
29
|
Requires-Dist: stevedore (>=5.1.0)
|
|
30
|
-
Requires-Dist: typer[all] (>=0.
|
|
30
|
+
Requires-Dist: typer[all] (>=0.12.0)
|
|
31
31
|
Requires-Dist: typing-extensions (>=4.0.0)
|
|
32
32
|
Project-URL: Documentation, https://docs.agentic-fabric.org
|
|
33
33
|
Project-URL: Homepage, https://github.com/agentic-fabric/agentic-fabric
|
|
@@ -84,8 +84,19 @@ BASE = "https://dashboard.agenticfabriq.com"
|
|
|
84
84
|
|
|
85
85
|
async def main():
|
|
86
86
|
async with FabriqClient(base_url=BASE, auth_token=TOKEN) as af:
|
|
87
|
+
# List tools and agents
|
|
88
|
+
tools = await af.list_tools()
|
|
87
89
|
agents = await af.list_agents()
|
|
88
|
-
|
|
90
|
+
|
|
91
|
+
# Invoke tools by name (easier!)
|
|
92
|
+
result = await af.invoke_tool("slack", method="get_channels")
|
|
93
|
+
|
|
94
|
+
# Or post a message
|
|
95
|
+
await af.invoke_tool(
|
|
96
|
+
"slack",
|
|
97
|
+
method="post_message",
|
|
98
|
+
parameters={"channel": "test", "text": "Hello from SDK!"}
|
|
99
|
+
)
|
|
89
100
|
```
|
|
90
101
|
|
|
91
102
|
DX orchestration:
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
af_cli/__init__.py,sha256=F2T4x4H3VIdmTjHRyV5DkaRvbZcdHYzAWD2hxtTplE4,188
|
|
2
2
|
af_cli/commands/__init__.py,sha256=Qngm2Yks6oTKazlxCZA_tIAHXwHoU6Oc7Pw5BGkA7W4,49
|
|
3
|
-
af_cli/commands/agents.py,sha256=
|
|
4
|
-
af_cli/commands/
|
|
5
|
-
af_cli/commands/
|
|
6
|
-
af_cli/commands/
|
|
7
|
-
af_cli/commands/
|
|
8
|
-
af_cli/commands/
|
|
3
|
+
af_cli/commands/agents.py,sha256=XkXL0eB6miWteK-EUet-kkEqVib3L4USncMrJmmnFjY,8325
|
|
4
|
+
af_cli/commands/applications.py,sha256=o6P-rJHO3tdqOQTBksntlVO7Y6hoDSPQp_9nB1azwzc,11958
|
|
5
|
+
af_cli/commands/auth.py,sha256=gz7DLiTTV0nv2DnKaa7_9nLHevCWslG54rRKRA1alx0,11967
|
|
6
|
+
af_cli/commands/config.py,sha256=_k4ixGZfa7Yl_yUL-W1jeMQzykFcPcbw20Yr1v6_ShM,2748
|
|
7
|
+
af_cli/commands/mcp_servers.py,sha256=1hEb4tX80dYb-j_2Z3gDud_v1FcMxl83syJ2N2eLWzI,2390
|
|
8
|
+
af_cli/commands/secrets.py,sha256=z_rHfn8-KEonTC5dioBgH7sc1ppMOltFVFz-58Nqwa0,3436
|
|
9
|
+
af_cli/commands/tools.py,sha256=Eqgd3KJ0uWVMq5rFEM_rWQaUaCUTpxqz_jAiM6uRGPI,24908
|
|
9
10
|
af_cli/core/__init__.py,sha256=cQ0H7rGfaMISQPhoNe4Xfu_EKU2TqRVt2OMI7tPea5U,51
|
|
10
11
|
af_cli/core/client.py,sha256=BELf6889BOzOWP6kCk4hSY4DolIATB0YNpui38l7EaI,3939
|
|
11
12
|
af_cli/core/config.py,sha256=fwLUF0blNII2RKdFlJ3Hat51vwwNyxpIkU_HvViz8To,8538
|
|
12
13
|
af_cli/core/oauth.py,sha256=sCzo97TZyx8sLmo0GYv53P3zoABK6htRCivHhRpPRdI,18162
|
|
13
14
|
af_cli/core/output.py,sha256=tL5z7M-tLu2M1Yl8O4M7OPP7iQivC1b_YUUB468Od5Y,4811
|
|
14
15
|
af_cli/core/token_storage.py,sha256=WhOQLx5_9pn2lAlFX01Y5DmWO7B9BJYfEkASCsBQwaI,7738
|
|
15
|
-
af_cli/main.py,sha256=
|
|
16
|
-
af_sdk/__init__.py,sha256=
|
|
17
|
-
af_sdk/auth/__init__.py,sha256=
|
|
16
|
+
af_cli/main.py,sha256=mNDMG4K0837I4je2eVB0o_T23PukBjYRRxVGbqIWBPA,5228
|
|
17
|
+
af_sdk/__init__.py,sha256=KHJn2RkgM2W7bKSshPtgAIHWBluoApoDXaLBUjA02dI,1667
|
|
18
|
+
af_sdk/auth/__init__.py,sha256=laIiIwgxy0mEgRoXEakoEs7BuUYnyrlzHJbdf8Sqa5E,1137
|
|
19
|
+
af_sdk/auth/application.py,sha256=kg5wSbhkQj00vje8_f1mgKVD7ax4b8vKAn_npkI9Bms,7451
|
|
20
|
+
af_sdk/auth/applications.py,sha256=tJ4UMvCJF73i55_4uqsBM04GxDHk5X0SQRWdHVJDcNM,7452
|
|
18
21
|
af_sdk/auth/dpop.py,sha256=s0uiyxxuzsVQNtSexji1htJoxrALwlf1P9507xa-M3Y,1285
|
|
19
22
|
af_sdk/auth/oauth.py,sha256=WRTrrBzs9ieiNnWfxagP6Ag4oI9k0soYjEkjfS2y5Lg,8120
|
|
20
23
|
af_sdk/auth/token_cache.py,sha256=X36E6K0lWqMAqlJXC3i343y8oy-uFm1q-FEdVKXdL1Y,11300
|
|
@@ -26,7 +29,7 @@ af_sdk/dx/decorators.py,sha256=o_EmvE_8pp2vTgMJMgfTy5SXG_24yabuKdoytah02Hk,1294
|
|
|
26
29
|
af_sdk/dx/runtime.py,sha256=4vuPoH-kioTIHxlobrrK1pHvmeFmAIkM7wvKNTJIJ8I,7111
|
|
27
30
|
af_sdk/events.py,sha256=vPlDQHuRQ5eVOchfheAHnKXhoEyJFFqL83_5oliyi3A,23525
|
|
28
31
|
af_sdk/exceptions.py,sha256=ZVjjBeq17CGK69N2OTkVTjPXqXSI_gA7cZk9rCvARcI,4381
|
|
29
|
-
af_sdk/fabriq_client.py,sha256=
|
|
32
|
+
af_sdk/fabriq_client.py,sha256=L836WmMrsQsiOXIrLbCv5EddCrTNsyB0VNc2XEmfJzQ,9678
|
|
30
33
|
af_sdk/models/__init__.py,sha256=_iLKq4SFuxAS-rp1ytq4RN3daAvAUz59wqmfEstwd28,865
|
|
31
34
|
af_sdk/models/audit.py,sha256=_wRahNV7M7ftc2AHFf7J3WzIJ5cUyZhFn_lZX9NITp8,1476
|
|
32
35
|
af_sdk/models/types.py,sha256=Hiwi97xpfvmE-U78-_ft998iBFi4atu6ceCbJBZ-eF0,6435
|
|
@@ -34,7 +37,7 @@ af_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
34
37
|
af_sdk/transport/__init__.py,sha256=HsOc6MmlxIS-PSYC_-6E36-dZYyT_auZeoXvGzVAqeg,104
|
|
35
38
|
af_sdk/transport/http.py,sha256=QB3eqQbwug95QHf5PG_714NKtlTjV9PzVTo8izJCylc,13203
|
|
36
39
|
af_sdk/vault.py,sha256=QVNGigIw8ND5sVXt05gvUY222b5-i9EbzLWNsDGdOU4,17926
|
|
37
|
-
agentic_fabriq_sdk-0.1.
|
|
38
|
-
agentic_fabriq_sdk-0.1.
|
|
39
|
-
agentic_fabriq_sdk-0.1.
|
|
40
|
-
agentic_fabriq_sdk-0.1.
|
|
40
|
+
agentic_fabriq_sdk-0.1.15.dist-info/METADATA,sha256=3fGRijwhZaKkMTSRfKw2CUrerHTSWdVosYYn-0v5m6Y,3658
|
|
41
|
+
agentic_fabriq_sdk-0.1.15.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
42
|
+
agentic_fabriq_sdk-0.1.15.dist-info/entry_points.txt,sha256=XUO2EaJhUtUS5pwVIkhemC-nEeFbKgXXLW97gQCCGm8,41
|
|
43
|
+
agentic_fabriq_sdk-0.1.15.dist-info/RECORD,,
|
|
File without changes
|
{agentic_fabriq_sdk-0.1.13.dist-info → agentic_fabriq_sdk-0.1.15.dist-info}/entry_points.txt
RENAMED
|
File without changes
|