deepset-mcp 0.0.5rc1__py3-none-any.whl → 0.0.7__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.
- deepset_mcp/__init__.py +3 -4
- deepset_mcp/api/__init__.py +3 -0
- deepset_mcp/api/client.py +126 -107
- deepset_mcp/api/custom_components/__init__.py +3 -0
- deepset_mcp/api/custom_components/models.py +7 -8
- deepset_mcp/api/custom_components/protocols.py +4 -3
- deepset_mcp/api/custom_components/resource.py +39 -13
- deepset_mcp/api/haystack_service/__init__.py +3 -0
- deepset_mcp/api/haystack_service/protocols.py +21 -0
- deepset_mcp/api/haystack_service/resource.py +46 -0
- deepset_mcp/api/indexes/__init__.py +3 -0
- deepset_mcp/api/indexes/models.py +23 -11
- deepset_mcp/api/indexes/protocols.py +13 -4
- deepset_mcp/api/indexes/resource.py +86 -22
- deepset_mcp/api/integrations/__init__.py +4 -0
- deepset_mcp/api/integrations/models.py +4 -13
- deepset_mcp/api/integrations/protocols.py +3 -3
- deepset_mcp/api/integrations/resource.py +5 -5
- deepset_mcp/api/pipeline/__init__.py +1 -15
- deepset_mcp/api/pipeline/models.py +66 -28
- deepset_mcp/api/pipeline/protocols.py +6 -10
- deepset_mcp/api/pipeline/resource.py +101 -58
- deepset_mcp/api/pipeline_template/__init__.py +3 -0
- deepset_mcp/api/pipeline_template/models.py +12 -23
- deepset_mcp/api/pipeline_template/protocols.py +11 -5
- deepset_mcp/api/pipeline_template/resource.py +51 -39
- deepset_mcp/api/protocols.py +13 -11
- deepset_mcp/api/secrets/__init__.py +3 -0
- deepset_mcp/api/secrets/models.py +2 -8
- deepset_mcp/api/secrets/protocols.py +4 -3
- deepset_mcp/api/secrets/resource.py +32 -7
- deepset_mcp/api/shared_models.py +111 -1
- deepset_mcp/api/transport.py +30 -58
- deepset_mcp/api/user/__init__.py +3 -0
- deepset_mcp/api/workspace/__init__.py +1 -3
- deepset_mcp/api/workspace/models.py +4 -8
- deepset_mcp/api/workspace/protocols.py +3 -3
- deepset_mcp/api/workspace/resource.py +5 -9
- deepset_mcp/main.py +5 -20
- deepset_mcp/mcp/__init__.py +10 -0
- deepset_mcp/{server.py → mcp/server.py} +8 -18
- deepset_mcp/{store.py → mcp/store.py} +3 -3
- deepset_mcp/{tool_factory.py → mcp/tool_factory.py} +21 -38
- deepset_mcp/mcp/tool_models.py +57 -0
- deepset_mcp/{tool_registry.py → mcp/tool_registry.py} +16 -6
- deepset_mcp/{tools/tokonomics → tokonomics}/__init__.py +3 -1
- deepset_mcp/{tools/tokonomics → tokonomics}/decorators.py +2 -2
- deepset_mcp/{tools/tokonomics → tokonomics}/explorer.py +1 -1
- deepset_mcp/tools/__init__.py +58 -0
- deepset_mcp/tools/custom_components.py +7 -4
- deepset_mcp/tools/haystack_service.py +64 -22
- deepset_mcp/tools/haystack_service_models.py +40 -0
- deepset_mcp/tools/indexes.py +131 -32
- deepset_mcp/tools/object_store.py +1 -1
- deepset_mcp/tools/pipeline.py +40 -10
- deepset_mcp/tools/pipeline_template.py +35 -18
- deepset_mcp/tools/secrets.py +29 -13
- deepset_mcp/tools/workspace.py +2 -2
- deepset_mcp-0.0.7.dist-info/METADATA +100 -0
- deepset_mcp-0.0.7.dist-info/RECORD +74 -0
- deepset_mcp/api/README.md +0 -536
- deepset_mcp/api/pipeline/log_level.py +0 -13
- deepset_mcp/tool_models.py +0 -42
- deepset_mcp-0.0.5rc1.dist-info/METADATA +0 -807
- deepset_mcp-0.0.5rc1.dist-info/RECORD +0 -75
- /deepset_mcp/{tools/tokonomics → tokonomics}/object_store.py +0 -0
- {deepset_mcp-0.0.5rc1.dist-info → deepset_mcp-0.0.7.dist-info}/WHEEL +0 -0
- {deepset_mcp-0.0.5rc1.dist-info → deepset_mcp-0.0.7.dist-info}/entry_points.txt +0 -0
- {deepset_mcp-0.0.5rc1.dist-info → deepset_mcp-0.0.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
deepset_mcp/__init__.py,sha256=GntT_omkLLvCn5OI1QzIhcZWUwUZ9aIF0H9LBwxiBqk,380
|
|
2
|
+
deepset_mcp/config.py,sha256=1pl_TbEmlYo_He-_h01haHdp1mTp2OsrnlOdhwIpK58,2085
|
|
3
|
+
deepset_mcp/initialize_embedding_model.py,sha256=5Zcccrw3ItHpt0rGgM-3WdqV-QQaiv79nxBHhDSwNwA,411
|
|
4
|
+
deepset_mcp/main.py,sha256=31uVKMTkaRSCsON9euGSuz-16zRnnSeAZXz9wPJtLe4,6776
|
|
5
|
+
deepset_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
deepset_mcp/api/__init__.py,sha256=_iMrT0gj6bc5wVYt_lh9uAB1ygsC8APzQ04DMgr2b54,184
|
|
7
|
+
deepset_mcp/api/client.py,sha256=kj2zOdzlPgxUW6dr1AeDERoAtWF7UbtfGAQcy3j7AuQ,10868
|
|
8
|
+
deepset_mcp/api/exceptions.py,sha256=QvkVYZteB07VjJpB2UX4lWgRK8KnS2AkeftI-MxYcvE,2545
|
|
9
|
+
deepset_mcp/api/protocols.py,sha256=Bz5PpTQa_bgu3ZhVpVyIrMwOCM65HnDu642UV59jaz0,4219
|
|
10
|
+
deepset_mcp/api/shared_models.py,sha256=YqcHxzf_lfWnaw30MCF1B82-KNveBZzH1U9CI6Bg1yw,5387
|
|
11
|
+
deepset_mcp/api/transport.py,sha256=yKKCBFDs5iN5pADBtLUCfnnjJq9KzsByuk8OoxI_qxw,10144
|
|
12
|
+
deepset_mcp/api/custom_components/__init__.py,sha256=WJ_gmh3noqqhLo_0lepmXNW1KvWNs958ViGgynsc7WE,198
|
|
13
|
+
deepset_mcp/api/custom_components/models.py,sha256=CDsVhrM1BKnsKX3NRjDicL6wdWQi_dz5tLBUUajkD1Y,912
|
|
14
|
+
deepset_mcp/api/custom_components/protocols.py,sha256=UewN4G4ROhte-AfjbDekXEmTikaUh9WUAMls7rNayW8,812
|
|
15
|
+
deepset_mcp/api/custom_components/resource.py,sha256=2uek7utMYTuLMih1WMy0SX_dV7vbXDMX5MMWCfau4BU,3927
|
|
16
|
+
deepset_mcp/api/haystack_service/__init__.py,sha256=4xKSwzoCUxLFJDaZpMTgh9ueekiYBrucvxR3oSI5xA8,196
|
|
17
|
+
deepset_mcp/api/haystack_service/protocols.py,sha256=hbCCtgBohK4Lrjjn77gzRgml8TbJ8jOoaR0zRyqKPZc,1440
|
|
18
|
+
deepset_mcp/api/haystack_service/resource.py,sha256=kpqijOLP_hQtDo2W1EMIdKxs6a_Ov5bomAFCIcFkjCw,3748
|
|
19
|
+
deepset_mcp/api/indexes/__init__.py,sha256=g-kCjYsYoxRUHHQUm8vXl_RQTixe8E_rfjtUXzmeloU,176
|
|
20
|
+
deepset_mcp/api/indexes/models.py,sha256=ACYM97LxmPCTdaMohOR4sIGMkLN9ZOT5aro_mH1Npe4,2989
|
|
21
|
+
deepset_mcp/api/indexes/protocols.py,sha256=fLIGn8u-cwodypJyk-EQ8ZgfoAhsXrw28ie_Ub7jz3c,2340
|
|
22
|
+
deepset_mcp/api/indexes/resource.py,sha256=S4VQzkQx8Jqzdr0A3yqD4HbBCnxMD8WJ1hXWspiv8WA,8788
|
|
23
|
+
deepset_mcp/api/integrations/__init__.py,sha256=8JQr8mKPSSvtwGV2GoxDHwbLj-rlBalSVMzMmGXQhHo,233
|
|
24
|
+
deepset_mcp/api/integrations/models.py,sha256=I0MpcnFCqILbvTmjFQtBrlA-p_kNjYZnWx7imo3Dp8c,1218
|
|
25
|
+
deepset_mcp/api/integrations/protocols.py,sha256=6vleukWwtoKXI7K8KdODxgpEc6EBcz2U0S4nHRNCPTk,878
|
|
26
|
+
deepset_mcp/api/integrations/resource.py,sha256=xQKpqS2LHXD0CZadlhDAod_S3CKJ828aqgJUJhQmXMc,1903
|
|
27
|
+
deepset_mcp/api/pipeline/__init__.py,sha256=aIXXEupF-aLrfl1ivBA02Wb4XXN2KOUqfthBcil0mOc,182
|
|
28
|
+
deepset_mcp/api/pipeline/models.py,sha256=yzu_0Q09AqXM7tvjBMwiOIKhRy2A8yL-S14NhCBOlco,9761
|
|
29
|
+
deepset_mcp/api/pipeline/protocols.py,sha256=pB3FLf-6reJB99rR24GmOhHWp3FkOVcoyXGqWw72rKU,2694
|
|
30
|
+
deepset_mcp/api/pipeline/resource.py,sha256=dsM4aBwxeg9IG7c1aoLySSCfDwKIz3atV7QCx3Fxhug,17157
|
|
31
|
+
deepset_mcp/api/pipeline_template/__init__.py,sha256=AFI_1OMmHs80b1NSorrEyCN-j7-IoGD9HegqzeuzGCA,198
|
|
32
|
+
deepset_mcp/api/pipeline_template/models.py,sha256=tlzSIbt-BYrJ29y6Z4dEs2YDnFrT_3XNgtE4TP-g-CE,2525
|
|
33
|
+
deepset_mcp/api/pipeline_template/protocols.py,sha256=80CbSMz-MDoD44VFpZBIWDgopgcAMOrluHHCRS-R0A0,899
|
|
34
|
+
deepset_mcp/api/pipeline_template/resource.py,sha256=ti1qEnRkNjHiUMDPGhHXExUAiE9EutGu2Q_izsHz-Nc,4575
|
|
35
|
+
deepset_mcp/api/secrets/__init__.py,sha256=axCpIiEFPkOUJZjNFTq0cPzBo1BnOEgBSBA5iXBU-6s,178
|
|
36
|
+
deepset_mcp/api/secrets/models.py,sha256=gaI7GsnMSI9fq7x4vchEhnFAiyJRIvJHiPNnsMPEafE,332
|
|
37
|
+
deepset_mcp/api/secrets/protocols.py,sha256=remwpa6LIrLOk0KScn20RgQFxP6oShsWvXrDhc9b7fk,971
|
|
38
|
+
deepset_mcp/api/secrets/resource.py,sha256=yNenuZnS15nPj56f-05hzDGV0JDjkGf3_0USHhl-AGw,4946
|
|
39
|
+
deepset_mcp/api/user/__init__.py,sha256=M8ExkqSVeU8--1rrSCPPc4RN86JSEqfC-cmfke6J7Cw,174
|
|
40
|
+
deepset_mcp/api/user/protocols.py,sha256=439X2n7chPFEsp6xLwt3HqMaZi5dQJJDTj-qhkiqzwQ,413
|
|
41
|
+
deepset_mcp/api/user/resource.py,sha256=Ssj7VnSoSfPzvYiVSltkXpiSvZlknv35P8gzCl2m3Wc,1266
|
|
42
|
+
deepset_mcp/api/workspace/__init__.py,sha256=2gYr0WSfWYeAhmnQC6Kiq1CXENOd0DwMfBW1oIzGA38,213
|
|
43
|
+
deepset_mcp/api/workspace/models.py,sha256=oyo_0o6x1XyoRg1S7gLJqUQTmlneufc1-hz9y3J0ce8,643
|
|
44
|
+
deepset_mcp/api/workspace/protocols.py,sha256=nmSfExiNto-2Qv7t9kmo9GqVbtWHez9l9gg_4787GYU,1293
|
|
45
|
+
deepset_mcp/api/workspace/resource.py,sha256=v9FzIVLKxho_FwagR8Uosag0FjvKsISw_iYTEKvVmp8,2852
|
|
46
|
+
deepset_mcp/mcp/__init__.py,sha256=vlOwzaPVEJN8dbDvUE-v_kd3q9oQ7f9R6eRD3PXynFU,383
|
|
47
|
+
deepset_mcp/mcp/server.py,sha256=zvX_NDmL5Hj2Nby48lAvecvsagrW-Gf-LAA_cSmeLr4,6308
|
|
48
|
+
deepset_mcp/mcp/store.py,sha256=xfnQbzvAlM8kCH6tq7XbC0PUkf4ciyEmre7GF5mOqaY,1872
|
|
49
|
+
deepset_mcp/mcp/tool_factory.py,sha256=LBJXs_uZtVqYL6Zf-MJdY_Yn4tdzcnUl51Yb69qPO54,14757
|
|
50
|
+
deepset_mcp/mcp/tool_models.py,sha256=HVxV-VqsvO5Cit1qAXaZhIYaY956HMILbjYnhTlCFHQ,2018
|
|
51
|
+
deepset_mcp/mcp/tool_registry.py,sha256=M84RpKEBCjc8Zvbs-6k82QlbzMQIavPDf5lFKe-OGyg,9149
|
|
52
|
+
deepset_mcp/prompts/deepset_copilot_prompt.md,sha256=QctQQ4yQ9zl-uWv48dfr1DGhEKPvjsY82iFmRRCzbwM,9968
|
|
53
|
+
deepset_mcp/prompts/deepset_debugging_agent.md,sha256=m5Y-n9cXQGm9BZ3wZ3N_hQmMjrXVfc1cqV8i8Kle5uU,9488
|
|
54
|
+
deepset_mcp/tokonomics/__init__.py,sha256=nO9-6Ar9pQCyQVMiuAOHVEWqN-_C7_anW2HL7_N4Iu4,549
|
|
55
|
+
deepset_mcp/tokonomics/decorators.py,sha256=l7ivHR2FVHit2ih1jOFiqqS28n0uPEI2YKKmgZe_C-w,13566
|
|
56
|
+
deepset_mcp/tokonomics/explorer.py,sha256=ykNfsw-rs3vZavkb_3IAmXy7CrD9S7XHuFyaXJobaWE,13612
|
|
57
|
+
deepset_mcp/tokonomics/object_store.py,sha256=UW9g_NJ9Mw4-2HnhQye2hKyz3Pt_rYOgXL6gABtZwFE,4802
|
|
58
|
+
deepset_mcp/tools/__init__.py,sha256=_1PY8FPrx-AqBcw6v5KCWPX6e5qSHyVyJW6ibXxsLrc,1806
|
|
59
|
+
deepset_mcp/tools/custom_components.py,sha256=VG6m5zDtNuk4YkxdvEMlOOouvAypCsqPuFD9ZIickNI,2227
|
|
60
|
+
deepset_mcp/tools/doc_search.py,sha256=S_PcvikBk38IBUqOO1rxSHrAaFDdGfnFHjHXGlkaoxc,2847
|
|
61
|
+
deepset_mcp/tools/haystack_service.py,sha256=MaMA_LlBqPEsrHiz1M6Xb1eeofi9zDq60OqRM23xgho,16934
|
|
62
|
+
deepset_mcp/tools/haystack_service_models.py,sha256=6N76lTOiZ0nXBZ8u_AGHtIyEVWLAttrtF9u5oOOFdQs,4445
|
|
63
|
+
deepset_mcp/tools/indexes.py,sha256=8BCQG5q_7B-giwh_T5TOPhHnotFUTkVGyVmopu_9bls,9719
|
|
64
|
+
deepset_mcp/tools/model_protocol.py,sha256=k6xcnVYLqgXM8DX8SrA5ls3sbKBZC06XfO596KCSKQ4,529
|
|
65
|
+
deepset_mcp/tools/object_store.py,sha256=kAS3CRouhIgA8VFH6R-8XSXkyjDcV2DQ0r89Pz7h28E,1958
|
|
66
|
+
deepset_mcp/tools/pipeline.py,sha256=Cum1BIBtvl-JXcyH2zEZ48SngKJuMXGmDNP8ZKFW_Dc,15868
|
|
67
|
+
deepset_mcp/tools/pipeline_template.py,sha256=KgIL5UnXW0I1v6EDOVZE9LgF1bNzixwvRwwBv4B-1WU,5852
|
|
68
|
+
deepset_mcp/tools/secrets.py,sha256=1kZ0vfbmIPooQxaO5Bv6UtCYH8KDcziNGTUq-HAy4I8,4712
|
|
69
|
+
deepset_mcp/tools/workspace.py,sha256=01R3sPI7sjNoD173XhTfYHIG0Iv7La6GlBrZXHeUb9s,2827
|
|
70
|
+
deepset_mcp-0.0.7.dist-info/METADATA,sha256=q8n-CHJZYqY_91cjc_EteeZA0PDjmIOgTtM0qv03pFE,3398
|
|
71
|
+
deepset_mcp-0.0.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
72
|
+
deepset_mcp-0.0.7.dist-info/entry_points.txt,sha256=0X0vMrNLUbQYq02bA4DUgsFuEAbS2bAaGO4jrAMtRk0,53
|
|
73
|
+
deepset_mcp-0.0.7.dist-info/licenses/LICENSE,sha256=k0H2cOtcgKczLsEN2Ju03DoAb8jhBSlp8WzWYlYlDvc,11342
|
|
74
|
+
deepset_mcp-0.0.7.dist-info/RECORD,,
|
deepset_mcp/api/README.md
DELETED
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
# deepset API SDK
|
|
2
|
-
|
|
3
|
-
The deepset API SDK provides a comprehensive Python interface for interacting with the deepset AI Platform. It simplifies the process of building, managing, and deploying AI-powered applications by providing structured access to all platform resources.
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
The SDK is built around the `AsyncDeepsetClient`, which provides access to different resources on the deepset platform. All operations are asynchronous and use modern Python async/await patterns for optimal performance.
|
|
8
|
-
|
|
9
|
-
### Installation and Setup
|
|
10
|
-
|
|
11
|
-
Initialize the client with your API key:
|
|
12
|
-
|
|
13
|
-
```python
|
|
14
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
15
|
-
|
|
16
|
-
# Using environment variable DEEPSET_API_KEY
|
|
17
|
-
async with AsyncDeepsetClient() as client:
|
|
18
|
-
# Your code here
|
|
19
|
-
pass
|
|
20
|
-
|
|
21
|
-
# Or provide API key directly
|
|
22
|
-
async with AsyncDeepsetClient(api_key="your-api-key") as client:
|
|
23
|
-
# Your code here
|
|
24
|
-
pass
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The client automatically handles authentication, request management, and connection pooling. Always use it as an async context manager to ensure proper resource cleanup.
|
|
28
|
-
|
|
29
|
-
## Core Resources
|
|
30
|
-
|
|
31
|
-
The SDK provides access to nine main resources, each designed for specific aspects of the deepset platform:
|
|
32
|
-
|
|
33
|
-
### Pipelines
|
|
34
|
-
|
|
35
|
-
Pipelines are the core building blocks of your AI applications. They define how data flows through different components to produce results.
|
|
36
|
-
|
|
37
|
-
```python
|
|
38
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
39
|
-
|
|
40
|
-
async with AsyncDeepsetClient() as client:
|
|
41
|
-
# Access pipeline resource for a specific workspace
|
|
42
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
43
|
-
|
|
44
|
-
# List all pipelines
|
|
45
|
-
pipeline_list = await pipelines.list(page_number=1, limit=10)
|
|
46
|
-
|
|
47
|
-
# Get a specific pipeline with its YAML configuration
|
|
48
|
-
pipeline = await pipelines.get("my-pipeline", include_yaml=True)
|
|
49
|
-
|
|
50
|
-
# Create a new pipeline
|
|
51
|
-
yaml_config = """
|
|
52
|
-
components:
|
|
53
|
-
text_embedder:
|
|
54
|
-
type: SentenceTransformersTextEmbedder
|
|
55
|
-
params:
|
|
56
|
-
model: "sentence-transformers/all-MiniLM-L6-v2"
|
|
57
|
-
"""
|
|
58
|
-
|
|
59
|
-
response = await pipelines.create(
|
|
60
|
-
name="my-new-pipeline",
|
|
61
|
-
yaml_config=yaml_config
|
|
62
|
-
)
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Pipeline Management
|
|
66
|
-
|
|
67
|
-
The SDK provides comprehensive pipeline lifecycle management:
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
71
|
-
|
|
72
|
-
yaml_config = "some: yaml"
|
|
73
|
-
updated_yaml_config = "some: other yaml"
|
|
74
|
-
|
|
75
|
-
async with AsyncDeepsetClient() as client:
|
|
76
|
-
# Access pipeline resource for a specific workspace
|
|
77
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
78
|
-
|
|
79
|
-
# Validate a pipeline configuration before deployment
|
|
80
|
-
validation_result = await pipelines.validate(yaml_config)
|
|
81
|
-
if validation_result.valid:
|
|
82
|
-
print("Pipeline configuration is valid")
|
|
83
|
-
else:
|
|
84
|
-
for error in validation_result.errors:
|
|
85
|
-
print(f"Error {error.code}: {error.message}")
|
|
86
|
-
|
|
87
|
-
# Update an existing pipeline
|
|
88
|
-
await pipelines.update(
|
|
89
|
-
pipeline_name="my-pipeline",
|
|
90
|
-
updated_pipeline_name="my-renamed-pipeline", # Optional
|
|
91
|
-
yaml_config=updated_yaml_config # Optional
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
# Deploy a pipeline to production
|
|
95
|
-
deployment_result = await pipelines.deploy("my-pipeline")
|
|
96
|
-
|
|
97
|
-
# Delete a pipeline
|
|
98
|
-
await pipelines.delete("my-pipeline")
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Search and Streaming
|
|
102
|
-
|
|
103
|
-
Execute searches using deployed pipelines:
|
|
104
|
-
|
|
105
|
-
```python
|
|
106
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
107
|
-
|
|
108
|
-
async with AsyncDeepsetClient() as client:
|
|
109
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
110
|
-
|
|
111
|
-
# Basic search
|
|
112
|
-
search_response = await pipelines.search(
|
|
113
|
-
pipeline_name="my-pipeline",
|
|
114
|
-
query="What is artificial intelligence?",
|
|
115
|
-
debug=True, # Include debug information
|
|
116
|
-
view_prompts=True, # Include prompts in response
|
|
117
|
-
params={"top_k": 5}, # Pipeline-specific parameters
|
|
118
|
-
filters={"category": "AI"} # Search filters
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
# Streaming search for real-time results
|
|
122
|
-
async for event in pipelines.search_stream(
|
|
123
|
-
pipeline_name="my-pipeline",
|
|
124
|
-
query="What is artificial intelligence?",
|
|
125
|
-
debug=True
|
|
126
|
-
):
|
|
127
|
-
if event.type == "delta":
|
|
128
|
-
print(event.delta.text, end="")
|
|
129
|
-
elif event.type == "result":
|
|
130
|
-
print(f"\nFinal result: {event.result}")
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Pipeline Monitoring
|
|
134
|
-
|
|
135
|
-
Monitor pipeline performance and troubleshoot issues:
|
|
136
|
-
|
|
137
|
-
```python
|
|
138
|
-
from deepset_mcp.api.pipeline.log_level import LogLevel
|
|
139
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
async with AsyncDeepsetClient() as client:
|
|
143
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
144
|
-
# Get pipeline logs
|
|
145
|
-
logs = await pipelines.get_logs(
|
|
146
|
-
pipeline_name="my-pipeline",
|
|
147
|
-
limit=50,
|
|
148
|
-
level=LogLevel.ERROR # Filter by log level
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
for log_entry in logs.data:
|
|
152
|
-
print(f"[{log_entry.level}] {log_entry.message}")
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### Indexes
|
|
156
|
-
|
|
157
|
-
Indexes store and organize your data for efficient retrieval:
|
|
158
|
-
|
|
159
|
-
```python
|
|
160
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
161
|
-
|
|
162
|
-
async with AsyncDeepsetClient() as client:
|
|
163
|
-
indexes = client.indexes(workspace="your-workspace")
|
|
164
|
-
|
|
165
|
-
# List all indexes
|
|
166
|
-
index_list = await indexes.list()
|
|
167
|
-
|
|
168
|
-
# Get a specific index
|
|
169
|
-
index = await indexes.get("my-index")
|
|
170
|
-
|
|
171
|
-
# Create a new index
|
|
172
|
-
index_yaml = """
|
|
173
|
-
document_store:
|
|
174
|
-
type: InMemoryDocumentStore
|
|
175
|
-
indexing_pipeline:
|
|
176
|
-
type: Pipeline
|
|
177
|
-
components:
|
|
178
|
-
converter:
|
|
179
|
-
type: TextFileToDocument
|
|
180
|
-
"""
|
|
181
|
-
|
|
182
|
-
await indexes.create(
|
|
183
|
-
name="my-new-index",
|
|
184
|
-
yaml_config=index_yaml,
|
|
185
|
-
description="My document index"
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
updated_yaml = """
|
|
189
|
-
document_store:
|
|
190
|
-
type: OpenSearchDocumentStore
|
|
191
|
-
indexing_pipeline:
|
|
192
|
-
type: Pipeline
|
|
193
|
-
components:
|
|
194
|
-
converter:
|
|
195
|
-
type: TextFileToDocument
|
|
196
|
-
"""
|
|
197
|
-
|
|
198
|
-
# Update an existing index
|
|
199
|
-
await indexes.update(
|
|
200
|
-
index_name="my-index",
|
|
201
|
-
updated_index_name="my-renamed-index",
|
|
202
|
-
yaml_config=updated_yaml
|
|
203
|
-
)
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Pipeline Templates
|
|
207
|
-
|
|
208
|
-
Templates provide pre-built pipeline configurations for common use cases:
|
|
209
|
-
|
|
210
|
-
```python
|
|
211
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
212
|
-
|
|
213
|
-
async with AsyncDeepsetClient() as client:
|
|
214
|
-
templates = client.pipeline_templates(workspace="your-workspace")
|
|
215
|
-
|
|
216
|
-
# List available templates
|
|
217
|
-
template_list = await templates.list_templates(
|
|
218
|
-
limit=20,
|
|
219
|
-
field="created_at",
|
|
220
|
-
order="DESC",
|
|
221
|
-
filter="category eq 'RAG'" # OData filter
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
# Get a specific template with its YAML configuration
|
|
225
|
-
template = await templates.get_template("template-name")
|
|
226
|
-
|
|
227
|
-
# Use the template YAML to create a new pipeline
|
|
228
|
-
if template.yaml_config:
|
|
229
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
230
|
-
await pipelines.create(
|
|
231
|
-
name="pipeline-from-template",
|
|
232
|
-
yaml_config=template.yaml_config
|
|
233
|
-
)
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
### Haystack Service
|
|
237
|
-
|
|
238
|
-
Access Haystack component definitions and schemas:
|
|
239
|
-
|
|
240
|
-
```python
|
|
241
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
242
|
-
|
|
243
|
-
async with AsyncDeepsetClient() as client:
|
|
244
|
-
haystack = client.haystack_service()
|
|
245
|
-
|
|
246
|
-
# Get all component schemas
|
|
247
|
-
schemas = await haystack.get_component_schemas()
|
|
248
|
-
|
|
249
|
-
# Get input/output information for a specific component
|
|
250
|
-
io_info = await haystack.get_component_input_output("ConditionalRouter")
|
|
251
|
-
|
|
252
|
-
print(f"Component inputs: {io_info.inputs}")
|
|
253
|
-
print(f"Component outputs: {io_info.outputs}")
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Custom Components
|
|
257
|
-
|
|
258
|
-
Manage custom component installations:
|
|
259
|
-
|
|
260
|
-
```python
|
|
261
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
262
|
-
|
|
263
|
-
async with AsyncDeepsetClient() as client:
|
|
264
|
-
custom_components = client.custom_components(workspace="your-workspace")
|
|
265
|
-
|
|
266
|
-
# List installed custom components
|
|
267
|
-
installations = await custom_components.list_installations()
|
|
268
|
-
|
|
269
|
-
for installation in installations.data:
|
|
270
|
-
print(f"Component: {installation.custom_component_id}")
|
|
271
|
-
print(f"Status: {installation.status}")
|
|
272
|
-
print(f"Version: {installation.version}")
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Integrations
|
|
276
|
-
|
|
277
|
-
Manage external service integrations:
|
|
278
|
-
|
|
279
|
-
```python
|
|
280
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
281
|
-
from deepset_mcp.api.integrations.models import IntegrationProvider
|
|
282
|
-
|
|
283
|
-
async with AsyncDeepsetClient() as client:
|
|
284
|
-
integrations = client.integrations()
|
|
285
|
-
|
|
286
|
-
# List all integrations
|
|
287
|
-
integration_list = await integrations.list()
|
|
288
|
-
|
|
289
|
-
for integration in integration_list.integrations:
|
|
290
|
-
print(f"Provider: {integration.provider}")
|
|
291
|
-
print(f"Domain: {integration.provider_domain}")
|
|
292
|
-
|
|
293
|
-
# Get a specific integration by provider
|
|
294
|
-
openai_integration = await integrations.get(IntegrationProvider.OPENAI)
|
|
295
|
-
print(f"OpenAI Integration: {openai_integration.provider_domain}")
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Secrets
|
|
299
|
-
|
|
300
|
-
Manage secrets for secure configuration and sensitive data:
|
|
301
|
-
|
|
302
|
-
```python
|
|
303
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
304
|
-
|
|
305
|
-
async with AsyncDeepsetClient() as client:
|
|
306
|
-
secrets = client.secrets()
|
|
307
|
-
|
|
308
|
-
# List all secrets
|
|
309
|
-
secret_list = await secrets.list(
|
|
310
|
-
limit=20,
|
|
311
|
-
field="created_at",
|
|
312
|
-
order="DESC"
|
|
313
|
-
)
|
|
314
|
-
|
|
315
|
-
# Create a new secret
|
|
316
|
-
await secrets.create(
|
|
317
|
-
name="api-key-secret",
|
|
318
|
-
secret="your-secret-value"
|
|
319
|
-
)
|
|
320
|
-
|
|
321
|
-
# Get a specific secret
|
|
322
|
-
secret = await secrets.get("secret-id")
|
|
323
|
-
print(f"Secret name: {secret.name}")
|
|
324
|
-
|
|
325
|
-
# Delete a secret
|
|
326
|
-
await secrets.delete("secret-id")
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
### Users
|
|
330
|
-
|
|
331
|
-
Access user information and manage user-related operations:
|
|
332
|
-
|
|
333
|
-
```python
|
|
334
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
async with AsyncDeepsetClient() as client:
|
|
338
|
-
users = client.users()
|
|
339
|
-
|
|
340
|
-
# Get user information
|
|
341
|
-
user = await users.get("user-id")
|
|
342
|
-
print(f"User: {user.given_name} {user.family_name}")
|
|
343
|
-
print(f"Email: {user.email}")
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
### Workspaces
|
|
347
|
-
|
|
348
|
-
Manage workspaces to organize your projects and resources:
|
|
349
|
-
|
|
350
|
-
```python
|
|
351
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
352
|
-
|
|
353
|
-
async with AsyncDeepsetClient() as client:
|
|
354
|
-
workspaces = client.workspaces()
|
|
355
|
-
|
|
356
|
-
# List all workspaces
|
|
357
|
-
workspace_list = await workspaces.list()
|
|
358
|
-
|
|
359
|
-
for workspace in workspace_list.data:
|
|
360
|
-
print(f"Workspace: {workspace.name}")
|
|
361
|
-
print(f"ID: {workspace.workspace_id}")
|
|
362
|
-
print(f"Default timeout: {workspace.default_idle_timeout_in_seconds}s")
|
|
363
|
-
|
|
364
|
-
# Get a specific workspace
|
|
365
|
-
workspace = await workspaces.get("my-workspace")
|
|
366
|
-
print(f"Languages: {workspace.languages}")
|
|
367
|
-
|
|
368
|
-
# Create a new workspace
|
|
369
|
-
await workspaces.create(name="new-workspace")
|
|
370
|
-
|
|
371
|
-
# Delete a workspace
|
|
372
|
-
await workspaces.delete("old-workspace")
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
## Advanced Configuration
|
|
376
|
-
|
|
377
|
-
### Custom Transport
|
|
378
|
-
|
|
379
|
-
For advanced use cases, you can provide custom transport configuration:
|
|
380
|
-
|
|
381
|
-
```python
|
|
382
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
383
|
-
|
|
384
|
-
transport_config = {
|
|
385
|
-
"timeout": 30, # Request timeout in seconds
|
|
386
|
-
"retries": 3, # Number of retries
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
async with AsyncDeepsetClient(
|
|
390
|
-
transport_config=transport_config
|
|
391
|
-
) as client:
|
|
392
|
-
# Your code here
|
|
393
|
-
pass
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
### Error Handling
|
|
397
|
-
|
|
398
|
-
The SDK provides specific exceptions for different error conditions:
|
|
399
|
-
|
|
400
|
-
```python
|
|
401
|
-
from deepset_mcp.api.exceptions import (
|
|
402
|
-
BadRequestError,
|
|
403
|
-
ResourceNotFoundError,
|
|
404
|
-
UnexpectedAPIError
|
|
405
|
-
)
|
|
406
|
-
|
|
407
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
async with AsyncDeepsetClient() as client:
|
|
411
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
412
|
-
|
|
413
|
-
try:
|
|
414
|
-
pipeline = await pipelines.get("non-existent-pipeline")
|
|
415
|
-
except ResourceNotFoundError:
|
|
416
|
-
print("Pipeline not found")
|
|
417
|
-
except BadRequestError as e:
|
|
418
|
-
print(f"Bad request: {e}")
|
|
419
|
-
except UnexpectedAPIError as e:
|
|
420
|
-
print(f"Unexpected error: {e}")
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
## Best Practices
|
|
424
|
-
|
|
425
|
-
### Resource Management
|
|
426
|
-
|
|
427
|
-
Always use the client as an async context manager to ensure proper cleanup:
|
|
428
|
-
|
|
429
|
-
```python
|
|
430
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
431
|
-
|
|
432
|
-
# Good - automatically handles resource cleanup
|
|
433
|
-
async with AsyncDeepsetClient() as client:
|
|
434
|
-
result = await client.pipelines("workspace").list()
|
|
435
|
-
|
|
436
|
-
# Avoid - requires manual cleanup
|
|
437
|
-
client = AsyncDeepsetClient()
|
|
438
|
-
try:
|
|
439
|
-
result = await client.pipelines("workspace").list()
|
|
440
|
-
finally:
|
|
441
|
-
await client.close()
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
### Workspace Organization
|
|
445
|
-
|
|
446
|
-
Organize your resources by workspace for better management:
|
|
447
|
-
|
|
448
|
-
```python
|
|
449
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
450
|
-
|
|
451
|
-
async with AsyncDeepsetClient() as client:
|
|
452
|
-
# Development workspace
|
|
453
|
-
dev_pipelines = client.pipelines("development")
|
|
454
|
-
dev_pipeline = await dev_pipelines.create(name="test-pipeline", yaml_config=config)
|
|
455
|
-
|
|
456
|
-
# Production workspace
|
|
457
|
-
prod_pipelines = client.pipelines("production")
|
|
458
|
-
prod_pipeline = await prod_pipelines.create(name="prod-pipeline", yaml_config=config)
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
### Validation Before Deployment
|
|
462
|
-
|
|
463
|
-
Always validate pipeline configurations before deployment:
|
|
464
|
-
|
|
465
|
-
```python
|
|
466
|
-
from deepset_mcp.api.client import AsyncDeepsetClient
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
async with AsyncDeepsetClient() as client:
|
|
470
|
-
pipelines = client.pipelines(workspace="your-workspace")
|
|
471
|
-
|
|
472
|
-
# Validate configuration
|
|
473
|
-
validation_result = await pipelines.validate(yaml_config)
|
|
474
|
-
|
|
475
|
-
if validation_result.valid:
|
|
476
|
-
# Create and deploy pipeline
|
|
477
|
-
await pipelines.create(name="my-pipeline", yaml_config=yaml_config)
|
|
478
|
-
deployment_result = await pipelines.deploy("my-pipeline")
|
|
479
|
-
|
|
480
|
-
if deployment_result.valid:
|
|
481
|
-
print("Pipeline deployed successfully")
|
|
482
|
-
else:
|
|
483
|
-
print("Deployment failed:", deployment_result.errors)
|
|
484
|
-
else:
|
|
485
|
-
print("Configuration invalid:", validation_result.errors)
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
### Streaming for Real-Time Applications
|
|
489
|
-
|
|
490
|
-
Use streaming for applications that need real-time responses:
|
|
491
|
-
|
|
492
|
-
```python
|
|
493
|
-
async def stream_search_results(pipelines, query):
|
|
494
|
-
async for event in pipelines.search_stream(
|
|
495
|
-
pipeline_name="chat-pipeline",
|
|
496
|
-
query=query
|
|
497
|
-
):
|
|
498
|
-
if event.type == "delta":
|
|
499
|
-
# Stream partial results to user
|
|
500
|
-
yield event.delta.text
|
|
501
|
-
elif event.type == "result":
|
|
502
|
-
# Final result available
|
|
503
|
-
return event.result
|
|
504
|
-
elif event.error:
|
|
505
|
-
# Handle streaming errors
|
|
506
|
-
raise Exception(event.error)
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
## API Reference
|
|
510
|
-
|
|
511
|
-
### AsyncDeepsetClient
|
|
512
|
-
|
|
513
|
-
Main client class for API access.
|
|
514
|
-
|
|
515
|
-
**Constructor Parameters:**
|
|
516
|
-
- `api_key` (str, optional): API key for authentication. Falls back to `DEEPSET_API_KEY` environment variable.
|
|
517
|
-
- `base_url` (str, optional): Base URL for the API. Defaults to `https://api.cloud.deepset.ai/api`.
|
|
518
|
-
- `transport` (TransportProtocol, optional): Custom transport implementation.
|
|
519
|
-
- `transport_config` (dict, optional): Configuration for default transport.
|
|
520
|
-
|
|
521
|
-
**Resource Methods:**
|
|
522
|
-
- `pipelines(workspace: str)`: Returns PipelineResource for the specified workspace
|
|
523
|
-
- `indexes(workspace: str)`: Returns IndexResource for the specified workspace
|
|
524
|
-
- `pipeline_templates(workspace: str)`: Returns PipelineTemplateResource for the specified workspace
|
|
525
|
-
- `custom_components(workspace: str)`: Returns CustomComponentsResource for the specified workspace
|
|
526
|
-
- `integrations()`: Returns IntegrationResource
|
|
527
|
-
- `haystack_service()`: Returns HaystackServiceResource
|
|
528
|
-
- `secrets()`: Returns SecretResource
|
|
529
|
-
- `users()`: Returns UserResource
|
|
530
|
-
- `workspaces()`: Returns WorkspaceResource for workspace management
|
|
531
|
-
|
|
532
|
-
### Resource Classes
|
|
533
|
-
|
|
534
|
-
Each resource class provides methods specific to that resource type. All methods are async and return appropriate response models.
|
|
535
|
-
|
|
536
|
-
For detailed method signatures and response models, refer to the type hints in the source code or use your IDE's autocomplete functionality.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
from enum import StrEnum
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class LogLevel(StrEnum):
|
|
9
|
-
"""Log level filter options for pipeline logs."""
|
|
10
|
-
|
|
11
|
-
INFO = "info"
|
|
12
|
-
WARNING = "warning"
|
|
13
|
-
ERROR = "error"
|
deepset_mcp/tool_models.py
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
from dataclasses import dataclass, field
|
|
6
|
-
from enum import StrEnum
|
|
7
|
-
from typing import Any
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class MemoryType(StrEnum):
|
|
11
|
-
"""Configuration for how memory is provided to tools."""
|
|
12
|
-
|
|
13
|
-
EXPLORABLE = "explorable"
|
|
14
|
-
REFERENCEABLE = "referenceable"
|
|
15
|
-
BOTH = "both"
|
|
16
|
-
NO_MEMORY = "no_memory"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@dataclass
|
|
20
|
-
class ToolConfig:
|
|
21
|
-
"""Configuration for tool registration."""
|
|
22
|
-
|
|
23
|
-
needs_client: bool = False
|
|
24
|
-
needs_workspace: bool = False
|
|
25
|
-
memory_type: MemoryType = MemoryType.NO_MEMORY
|
|
26
|
-
custom_args: dict[str, Any] = field(default_factory=dict)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class WorkspaceMode(StrEnum):
|
|
30
|
-
"""Configuration for how workspace is provided to tools."""
|
|
31
|
-
|
|
32
|
-
STATIC = "static" # workspace from env, no parameter in tool signature
|
|
33
|
-
DYNAMIC = "dynamic" # workspace as required parameter in tool signature
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@dataclass
|
|
37
|
-
class DeepsetDocsConfig:
|
|
38
|
-
"""Configuration for deepset documentation search tool."""
|
|
39
|
-
|
|
40
|
-
pipeline_name: str
|
|
41
|
-
api_key: str
|
|
42
|
-
workspace_name: str
|