Class: CodeFunction<Input, Output, Fn>
Type parameters
Name | Type |
---|---|
Input | Input |
Output | Output |
Fn | extends GenericFunction <Input , Output > |
Constructors
constructor
• new CodeFunction<Input
, Output
, Fn
>(project
, opts
): CodeFunction
<Input
, Output
, Fn
>
Type parameters
Name | Type |
---|---|
Input | Input |
Output | Output |
Fn | extends GenericFunction <Input , Output > |
Parameters
Name | Type |
---|---|
project | Project |
opts | Omit <ToolOpts <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"