Skip to content

Commit 0dadf25

Browse files
committed
cp dines
1 parent 0b81e31 commit 0dadf25

8 files changed

Lines changed: 4 additions & 106 deletions

File tree

docs/sdk/types.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,14 @@ These TypeDicts define parameters for storage object creation, listing, and down
8181
Scorer Parameters
8282
-----------------
8383

84-
These TypeDicts define parameters for scorer creation, listing, updating, and validation.
84+
These TypeDicts define parameters for scorer creation, listing, and updating.
8585

8686
.. autotypeddict:: runloop_api_client.sdk._types.SDKScorerCreateParams
8787

8888
.. autotypeddict:: runloop_api_client.sdk._types.SDKScorerListParams
8989

9090
.. autotypeddict:: runloop_api_client.sdk._types.SDKScorerUpdateParams
9191

92-
.. autotypeddict:: runloop_api_client.sdk._types.SDKScorerValidateParams
93-
9492
Core Request Options
9593
--------------------
9694

src/runloop_api_client/sdk/_types.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from .._types import Body, Query, Headers, Timeout, NotGiven
3838
from ..lib.polling import PollingConfig
3939
from ..types.devboxes import DiskSnapshotListParams, DiskSnapshotUpdateParams
40-
from ..types.scenarios import ScorerListParams, ScorerCreateParams, ScorerUpdateParams, ScorerValidateParams
40+
from ..types.scenarios import ScorerListParams, ScorerCreateParams, ScorerUpdateParams
4141
from ..types.devbox_create_params import DevboxBaseCreateParams
4242
from ..types.scenario_start_run_params import ScenarioStartRunBaseParams
4343
from ..types.benchmark_start_run_params import BenchmarkSelfStartRunParams
@@ -181,10 +181,6 @@ class SDKScorerUpdateParams(ScorerUpdateParams, LongRequestOptions):
181181
pass
182182

183183

184-
class SDKScorerValidateParams(ScorerValidateParams, LongRequestOptions):
185-
pass
186-
187-
188184
class SDKAgentCreateParams(AgentCreateParams, LongRequestOptions):
189185
pass
190186

src/runloop_api_client/sdk/async_scorer.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
from ._types import (
88
BaseRequestOptions,
99
SDKScorerUpdateParams,
10-
SDKScorerValidateParams,
1110
)
1211
from .._client import AsyncRunloop
13-
from ..types.scenarios import ScorerUpdateResponse, ScorerRetrieveResponse, ScorerValidateResponse
12+
from ..types.scenarios import ScorerUpdateResponse, ScorerRetrieveResponse
1413

1514

1615
class AsyncScorer:
@@ -66,12 +65,3 @@ async def update(self, **params: Unpack[SDKScorerUpdateParams]) -> ScorerUpdateR
6665
:rtype: ScorerUpdateResponse
6766
"""
6867
return await self._client.scenarios.scorers.update(self._id, **params)
69-
70-
async def validate(self, **params: Unpack[SDKScorerValidateParams]) -> ScorerValidateResponse:
71-
"""Run the scorer against the provided context and return the result.
72-
73-
:param params: See :typeddict:`~runloop_api_client.sdk._types.SDKScorerValidateParams` for available parameters
74-
:return: Validation result with score
75-
:rtype: ScorerValidateResponse
76-
"""
77-
return await self._client.scenarios.scorers.validate(self._id, **params)

src/runloop_api_client/sdk/scorer.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
from ._types import (
88
BaseRequestOptions,
99
SDKScorerUpdateParams,
10-
SDKScorerValidateParams,
1110
)
1211
from .._client import Runloop
13-
from ..types.scenarios import ScorerUpdateResponse, ScorerRetrieveResponse, ScorerValidateResponse
12+
from ..types.scenarios import ScorerUpdateResponse, ScorerRetrieveResponse
1413

1514

1615
class Scorer:
@@ -66,12 +65,3 @@ def update(self, **params: Unpack[SDKScorerUpdateParams]) -> ScorerUpdateRespons
6665
:rtype: ScorerUpdateResponse
6766
"""
6867
return self._client.scenarios.scorers.update(self._id, **params)
69-
70-
def validate(self, **params: Unpack[SDKScorerValidateParams]) -> ScorerValidateResponse:
71-
"""Run the scorer against the provided context and return the result.
72-
73-
:param params: See :typeddict:`~runloop_api_client.sdk._types.SDKScorerValidateParams` for available parameters
74-
:return: Validation result with score
75-
:rtype: ScorerValidateResponse
76-
"""
77-
return self._client.scenarios.scorers.validate(self._id, **params)

