Skip to content

Commit c633dbc

Browse files
fix(test): 'get_model'-> 'get_language_model'
1 parent dbfc973 commit c633dbc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/sdk/metrics/test_metric_scope.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ class TestMetricWithScope:
9696

9797
def test_numeric_judge_with_metric_scope(self):
9898
"""Test NumericJudge with metric_scope."""
99-
with patch("rhesis.sdk.models.factory.get_model") as mock_get_model:
99+
with patch("rhesis.sdk.models.factory.get_language_model") as mock_get_language_model:
100100
mock_model = Mock()
101-
mock_get_model.return_value = mock_model
101+
mock_get_language_model.return_value = mock_model
102102

103103
metric = NumericJudge(
104104
name="test_numeric",
@@ -112,9 +112,9 @@ def test_numeric_judge_with_metric_scope(self):
112112

113113
def test_numeric_judge_to_config_includes_metric_scope(self):
114114
"""Test that NumericJudge.to_config() includes metric_scope."""
115-
with patch("rhesis.sdk.models.factory.get_model") as mock_get_model:
115+
with patch("rhesis.sdk.models.factory.get_language_model") as mock_get_language_model:
116116
mock_model = Mock()
117-
mock_get_model.return_value = mock_model
117+
mock_get_language_model.return_value = mock_model
118118

119119
metric = NumericJudge(
120120
name="test_numeric",
@@ -138,9 +138,9 @@ def test_push_metric_with_scope(self, mock_client_class):
138138
mock_client = Mock()
139139
mock_client_class.return_value = mock_client
140140

141-
with patch("rhesis.sdk.models.factory.get_model") as mock_get_model:
141+
with patch("rhesis.sdk.models.factory.get_language_model") as mock_get_language_model:
142142
mock_model = Mock()
143-
mock_get_model.return_value = mock_model
143+
mock_get_language_model.return_value = mock_model
144144

145145
metric = NumericJudge(
146146
name="test_metric",
@@ -182,9 +182,9 @@ def test_pull_metric_with_scope(self, mock_client_class):
182182
]
183183
mock_client.send_request.return_value = backend_response
184184

185-
with patch("rhesis.sdk.models.factory.get_model") as mock_get_model:
185+
with patch("rhesis.sdk.models.factory.get_language_model") as mock_get_language_model:
186186
mock_model = Mock()
187-
mock_get_model.return_value = mock_model
187+
mock_get_language_model.return_value = mock_model
188188

189189
# Mock the from_config method to avoid actual instantiation issues
190190
with patch.object(NumericJudge, "from_config") as mock_from_config:

tests/sdk/services/mcp/test_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def test_agent_initialization_without_client_raises(self, mock_model):
6565

6666
def test_agent_initialization_with_string_model(self, mock_mcp_client):
6767
"""Test agent initialization with string model name"""
68-
with patch("rhesis.sdk.services.mcp.agent.get_model") as mock_get_model:
68+
with patch("rhesis.sdk.services.mcp.agent.get_language_model") as mock_get_language_model:
6969
mock_model = Mock()
70-
mock_get_model.return_value = mock_model
70+
mock_get_language_model.return_value = mock_model
7171

7272
agent = MCPAgent(model="gpt-4", mcp_client=mock_mcp_client)
7373

7474
assert agent.model == mock_model
75-
mock_get_model.assert_called_once_with("gpt-4")
75+
mock_get_language_model.assert_called_once_with("gpt-4")
7676

7777
def test_agent_loads_default_system_prompt(self, mock_mcp_client, mock_model):
7878
"""Test agent loads default system prompt"""

0 commit comments

Comments
 (0)