MCPcopy Create free account
hub / github.com/acgurl/mori / TestEmbeddingModelConfig

Class TestEmbeddingModelConfig

tests/test_long_term_memory.py:19–48  ·  view source on GitHub ↗

测试嵌入模型配置

Source from the content-addressed store, hash-verified

17
18
19class TestEmbeddingModelConfig:
20 """测试嵌入模型配置"""
21
22 def test_embedding_model_config_creation(self):
23 """测试嵌入模型配置创建"""
24 config = EmbeddingModelConfig(
25 model_name="text-embedding-v2",
26 model_type="dashscope",
27 api_key="test_key",
28 dimensions=1536,
29 )
30
31 assert config.model_name == "text-embedding-v2"
32 assert config.model_type == "dashscope"
33 assert config.api_key == "test_key"
34 assert config.dimensions == 1536
35
36 def test_embedding_model_config_env_var(self):
37 """测试嵌入模型配置环境变量解析"""
38 os.environ["TEST_EMBEDDING_KEY"] = "test_embedding_key"
39
40 config = EmbeddingModelConfig(
41 model_name="text-embedding-v2",
42 model_type="dashscope",
43 api_key="${TEST_EMBEDDING_KEY}",
44 )
45
46 assert config.api_key == "test_embedding_key"
47
48 del os.environ["TEST_EMBEDDING_KEY"]
49
50
51class TestAgentConfigWithLongTermMemory:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected