Skip to content

Commit 9abc099

Browse files
author
Ziqun Ye
committed
rename the variables
1 parent af2f1f7 commit 9abc099

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ads/llm/serializers/retrieval_qa.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ def save(obj):
5050
serialized["type"] = "constructor"
5151
serialized["_type"] = OpenSearchVectorDBSerializer.type()
5252
kwargs = {}
53-
for key, val in obj.__dict__.items():
54-
if key == "client":
55-
if isinstance(val, OpenSearch):
56-
client_info = val.transport.hosts[0]
53+
for component_name, component in obj.__dict__.items():
54+
if component_name == "client":
55+
if isinstance(component, OpenSearch):
56+
client_info = component.transport.hosts[0]
5757
opensearch_url = (
5858
f"https://{client_info['host']}:{client_info['port']}"
5959
)
6060
kwargs.update({"opensearch_url": opensearch_url})
6161
else:
6262
raise NotImplementedError("Only support OpenSearch client.")
6363
continue
64-
kwargs[key] = dump(val)
64+
kwargs[component_name] = dump(component)
6565
serialized["kwargs"] = kwargs
6666
return serialized
6767

0 commit comments

Comments
 (0)