Skip to content

Commit 3b694d7

Browse files
authored
Merge pull request #4 from weijia99/main
Fix import statement for dashscope
2 parents ead33fb + 90bea7c commit 3b694d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

hello_agents/memory/embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ def __init__(self, model_name: str = "text-embedding-v3", api_key: Optional[str]
168168

169169
def _init_client(self):
170170
try:
171-
import dashscope # noqa: F401
172171
if self.api_key:
173172
# 将统一命名的 API Key 注入到 SDK 期望的位置
174173
os.environ["DASHSCOPE_API_KEY"] = self.api_key
174+
import dashscope # noqa: F401
175175
except ImportError:
176176
raise ImportError("请安装 dashscope: pip install dashscope")
177177

0 commit comments

Comments
 (0)