(retrievals: List[Dict])
| 84 | |
| 85 | |
| 86 | async def ui_fetch_retrievals(retrievals: List[Dict]) -> List[Dict]: |
| 87 | from app.operators import collection_ops |
| 88 | |
| 89 | for retrieval in retrievals: |
| 90 | if retrieval["type"] == RetrievalType.COLLECTION: |
| 91 | collection = await collection_ops.get(collection_id=retrieval["id"]) |
| 92 | if collection: |
| 93 | retrieval["name"] = collection.name |
| 94 | else: |
| 95 | raise ValueError(f"Unsupported retrieval type {retrieval['type']}") |
| 96 | return retrievals |
no test coverage detected