mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-10 00:02:38 +02:00
Merge branch 'feat-exp-pool' into 'mgx_ops'
Feat exp pool See merge request pub/MetaGPT!339
This commit is contained in:
commit
f513e7925d
4 changed files with 34 additions and 9 deletions
|
|
@ -7,7 +7,7 @@ from metagpt.configs.exp_pool_config import (
|
|||
)
|
||||
from metagpt.configs.llm_config import LLMConfig
|
||||
from metagpt.exp_pool.manager import Experience, ExperienceManager
|
||||
from metagpt.exp_pool.schema import QueryType
|
||||
from metagpt.exp_pool.schema import DEFAULT_SIMILARITY_TOP_K, QueryType
|
||||
|
||||
|
||||
class TestExperienceManager:
|
||||
|
|
@ -129,3 +129,16 @@ class TestExperienceManager:
|
|||
manager = ExperienceManager(config=mock_config)
|
||||
storage = manager._create_chroma_storage()
|
||||
assert storage is not None
|
||||
|
||||
def test_get_ranker_configs_use_llm_ranker_true(self, mock_config):
|
||||
mock_config.exp_pool.use_llm_ranker = True
|
||||
manager = ExperienceManager(config=mock_config)
|
||||
ranker_configs = manager._get_ranker_configs()
|
||||
assert len(ranker_configs) == 1
|
||||
assert ranker_configs[0].top_n == DEFAULT_SIMILARITY_TOP_K
|
||||
|
||||
def test_get_ranker_configs_use_llm_ranker_false(self, mock_config):
|
||||
mock_config.exp_pool.use_llm_ranker = False
|
||||
manager = ExperienceManager(config=mock_config)
|
||||
ranker_configs = manager._get_ranker_configs()
|
||||
assert len(ranker_configs) == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue