Add really basic testing for memory API

weaviate does not work; the cluster URL seems malformed
This commit is contained in:
Ashwin Bharambe 2024-10-07 22:34:53 -07:00 committed by Ashwin Bharambe
parent dba7caf1d0
commit 4ab6e1b81a
10 changed files with 220 additions and 81 deletions

View file

@ -147,10 +147,9 @@ async def resolve_impls_with_routing(run_config: StackRunConfig) -> Dict[Api, An
inner_impls = {}
if isinstance(provider.spec, RoutingTableProviderSpec):
for entry in provider.spec.registry:
inner_impls[entry.provider_id] = inner_impls_by_provider_id[
f"inner-{provider.spec.router_api.value}"
][entry.provider_id]
inner_impls = inner_impls_by_provider_id[
f"inner-{provider.spec.router_api.value}"
]
impl = await instantiate_provider(
provider,

View file

@ -70,8 +70,12 @@ class CommonRoutingTableImpl(RoutingTable):
def get_provider_impl(self, routing_key: str) -> Any:
if routing_key not in self.routing_key_to_object:
raise ValueError(f"Could not find provider for {routing_key}")
raise ValueError(f"Object `{routing_key}` not registered")
obj = self.routing_key_to_object[routing_key]
if obj.provider_id not in self.impls_by_provider_id:
raise ValueError(f"Provider `{obj.provider_id}` not found")
return self.impls_by_provider_id[obj.provider_id]
def get_object_by_identifier(self, identifier: str) -> Optional[RoutableObject]: