mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
Merge branch 'dev' of https://github.com/geekan/MetaGPT into geekan/dev
This commit is contained in:
commit
6c7219968c
3 changed files with 8 additions and 7 deletions
|
|
@ -47,15 +47,15 @@ class ContextMixin(BaseModel):
|
|||
|
||||
def set_context(self, context: Context, override=True):
|
||||
"""Set context"""
|
||||
self.set("_context", context, override)
|
||||
self.set("private_context", context, override)
|
||||
|
||||
def set_config(self, config: Config, override=False):
|
||||
"""Set config"""
|
||||
self.set("_config", config, override)
|
||||
self.set("private_config", config, override)
|
||||
|
||||
def set_llm(self, llm: BaseLLM, override=False):
|
||||
"""Set llm"""
|
||||
self.set("_llm", llm, override)
|
||||
self.set("private_llm", llm, override)
|
||||
|
||||
@property
|
||||
def config(self) -> Config:
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -53,12 +53,12 @@ def test_config_mixin_2():
|
|||
i = Config(llm=mock_llm_config)
|
||||
j = Config(llm=mock_llm_config_proxy)
|
||||
obj = ModelX(config=i)
|
||||
assert obj.private_config == i
|
||||
assert obj.private_config.llm == mock_llm_config
|
||||
assert obj.config == i
|
||||
assert obj.config.llm == mock_llm_config
|
||||
|
||||
obj.set_config(j)
|
||||
# obj already has a config, so it will not be set
|
||||
assert obj.private_config == i
|
||||
assert obj.config == i
|
||||
|
||||
|
||||
def test_config_mixin_3():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue