Return empty embeddings list as empty list through gateway (#514)

This commit is contained in:
cybermaggedon 2025-09-11 00:34:45 +01:00 committed by GitHub
parent 0f1d3ce8cf
commit 0e4fcb87de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,7 +81,7 @@ class GraphEmbeddingsResponseTranslator(MessageTranslator):
def from_pulsar(self, obj: GraphEmbeddingsResponse) -> Dict[str, Any]:
result = {}
if obj.entities:
if obj.entities is not None:
result["entities"] = [
self.value_translator.from_pulsar(entity)
for entity in obj.entities
@ -91,4 +91,4 @@ class GraphEmbeddingsResponseTranslator(MessageTranslator):
def from_response_with_completion(self, obj: GraphEmbeddingsResponse) -> Tuple[Dict[str, Any], bool]:
"""Returns (response_dict, is_final)"""
return self.from_pulsar(obj), True
return self.from_pulsar(obj), True