|
27 | 27 | def extract_component_texts(*, component_def: dict[str, Any]) -> tuple[str, str]: |
28 | 28 | """Extracts the component name and description for embedding. |
29 | 29 |
|
30 | | - Args: |
31 | | - component_def: The component definition |
| 30 | + :param component_def: The component definition |
32 | 31 |
|
33 | | - Returns: |
34 | | - A tuple containing the component name and description |
| 32 | + :returns: A tuple containing the component name and description |
35 | 33 | """ |
36 | 34 | component_type = component_def["properties"]["type"]["const"] |
37 | 35 | name = component_def.get("title", "") |
@@ -170,13 +168,11 @@ async def _build_component_definition( |
170 | 168 | async def get_component_definition(*, client: AsyncClientProtocol, component_type: str) -> ComponentDefinition | str: |
171 | 169 | """Returns the definition of a specific Haystack component. |
172 | 170 |
|
173 | | - Args: |
174 | | - client: The API client to use |
175 | | - component_type: Fully qualified component type |
176 | | - (e.g. haystack.components.routers.conditional_router.ConditionalRouter) |
| 171 | + :param client: The API client to use |
| 172 | + :param component_type: Fully qualified component type |
| 173 | + (e.g. haystack.components.routers.conditional_router.ConditionalRouter) |
177 | 174 |
|
178 | | - Returns: |
179 | | - ComponentDefinition model or error message string |
| 175 | + :returns: ComponentDefinition model or error message string |
180 | 176 | """ |
181 | 177 | haystack_service = client.haystack_service() |
182 | 178 |
|
@@ -207,14 +203,12 @@ async def search_component_definition( |
207 | 203 | ) -> ComponentSearchResults | str: |
208 | 204 | """Searches for components based on name or description using semantic similarity. |
209 | 205 |
|
210 | | - Args: |
211 | | - client: The API client to use |
212 | | - query: The search query |
213 | | - model: The model to use for computing embeddings |
214 | | - top_k: Maximum number of results to return (default: 5) |
| 206 | + :param client: The API client to use |
| 207 | + :param query: The search query |
| 208 | + :param model: The model to use for computing embeddings |
| 209 | + :param top_k: Maximum number of results to return (default: 5) |
215 | 210 |
|
216 | | - Returns: |
217 | | - ComponentSearchResults model or error message string |
| 211 | + :returns: ComponentSearchResults model or error message string |
218 | 212 | """ |
219 | 213 | haystack_service = client.haystack_service() |
220 | 214 |
|
@@ -273,11 +267,9 @@ async def search_component_definition( |
273 | 267 | async def list_component_families(*, client: AsyncClientProtocol) -> ComponentFamilyList | str: |
274 | 268 | """Lists all Haystack component families that are available on deepset. |
275 | 269 |
|
276 | | - Args: |
277 | | - client: The API client to use |
| 270 | + :param client: The API client to use |
278 | 271 |
|
279 | | - Returns: |
280 | | - ComponentFamilyList model or error message string |
| 272 | + :returns: ComponentFamilyList model or error message string |
281 | 273 | """ |
282 | 274 | haystack_service = client.haystack_service() |
283 | 275 |
|
|
0 commit comments