|
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
5 | 5 | import numpy as np |
| 6 | +from pydantic import BaseModel |
6 | 7 |
|
7 | 8 | from deepset_mcp.api.exceptions import ResourceNotFoundError, UnexpectedAPIError |
8 | 9 | from deepset_mcp.api.pipeline_template.models import ( |
9 | 10 | PipelineTemplate, |
10 | | - PipelineTemplateSearchResult, |
11 | | - PipelineTemplateSearchResults, |
12 | 11 | PipelineType, |
13 | 12 | ) |
14 | 13 | from deepset_mcp.api.protocols import AsyncClientProtocol |
@@ -61,6 +60,26 @@ async def get_template(*, client: AsyncClientProtocol, workspace: str, template_ |
61 | 60 | return f"Failed to fetch pipeline template '{template_name}': {e}" |
62 | 61 |
|
63 | 62 |
|
| 63 | +class PipelineTemplateSearchResult(BaseModel): |
| 64 | + """Model representing a search result for pipeline templates.""" |
| 65 | + |
| 66 | + template: PipelineTemplate |
| 67 | + "Pipeline template that matched the search criteria" |
| 68 | + similarity_score: float |
| 69 | + "Relevance score indicating how well the template matches the search" |
| 70 | + |
| 71 | + |
| 72 | +class PipelineTemplateSearchResults(BaseModel): |
| 73 | + """Response model for pipeline template search results.""" |
| 74 | + |
| 75 | + results: list[PipelineTemplateSearchResult] |
| 76 | + "List of pipeline templates matching the search criteria" |
| 77 | + query: str |
| 78 | + "Original search query string" |
| 79 | + total_found: int |
| 80 | + "Total number of templates found matching the search criteria" |
| 81 | + |
| 82 | + |
64 | 83 | async def search_templates( |
65 | 84 | *, |
66 | 85 | client: AsyncClientProtocol, |
|
0 commit comments