Skip to content

Commit bbc3cc7

Browse files
committed
added set_llm method
1 parent eac6d47 commit bbc3cc7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mesa_llm/llm_agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33

44
class LLMAgent:
55
def __init__(self, api_key: str, model: str = "openai/gpt-4o"):
6+
"""Initialize the LLMAgent with a ModuleLLM instance."""
7+
self.llm = ModuleLLM(api_key=api_key, model=model)
8+
9+
def set_llm(self, api_key: str, model: str = "openai/gpt-4o") -> None:
10+
"""Replace the current LLM with a new configuration."""
611
self.llm = ModuleLLM(api_key=api_key, model=model)

0 commit comments

Comments
 (0)