Merge branch 'main' into fix/provider-registration-bugs
This commit is contained in:
@@ -147,17 +147,23 @@ class PlannerAgent(Agent):
|
||||
pretty_print(f"{task['agent']} -> {task['task']}", color="info")
|
||||
pretty_print("▔▗ E N D ▖▔", color="status")
|
||||
|
||||
async def make_plan(self, prompt: str) -> str:
|
||||
async def make_plan(self, prompt: str, max_retries: int = 4) -> str:
|
||||
"""
|
||||
Asks the LLM to make a plan.
|
||||
Args:
|
||||
prompt (str): The prompt to be sent to the LLM.
|
||||
max_retries (int): Maximum number of retries before giving up.
|
||||
Returns:
|
||||
str: The plan made by the LLM.
|
||||
"""
|
||||
ok = False
|
||||
answer = None
|
||||
retries = 0
|
||||
while not ok:
|
||||
if retries >= max_retries:
|
||||
pretty_print(f"Failed to make a plan after {max_retries} attempts. Giving up.", color="failure")
|
||||
self.logger.warning(f"make_plan exceeded max retries ({max_retries}).")
|
||||
return []
|
||||
animate_thinking("Thinking...", color="status")
|
||||
self.memory.push('user', prompt)
|
||||
answer, reasoning = await self.llm_request()
|
||||
@@ -168,6 +174,7 @@ class PlannerAgent(Agent):
|
||||
self.show_plan(agents_tasks, answer)
|
||||
prompt = f"Failed to parse the tasks. Please write down your task followed by a json plan within ```json. Do not ask for clarification.\n"
|
||||
pretty_print("Failed to make plan. Retrying...", color="warning")
|
||||
retries += 1
|
||||
continue
|
||||
self.show_plan(agents_tasks, answer)
|
||||
ok = True
|
||||
|
||||
@@ -419,11 +419,13 @@ class Provider:
|
||||
def minimax_fn(self, history, verbose=False):
|
||||
"""
|
||||
Use MiniMax API to generate text via OpenAI-compatible interface.
|
||||
|
||||
|
||||
Supported models:
|
||||
- MiniMax-M2.7: Latest flagship model with enhanced reasoning and coding
|
||||
- MiniMax-M2.7-highspeed: High-speed version of M2.7 for low-latency scenarios
|
||||
- MiniMax-M2.5: Peak performance model (~60 tps), 204,800 context window
|
||||
- MiniMax-M2.5-highspeed: Same performance, faster (~100 tps)
|
||||
|
||||
|
||||
Note: temperature must be in range (0.0, 1.0], default is 1.0
|
||||
"""
|
||||
load_dotenv()
|
||||
|
||||
Reference in New Issue
Block a user