Skip to content

Commit 507a60d

Browse files
authored
Merge pull request #36 from root-signals/remove-objective-run
Replace objective run with evaluator judge run
2 parents 6fcf1a5 + f636c64 commit 507a60d

File tree

2 files changed

+0
-180
lines changed

2 files changed

+0
-180
lines changed

examples/objective.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/root/objectives.py

Lines changed: 0 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@
88

99
from .generated.openapi_aclient import ApiClient as AApiClient
1010
from .generated.openapi_aclient.api.v1_api import V1Api as AObjectivesApi
11-
from .generated.openapi_aclient.models.evaluator_execution_functions_request import (
12-
EvaluatorExecutionFunctionsRequest as AEvaluatorExecutionFunctionsRequest,
13-
)
1411
from .generated.openapi_aclient.models.objective import Objective as AOpenApiObjective
15-
from .generated.openapi_aclient.models.objective_execution_request import (
16-
ObjectiveExecutionRequest as AObjectiveExecutionRequest,
17-
)
1812
from .generated.openapi_aclient.models.objective_list import ObjectiveList as AObjectiveList
1913
from .generated.openapi_aclient.models.objective_request import ObjectiveRequest as AObjectiveRequest
2014
from .generated.openapi_aclient.models.paginated_objective_list import (
@@ -26,21 +20,13 @@
2620
from .generated.openapi_aclient.models.patched_objective_request import (
2721
PatchedObjectiveRequest as APatchedObjectiveRequest,
2822
)
29-
from .generated.openapi_aclient.models.validator_execution_result import (
30-
ValidatorExecutionResult as AValidatorExecutionResult,
31-
)
3223
from .generated.openapi_client import ApiClient
3324
from .generated.openapi_client.api.v1_api import V1Api as ObjectivesApi
34-
from .generated.openapi_client.models.evaluator_execution_functions_request import (
35-
EvaluatorExecutionFunctionsRequest,
36-
)
3725
from .generated.openapi_client.models.objective import Objective as OpenApiObjective
38-
from .generated.openapi_client.models.objective_execution_request import ObjectiveExecutionRequest
3926
from .generated.openapi_client.models.objective_list import ObjectiveList
4027
from .generated.openapi_client.models.objective_request import ObjectiveRequest
4128
from .generated.openapi_client.models.paginated_objective_list import PaginatedObjectiveList
4229
from .generated.openapi_client.models.patched_objective_request import PatchedObjectiveRequest
43-
from .generated.openapi_client.models.validator_execution_result import ValidatorExecutionResult
4430
from .skills import Skills
4531
from .utils import ClientContextCallable, iterate_cursor_list, with_async_client, with_sync_client
4632
from .validators import AValidator
@@ -101,43 +87,6 @@ def _wrap(cls, apiobj: OpenApiObjective, client_context: ClientContextCallable)
10187
obj.client_context = client_context
10288
return obj
10389

104-
@with_sync_client
105-
def run(
106-
self,
107-
*,
108-
response: str,
109-
request: Optional[str] = None,
110-
contexts: Optional[List[str]] = None,
111-
functions: Optional[List[EvaluatorExecutionFunctionsRequest]] = None,
112-
expected_output: Optional[str] = None,
113-
_request_timeout: Optional[int] = None,
114-
_client: ApiClient,
115-
) -> ValidatorExecutionResult:
116-
"""
117-
Run all validators associated with the objective.
118-
119-
Args:
120-
response: LLM output.
121-
request: The prompt sent to the LLM. Optional.
122-
contexts: Optional documents passed to RAG evaluators
123-
functions: Optional function definitions to LLM tool call validation
124-
expected_output: Optional expected output for the evaluators
125-
"""
126-
127-
api_instance = ObjectivesApi(_client)
128-
skill_execution_request = ObjectiveExecutionRequest(
129-
request=request,
130-
response=response,
131-
contexts=contexts,
132-
functions=functions,
133-
expected_output=expected_output,
134-
)
135-
return api_instance.v1_objectives_objectives_execute_create(
136-
objective_id=self.id,
137-
objective_execution_request=skill_execution_request,
138-
_request_timeout=_request_timeout,
139-
)
140-
14190

14291
class AObjective(AOpenApiObjective):
14392
"""
@@ -158,43 +107,6 @@ async def _awrap(cls, apiobj: AOpenApiObjective, client_context: ClientContextCa
158107
obj.client_context = client_context
159108
return obj
160109

161-
@with_async_client
162-
async def arun(
163-
self,
164-
*,
165-
response: str,
166-
request: Optional[str] = None,
167-
contexts: Optional[List[str]] = None,
168-
functions: Optional[List[AEvaluatorExecutionFunctionsRequest]] = None,
169-
expected_output: Optional[str] = None,
170-
_request_timeout: Optional[int] = None,
171-
_client: AApiClient,
172-
) -> AValidatorExecutionResult:
173-
"""
174-
Asynchronously run all validators associated with the objective.
175-
176-
Args:
177-
response: LLM output.
178-
request: The prompt sent to the LLM. Optional.
179-
contexts: Optional documents passed to RAG evaluators
180-
functions: Optional function definitions to LLM tool call validation
181-
expected_output: Optional expected output for the evaluators
182-
"""
183-
184-
api_instance = AObjectivesApi(_client)
185-
skill_execution_request = AObjectiveExecutionRequest(
186-
request=request,
187-
response=response,
188-
contexts=contexts,
189-
functions=functions,
190-
expected_output=expected_output,
191-
)
192-
return await api_instance.v1_objectives_objectives_execute_create(
193-
objective_id=self.id,
194-
objective_execution_request=skill_execution_request,
195-
_request_timeout=_request_timeout,
196-
)
197-
198110

199111
class Objectives:
200112
"""
@@ -378,78 +290,6 @@ async def alist(self, *, intent: Optional[str] = None, limit: int = 100) -> Asyn
378290
if not (cursor := result.next):
379291
return
380292

381-
@with_sync_client
382-
def run(
383-
self,
384-
objective_id: str,
385-
*,
386-
response: str,
387-
request: Optional[str] = None,
388-
contexts: Optional[List[str]] = None,
389-
functions: Optional[List[EvaluatorExecutionFunctionsRequest]] = None,
390-
expected_output: Optional[str] = None,
391-
_request_timeout: Optional[int] = None,
392-
_client: ApiClient,
393-
) -> ValidatorExecutionResult:
394-
"""
395-
Run all validators associated with an objective.
396-
397-
Args:
398-
response: LLM output.
399-
request: The prompt sent to the LLM. Optional.
400-
contexts: Optional documents passed to RAG evaluators
401-
"""
402-
403-
api_instance = ObjectivesApi(_client)
404-
skill_execution_request = ObjectiveExecutionRequest(
405-
request=request,
406-
response=response,
407-
contexts=contexts,
408-
functions=functions,
409-
expected_output=expected_output,
410-
)
411-
return api_instance.v1_objectives_objectives_execute_create(
412-
objective_id=objective_id,
413-
objective_execution_request=skill_execution_request,
414-
_request_timeout=_request_timeout,
415-
)
416-
417-
@with_async_client
418-
async def arun(
419-
self,
420-
objective_id: str,
421-
*,
422-
_client: AApiClient,
423-
response: str,
424-
request: Optional[str] = None,
425-
contexts: Optional[List[str]] = None,
426-
functions: Optional[List[AEvaluatorExecutionFunctionsRequest]] = None,
427-
expected_output: Optional[str] = None,
428-
_request_timeout: Optional[int] = None,
429-
) -> AValidatorExecutionResult:
430-
"""
431-
Asynchronously run all validators associated with an objective.
432-
433-
Args:
434-
response: LLM output.
435-
request: The prompt sent to the LLM. Optional.
436-
contexts: Optional documents passed to RAG evaluators
437-
"""
438-
439-
api_instance = AObjectivesApi(_client)
440-
skill_execution_request = AObjectiveExecutionRequest(
441-
request=request,
442-
response=response,
443-
contexts=contexts,
444-
functions=functions,
445-
expected_output=expected_output,
446-
)
447-
return await api_instance.v1_objectives_objectives_execute_create(
448-
objective_id=objective_id,
449-
objective_execution_request=skill_execution_request,
450-
_request_timeout=_request_timeout,
451-
)
452-
453293
@with_sync_client
454294
def update(
455295
self,

0 commit comments

Comments
 (0)