@@ -6,6 +6,13 @@ import * as Core from '../../core';
66import { ScenarioScorersCursorIDPage , type ScenarioScorersCursorIDPageParams } from '../../pagination' ;
77
88export class Scorers extends APIResource {
9+ /**
10+ * Create a custom scenario scorer.
11+ */
12+ create ( body : ScorerCreateParams , options ?: Core . RequestOptions ) : Core . APIPromise < ScorerCreateResponse > {
13+ return this . _client . post ( '/v1/scenarios/scorers' , { body, ...options } ) ;
14+ }
15+
916 /**
1017 * Retrieve Scenario Scorer.
1118 */
@@ -50,6 +57,26 @@ export class Scorers extends APIResource {
5057
5158export class ScorerListResponsesScenarioScorersCursorIDPage extends ScenarioScorersCursorIDPage < ScorerListResponse > { }
5259
60+ /**
61+ * A ScenarioScorerView represents a custom scoring function for a Scenario.
62+ */
63+ export interface ScorerCreateResponse {
64+ /**
65+ * ID for the scenario scorer.
66+ */
67+ id : string ;
68+
69+ /**
70+ * Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.
71+ */
72+ bash_script : string ;
73+
74+ /**
75+ * Name of the type of scenario scorer.
76+ */
77+ type : string ;
78+ }
79+
5380/**
5481 * A ScenarioScorerView represents a custom scoring function for a Scenario.
5582 */
@@ -110,6 +137,19 @@ export interface ScorerListResponse {
110137 type : string ;
111138}
112139
140+ export interface ScorerCreateParams {
141+ /**
142+ * Bash script for the custom scorer taking context as a json object
143+ * $RL_SCORER_CONTEXT.
144+ */
145+ bash_script : string ;
146+
147+ /**
148+ * Name of the type of custom scorer.
149+ */
150+ type : string ;
151+ }
152+
113153export interface ScorerUpdateParams {
114154 /**
115155 * Bash script for the custom scorer taking context as a json object
@@ -129,10 +169,12 @@ Scorers.ScorerListResponsesScenarioScorersCursorIDPage = ScorerListResponsesScen
129169
130170export declare namespace Scorers {
131171 export {
172+ type ScorerCreateResponse as ScorerCreateResponse ,
132173 type ScorerRetrieveResponse as ScorerRetrieveResponse ,
133174 type ScorerUpdateResponse as ScorerUpdateResponse ,
134175 type ScorerListResponse as ScorerListResponse ,
135176 ScorerListResponsesScenarioScorersCursorIDPage as ScorerListResponsesScenarioScorersCursorIDPage ,
177+ type ScorerCreateParams as ScorerCreateParams ,
136178 type ScorerUpdateParams as ScorerUpdateParams ,
137179 type ScorerListParams as ScorerListParams ,
138180 } ;
0 commit comments