Skip to content

Commit 57f9310

Browse files
committed
Update optillm.py
1 parent ac48ca9 commit 57f9310

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

optillm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from cot_reflection import cot_reflection
1717
from plansearch import plansearch
1818
from leap import leap
19+
from agent import agent_approach
1920

2021
# Setup logging
2122
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -98,6 +99,8 @@ def proxy():
9899
final_response = plansearch(system_prompt, initial_query, client, model, n=n)
99100
elif approach == 'leap':
100101
final_response = leap(system_prompt, initial_query, client, model)
102+
elif approach == 'agent':
103+
final_response = agent_approach(system_prompt, initial_query, client, model, max_attempts=3)
101104
else:
102105
raise ValueError(f"Unknown approach: {approach}")
103106
except Exception as e:
@@ -135,7 +138,7 @@ def proxy():
135138
def main():
136139
parser = argparse.ArgumentParser(description="Run LLM inference with various approaches.")
137140
parser.add_argument("--approach", type=str, choices=["auto", "mcts", "bon", "moa", "rto", "z3", "self_consistency", "pvg", "rstar",
138-
"cot_reflection", "plansearch", "leap"], default="auto", help="Inference approach to use")
141+
"cot_reflection", "plansearch", "leap", "agent"], default="auto", help="Inference approach to use")
139142
parser.add_argument("--simulations", type=int, default=2, help="Number of MCTS simulations")
140143
parser.add_argument("--exploration", type=float, default=0.2, help="Exploration weight for MCTS")
141144
parser.add_argument("--depth", type=int, default=1, help="Simulation depth for MCTS")

0 commit comments

Comments
 (0)