mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 06:12:26 +00:00
30 lines
717 B
TypeScript
30 lines
717 B
TypeScript
import type { StandardSchemaV1 } from "@standard-schema/spec"
|
|
|
|
export namespace Tool {
|
|
export type Context = {
|
|
sessionID: string
|
|
}
|
|
export interface Info<
|
|
Parameters extends StandardSchemaV1 = StandardSchemaV1,
|
|
Metadata extends Record<string, any> = Record<string, any>,
|
|
> {
|
|
id: string
|
|
description: string
|
|
parameters: Parameters
|
|
execute(
|
|
args: StandardSchemaV1.InferOutput<Parameters>,
|
|
ctx: Context,
|
|
): Promise<{
|
|
metadata: Metadata
|
|
output: string
|
|
}>
|
|
}
|
|
|
|
export function define<
|
|
Parameters extends StandardSchemaV1,
|
|
Result extends Record<string, any>,
|
|
>(input: Info<Parameters, Result>): Info<Parameters, Result> {
|
|
return input
|
|
}
|
|
}
|