@@ -280,61 +280,58 @@ def explore(
280280 self ,
281281 goal : str | None = None ,
282282 interactive : bool = True ,
283- llm_model : str = "gpt-4o-mini" ,
283+ llm_model : str = "gpt-4o" ,
284+ llm_config : dict [str , Any ] | None = None ,
284285 max_turns : int | None = None ,
285286 verbose : bool = True ,
286287 ) -> Any :
287288 """
288289 Explore this research paper interactively with AI agents.
289-
290290 This is the recommended way to understand and experiment with research code.
291291 Creates a 2-agent system where one agent proposes experiments and another
292292 executes them in the paper's Docker environment.
293-
294293 Args:
295294 goal: Optional custom exploration goal. If None, uses a default exploration plan.
296295 interactive: If True, pauses for human guidance at each step. If False, runs automatically.
297- llm_model: The LLM model to use for the exploring agent. Default is "gpt-4o-mini".
296+ llm_model: The LLM model to use for the exploring agent. Default is "gpt-4o". Ignored if llm_config provided.
297+ llm_config: Full LLM config dict. If None, creates default OpenAI config with llm_model.
298298 max_turns: Maximum number of conversation turns. If None, continues until termination.
299299 verbose: If True, prints session header and summary. If False, runs quietly.
300-
301300 Returns:
302301 The chat result from the exploration session.
303-
304302 Example:
305303 >>> # Interactive exploration (recommended for learning)
306- >>> executor = RemyxCodeExecutor(arxiv_id="2010.11929v2 ")
304+ >>> executor = RemyxCodeExecutor(arxiv_id="2508.06434v1 ")
307305 >>> result = executor.explore(
308306 ... goal="Help me understand the main innovation from this paper", interactive=True
309307 ... )
310-
311308 >>> # Automated exploration (good for batch experiments)
312309 >>> result = executor.explore(
313310 ... goal="Run all examples and benchmarks",
314311 ... interactive=False,
315312 ... verbose=False, # Quiet mode
316313 ... )
314+ >>> # Use different LLM provider
315+ >>> result = executor.explore(
316+ ... llm_config={"model": "gemini-2.0-flash-exp", "api_key": os.getenv("GOOGLE_API_KEY"), "api_type": "google"}
317+ ... )
317318 """
318319 from autogen import ConversableAgent , LLMConfig
319320
320321 # Default exploration goal
321322 default_goal = """Perform an interactive exploration of this research paper:
322-
323323**Phase 1: Understanding** (2-3 turns)
3243241. Examine the directory structure
3253252. Read README and identify key files
3263263. Understand the paper's implementation
327-
328327**Phase 2: Experimentation** (3-5 turns)
3293284. Run a minimal working example
3303295. Experiment with different parameters
3313306. Generate visualizations if applicable
332-
333331**Phase 3: Analysis** (2-3 turns)
3343327. Explain key implementation details
3353338. Answer any questions about the code
3363349. Suggest possible modifications/experiments
337-
338335Work step-by-step. Wait for human guidance between phases.
339336Type TERMINATE when exploration is complete."""
340337
@@ -343,10 +340,8 @@ def explore(
343340
344341 # Create system message for writer agent
345342 system_message = f"""{ paper_context }
346-
347343**Your Mission:**
348344{ goal or default_goal }
349-
350345**Important Guidelines:**
351346- Repository is at /app with all dependencies installed
352347- Execute ONE command at a time - don't rush
@@ -356,7 +351,6 @@ def explore(
356351- Wait for human feedback before major actions (if interactive mode)
357352- Focus on lightweight demos unless instructed otherwise
358353- You can install additional packages if needed
359-
360354**What You Can Do:**
361355✓ Read and analyze code
362356✓ Execute Python/bash commands
@@ -365,7 +359,6 @@ def explore(
365359✓ Install additional dependencies
366360✓ Answer questions about implementation
367361✓ Suggest improvements or experiments
368-
369362Begin by exploring the repository structure to understand what's available."""
370363
371364 # Create executor agent (no LLM)
@@ -377,14 +370,18 @@ def explore(
377370 is_termination_msg = lambda x : "TERMINATE" in x .get ("content" , "" ).upper (),
378371 )
379372
373+ # Use provided config or create default
374+ if llm_config is None :
375+ llm_config = {
376+ "model" : llm_model ,
377+ "api_key" : os .getenv ("OPENAI_API_KEY" ),
378+ }
379+
380380 # Create writer agent (has LLM)
381381 writer_agent = ConversableAgent (
382382 "research_explorer" ,
383383 system_message = system_message ,
384- llm_config = LLMConfig (
385- model = llm_model ,
386- api_key = os .getenv ("OPENAI_API_KEY" ),
387- ),
384+ llm_config = llm_config ,
388385 code_execution_config = False ,
389386 max_consecutive_auto_reply = 50 ,
390387 human_input_mode = "ALWAYS" if interactive else "NEVER" ,
@@ -440,22 +437,20 @@ def create_agents(
440437 self ,
441438 goal : str | None = None ,
442439 llm_model : str = "gpt-4o-mini" ,
440+ llm_config : dict [str , Any ] | None = None ,
443441 human_input_mode : Literal ["ALWAYS" , "NEVER" , "TERMINATE" ] = "ALWAYS" ,
444442 ) -> tuple [Any , Any ]:
445443 """
446444 Create the 2-agent system without starting exploration.
447-
448445 Use this if you want more control over the exploration process.
449446 Most users should use the simpler `explore()` method instead.
450-
451447 Args:
452448 goal: Optional custom exploration goal.
453- llm_model: The LLM model to use.
449+ llm_model: The LLM model to use. Ignored if llm_config provided.
450+ llm_config: Full LLM config dict. If None, creates default OpenAI config with llm_model.
454451 human_input_mode: "ALWAYS" for interactive, "NEVER" for automated.
455-
456452 Returns:
457453 Tuple of (executor_agent, writer_agent)
458-
459454 Example:
460455 >>> executor = RemyxCodeExecutor(arxiv_id="2010.11929v2")
461456 >>> executor_agent, writer_agent = executor.create_agents()
@@ -473,17 +468,14 @@ def create_agents(
473468
474469 # Create system message
475470 system_message = f"""{ paper_context }
476-
477471**Your Mission:**
478472{ goal or default_goal }
479-
480473**Guidelines:**
481474- Repository is at /app with all dependencies installed
482475- Execute ONE command at a time
483476- Use absolute paths starting with /app
484477- Be conversational and explain your actions
485478- Debug step-by-step if errors occur
486-
487479Begin by exploring the repository structure."""
488480
489481 # Create executor agent
@@ -495,14 +487,18 @@ def create_agents(
495487 is_termination_msg = lambda x : "TERMINATE" in x .get ("content" , "" ).upper (),
496488 )
497489
490+ # Use provided config or create default
491+ if llm_config is None :
492+ llm_config = {
493+ "model" : llm_model ,
494+ "api_key" : os .getenv ("OPENAI_API_KEY" ),
495+ }
496+
498497 # Create writer agent
499498 writer_agent = ConversableAgent (
500499 "research_explorer" ,
501500 system_message = system_message ,
502- llm_config = LLMConfig (
503- model = llm_model ,
504- api_key = os .getenv ("OPENAI_API_KEY" ),
505- ),
501+ llm_config = llm_config ,
506502 code_execution_config = False ,
507503 max_consecutive_auto_reply = 50 ,
508504 human_input_mode = human_input_mode ,
0 commit comments