Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/01_standalone_sdk/19_llm_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
api_key = os.getenv("LLM_API_KEY")
assert api_key is not None, "LLM_API_KEY environment variable is not set."
model = os.getenv("LLM_MODEL", "gpt-5.5")
secondary_model = os.getenv("LLM_ROUTING_SECONDARY_MODEL", model)
base_url = os.getenv("LLM_BASE_URL")

primary_llm = LLM(
Expand All @@ -33,7 +34,7 @@
)
secondary_llm = LLM(
usage_id="agent-secondary",
model="openhands/devstral-small-2507",
model=secondary_model,
base_url=base_url,
api_key=SecretStr(api_key),
)
Expand Down
14 changes: 12 additions & 2 deletions examples/01_standalone_sdk/31_iterative_refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@


QUALITY_THRESHOLD = float(os.getenv("QUALITY_THRESHOLD", "90.0"))
MAX_ITERATIONS = int(os.getenv("MAX_ITERATIONS", "5"))
MAX_ITERATIONS = int(os.getenv("MAX_ITERATIONS", "2"))
PHASE_MAX_ITERATIONS = int(os.getenv("PHASE_MAX_ITERATIONS", "15"))
COBOL_SAMPLE_LIMIT = max(1, int(os.getenv("COBOL_SAMPLE_LIMIT", "1")))


def setup_workspace() -> tuple[Path, Path, Path]:
Expand Down Expand Up @@ -229,7 +231,7 @@ def create_sample_cobol_files(cobol_dir: Path) -> list[str]:
}

created_files = []
for filename, content in sample_files.items():
for filename, content in list(sample_files.items())[:COBOL_SAMPLE_LIMIT]:
file_path = cobol_dir / filename
file_path.write_text(content)
created_files.append(filename)
Expand Down Expand Up @@ -265,6 +267,8 @@ def get_refactoring_prompt(
the format: @source <program>:<line numbers> (e.g., @source CBACT01C.cbl:73-77)
8. Create a clean, maintainable object-oriented design
9. Each Java file should be compilable and follow Java best practices
10. Keep this demo conversion compact; after the listed Java files are written,
finish without exploring unrelated files or starting extra work.

Read each COBOL file and create the corresponding Java file in the target directory.
"""
Expand Down Expand Up @@ -337,6 +341,7 @@ def get_critique_prompt(
3. [Third priority]

Save this report to: {java_dir.parent}/critiques/critique_report.md
After saving the report, finish without starting any additional work.
"""


Expand Down Expand Up @@ -384,6 +389,9 @@ def run_iterative_refinement() -> None:
print(f"COBOL Directory: {cobol_dir}")
print(f"Java Directory: {java_dir}")
print(f"Critique Directory: {critique_dir}")
print(f"Max refinement iterations: {MAX_ITERATIONS}")
print(f"Max agent steps per phase: {PHASE_MAX_ITERATIONS}")
print(f"Sample COBOL files: {COBOL_SAMPLE_LIMIT}")
print()

# Create sample COBOL files
Expand All @@ -409,6 +417,7 @@ def run_iterative_refinement() -> None:
refactoring_conversation = Conversation(
agent=refactoring_agent,
workspace=str(workspace_dir),
max_iteration_per_run=PHASE_MAX_ITERATIONS,
)

previous_critique = critique_file if iteration > 1 else None
Expand All @@ -426,6 +435,7 @@ def run_iterative_refinement() -> None:
critique_conversation = Conversation(
agent=critique_agent,
workspace=str(workspace_dir),
max_iteration_per_run=PHASE_MAX_ITERATIONS,
)

critique_prompt = get_critique_prompt(cobol_dir, java_dir, cobol_files)
Expand Down
2 changes: 1 addition & 1 deletion openhands-agent-server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openhands-agent-server"
version = "1.31.2"
version = "1.32.0"
description = "OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent"

requires-python = ">=3.12"
Expand Down
2 changes: 1 addition & 1 deletion openhands-sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openhands-sdk"
version = "1.31.2"
version = "1.32.0"
description = "OpenHands SDK - Core functionality for building AI agents"

requires-python = ">=3.12"
Expand Down
2 changes: 1 addition & 1 deletion openhands-tools/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openhands-tools"
version = "1.31.2"
version = "1.32.0"
description = "OpenHands Tools - Runtime tools for AI agents"

requires-python = ">=3.12"
Expand Down
2 changes: 1 addition & 1 deletion openhands-workspace/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openhands-workspace"
version = "1.31.2"
version = "1.32.0"
description = "OpenHands Workspace - Docker and container-based workspace implementations"

requires-python = ">=3.12"
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading