mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
CLI: rename deprecated args (#11568)
This commit is contained in:
@@ -174,7 +174,7 @@ class SettingsScreen:
|
|||||||
model=model,
|
model=model,
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
base_url=base_url,
|
base_url=base_url,
|
||||||
service_id='agent',
|
usage_id='agent',
|
||||||
metadata=get_llm_metadata(model_name=model, llm_type='agent'),
|
metadata=get_llm_metadata(model_name=model, llm_type='agent'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def read_json(path: Path) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
def make_screen_with_conversation(model='openai/gpt-4o-mini', api_key='sk-xyz'):
|
def make_screen_with_conversation(model='openai/gpt-4o-mini', api_key='sk-xyz'):
|
||||||
llm = LLM(model=model, api_key=SecretStr(api_key), service_id='test-service')
|
llm = LLM(model=model, api_key=SecretStr(api_key), usage_id='test-service')
|
||||||
# Conversation(agent) signature may vary across versions; adapt if needed:
|
# Conversation(agent) signature may vary across versions; adapt if needed:
|
||||||
from openhands.sdk.agent import Agent
|
from openhands.sdk.agent import Agent
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ def seed_file(path: Path, model: str = 'openai/gpt-4o-mini', api_key: str = 'sk-
|
|||||||
store = AgentStore()
|
store = AgentStore()
|
||||||
store.file_store = LocalFileStore(root=str(path))
|
store.file_store = LocalFileStore(root=str(path))
|
||||||
agent = get_default_cli_agent(
|
agent = get_default_cli_agent(
|
||||||
llm=LLM(model=model, api_key=SecretStr(api_key), service_id='test-service')
|
llm=LLM(model=model, api_key=SecretStr(api_key), usage_id='test-service')
|
||||||
)
|
)
|
||||||
store.save(agent)
|
store.save(agent)
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class FakeAgent(AgentBase):
|
|||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def agent() -> FakeAgent:
|
def agent() -> FakeAgent:
|
||||||
llm = LLM(**default_config(), service_id='test-service')
|
llm = LLM(**default_config(), usage_id='test-service')
|
||||||
return FakeAgent(llm=llm, tools=[])
|
return FakeAgent(llm=llm, tools=[])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class TestToolFix:
|
|||||||
"""Test that entire tools list is replaced with default tools when loading agent."""
|
"""Test that entire tools list is replaced with default tools when loading agent."""
|
||||||
# Create a mock agent with different tools and working directories
|
# Create a mock agent with different tools and working directories
|
||||||
mock_agent = Agent(
|
mock_agent = Agent(
|
||||||
llm=LLM(model='test/model', api_key='test-key', service_id='test-service'),
|
llm=LLM(model='test/model', api_key='test-key', usage_id='test-service'),
|
||||||
tools=[
|
tools=[
|
||||||
Tool(name='BashTool'),
|
Tool(name='BashTool'),
|
||||||
Tool(name='FileEditorTool'),
|
Tool(name='FileEditorTool'),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ def _create_agent(mcp_config=None) -> Agent:
|
|||||||
if mcp_config is None:
|
if mcp_config is None:
|
||||||
mcp_config = {}
|
mcp_config = {}
|
||||||
return Agent(
|
return Agent(
|
||||||
llm=LLM(model='test-model', api_key='test-key', service_id='test-service'),
|
llm=LLM(model='test-model', api_key='test-key', usage_id='test-service'),
|
||||||
tools=[],
|
tools=[],
|
||||||
mcp_config=mcp_config,
|
mcp_config=mcp_config,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user