Reference/SDK/TypeScript/Classes

Class: CodeFunction<Input, Output, Fn>

Type parameters

NameType
InputInput
OutputOutput
Fnextends GenericFunction<Input, Output>

Constructors

constructor

new CodeFunction<Input, Output, Fn>(project, opts): CodeFunction<Input, Output, Fn>

Type parameters

NameType
InputInput
OutputOutput
Fnextends GenericFunction<Input, Output>

Parameters

NameType
projectProject
optsOmit<CodeOpts<Input, Output, Fn>, "name" | "slug"> & { name: string ; slug: string ; type: "llm" | "tool" | "scorer" | "task" }

Returns

CodeFunction<Input, Output, Fn>

Methods

key

key(): string

Returns

string

Properties

description

Optional Readonly description: string


handler

Readonly handler: Fn


ifExists

Optional Readonly ifExists: "error" | "replace" | "ignore"


name

Readonly name: string


parameters

Optional Readonly parameters: ZodType<Input, ZodTypeDef, Input>


project

Readonly project: Project


returns

Optional Readonly returns: ZodType<Output, ZodTypeDef, Output>


slug

Readonly slug: string


type

Readonly type: "llm" | "tool" | "scorer" | "task"

On this page