| 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # This source code is licensed under the terms described in the LICENSE file in |
| 5 | # the root directory of this source tree. |
| 6 | |
| 7 | from typing import Dict |
| 8 | |
| 9 | from llama_toolchain.core.datatypes import Api, ProviderSpec |
| 10 | |
| 11 | from .config import MetaReferenceImplConfig |
| 12 | |
| 13 | |
| 14 | async def get_provider_impl( |
| 15 | config: MetaReferenceImplConfig, deps: Dict[Api, ProviderSpec] |
| 16 | ): |
| 17 | from .agentic_system import MetaReferenceAgenticSystemImpl |
| 18 | |
| 19 | assert isinstance( |
| 20 | config, MetaReferenceImplConfig |
| 21 | ), f"Unexpected config type: {type(config)}" |
| 22 | |
| 23 | impl = MetaReferenceAgenticSystemImpl( |
| 24 | config, |
| 25 | deps[Api.inference], |
| 26 | deps[Api.memory], |
| 27 | deps[Api.safety], |
| 28 | ) |
| 29 | await impl.initialize() |
| 30 | return impl |