tests/sdk/test_async_scorer.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,3 @@ async def test_update(self, mock_async_client: AsyncMock) -> None:
4949

5050
assert result == update_response
5151
mock_async_client.scenarios.scorers.update.assert_awaited_once()
52-
53-
@pytest.mark.asyncio
54-
async def test_validate(self, mock_async_client: AsyncMock) -> None:
55-
"""Test validate method."""
56-
validate_response = SimpleNamespace(
57-
name="test_scorer",
58-
scoring_context={},
59-
scoring_result=SimpleNamespace(score=0.95),
60-
)
61-
mock_async_client.scenarios.scorers.validate = AsyncMock(return_value=validate_response)
62-
63-
scorer = AsyncScorer(mock_async_client, "sco_123")
64-
result = await scorer.validate(
65-
scoring_context={"test": "context"},
66-
)
67-
68-
assert result == validate_response
69-
mock_async_client.scenarios.scorers.validate.assert_awaited_once()

tests/sdk/test_scorer.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,3 @@ def test_update(self, mock_client: Mock) -> None:
4949
type="updated_scorer",
5050
bash_script="echo 'score=1.0'",
5151
)
52-
53-
def test_validate(self, mock_client: Mock) -> None:
54-
"""Test validate method."""
55-
validate_response = SimpleNamespace(
56-
name="test_scorer",
57-
scoring_context={},
58-
scoring_result=SimpleNamespace(score=0.95),
59-
)
60-
mock_client.scenarios.scorers.validate.return_value = validate_response
61-
62-
scorer = Scorer(mock_client, "sco_123")
63-
result = scorer.validate(
64-
scoring_context={"test": "context"},
65-
)
66-
67-
assert result == validate_response
68-
mock_client.scenarios.scorers.validate.assert_called_once_with(
69-
"sco_123",
70-
scoring_context={"test": "context"},
71-
)

tests/smoketests/sdk/test_async_scorer.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pytest
66

7-
from runloop_api_client import InternalServerError
87
from runloop_api_client.sdk import AsyncRunloopSDK
98
from tests.smoketests.utils import unique_name
109

@@ -71,24 +70,6 @@ async def test_scorer_update(self, async_sdk_client: AsyncRunloopSDK) -> None:
7170
assert info.type == updated_type
7271
assert info.bash_script == "echo 'score=1.0'"
7372

74-
@pytest.mark.timeout(ONE_MINUTE_TIMEOUT)
75-
async def test_scorer_validate(self, async_sdk_client: AsyncRunloopSDK) -> None:
76-
"""Test validating a scorer."""
77-
scorer_type = unique_name("sdk-async-scorer-validate")
78-
scorer = await async_sdk_client.scorer.create(
79-
type=scorer_type,
80-
bash_script="echo 'score=1.0'",
81-
)
82-
83-
try:
84-
result = await scorer.validate(
85-
scoring_context={},
86-
)
87-
assert result is not None
88-
except InternalServerError:
89-
# Backend may return 500 for validate endpoint - skip if this happens
90-
pytest.skip("Backend returned 500 for scorer validate endpoint")
91-
9273

9374
class TestAsyncScorerListing:
9475
"""Test async scorer listing and retrieval operations."""

tests/smoketests/sdk/test_scorer.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pytest
66

7-
from runloop_api_client import InternalServerError
87
from runloop_api_client.sdk import RunloopSDK
98
from tests.smoketests.utils import unique_name
109

@@ -71,24 +70,6 @@ def test_scorer_update(self, sdk_client: RunloopSDK) -> None:
7170
assert info.type == updated_type
7271
assert info.bash_script == "echo 'score=1.0'"
7372

74-
@pytest.mark.timeout(ONE_MINUTE_TIMEOUT)
75-
def test_scorer_validate(self, sdk_client: RunloopSDK) -> None:
76-
"""Test validating a scorer."""
77-
scorer_type = unique_name("sdk-scorer-validate")
78-
scorer = sdk_client.scorer.create(
79-
type=scorer_type,
80-
bash_script="echo 'score=1.0'",
81-
)
82-
83-
try:
84-
result = scorer.validate(
85-
scoring_context={},
86-
)
87-
assert result is not None
88-
except InternalServerError:
89-
# Backend may return 500 for validate endpoint - skip if this happens
90-
pytest.skip("Backend returned 500 for scorer validate endpoint")
91-
9273

9374
class TestScorerListing:
9475
"""Test scorer listing and retrieval operations."""

0 commit comments

Comments
 (0)