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

Class TestConfigWithEmbeddingModels

tests/test_long_term_memory.py:85–156  ·  view source on GitHub ↗

测试包含嵌入模型的完整配置

Source from the content-addressed store, hash-verified

83
84
85class TestConfigWithEmbeddingModels:
86 """测试包含嵌入模型的完整配置"""
87
88 def test_config_with_embedding_models(self):
89 """测试完整配置包含嵌入模型"""
90 config = Config(
91 models={
92 "gpt-4": ModelConfig(
93 model_name="gpt-4",
94 model_type="openai",
95 api_key="test_key",
96 )
97 },
98 agents={
99 "test_agent": AgentConfig(
100 model="gpt-4",
101 template="mori",
102 )
103 },
104 primary_agent="test_agent",
105 embedding_models={
106 "text-embedding-v2": EmbeddingModelConfig(
107 model_name="text-embedding-v2",
108 model_type="dashscope",
109 api_key="test_key",
110 )
111 },
112 )
113
114 assert len(config.embedding_models) == 1
115 assert config.embedding_models["text-embedding-v2"].model_name == "text-embedding-v2"
116
117 def test_get_embedding_model_config(self):
118 """测试获取嵌入模型配置"""
119 config = Config(
120 models={
121 "gpt-4": ModelConfig(
122 model_name="gpt-4",
123 model_type="openai",
124 api_key="test_key",
125 )
126 },
127 agents={
128 "test_agent": AgentConfig(
129 model="gpt-4",
130 template="mori",
131 )
132 },
133 primary_agent="test_agent",
134 embedding_models={
135 "text-embedding-v2": EmbeddingModelConfig(
136 model_name="text-embedding-v2",
137 model_type="dashscope",
138 api_key="test_key",
139 ),
140 "text-embedding-3-small": EmbeddingModelConfig(
141 model_name="text-embedding-3-small",
142 model_type="openai",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected