diff --git a/.stats.yml b/.stats.yml index f651632..ec9fdac 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/manugoyal%2Fbraintrust-sdk-a774951c03d7e2a49d4afa8e74454c0eef3a895ccb24d2187bdcd30b37923c66.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/manugoyal%2Fbraintrust-sdk-dd60fe261caab803c127a0f29cadcab5f1956be0a5a265100476b972b4b5b62e.yml diff --git a/src/resources/functions.ts b/src/resources/functions.ts index 2cfddcb..13143de 100644 --- a/src/resources/functions.ts +++ b/src/resources/functions.ts @@ -278,7 +278,12 @@ export interface FunctionUpdateParams { */ description?: string | null; - function_data?: FunctionUpdateParams.FunctionData; + function_data?: + | FunctionUpdateParams.Prompt + | FunctionUpdateParams.Code + | FunctionUpdateParams.Global + | FunctionUpdateParams.NullableVariant + | null; /** * Name of the prompt @@ -297,7 +302,90 @@ export interface FunctionUpdateParams { } export namespace FunctionUpdateParams { - export interface FunctionData {} + export interface Prompt { + type: 'prompt'; + } + + export interface Code { + data: Code.Bundle | Code.Inline; + + type: 'code'; + } + + export namespace Code { + export interface Bundle { + bundle_id: string; + + location: Bundle.Experiment | Bundle.Function; + + runtime_context: Bundle.RuntimeContext; + + type: 'bundle'; + + /** + * A preview of the code + */ + preview?: string | null; + } + + export namespace Bundle { + export interface Experiment { + eval_name: string; + + position: Experiment.Type | Experiment.Scorer; + + type: 'experiment'; + } + + export namespace Experiment { + export interface Type { + type: 'task'; + } + + export interface Scorer { + index: number; + + type: 'scorer'; + } + } + + export interface Function { + index: number; + + type: 'function'; + } + + export interface RuntimeContext { + runtime: 'node' | 'python'; + + version: string; + } + } + + export interface Inline { + code: string; + + runtime_context: Inline.RuntimeContext; + + type: 'inline'; + } + + export namespace Inline { + export interface RuntimeContext { + runtime: 'node' | 'python'; + + version: string; + } + } + } + + export interface Global { + name: string; + + type: 'global'; + } + + export interface NullableVariant {} } export interface FunctionListParams extends ListObjectsParams {