You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ai-net/server/types.ts

41 lines
1.4 KiB
TypeScript

import { Tool } from "ai";
/** An Agent's Skill does not imply any specific tool; tool-use is strictly
* internal to the Agent and considered an implementation detail. From the
* perspective of other Agents, a Skill is simply an assertion that a
* sufficiently-relevant task delegated to this agent will more likely be
* accomplished successfully than with another, less-relevant Agent/Skill.
*
* Note that the granularity of task delegation is to an Agent, not to a
* specific skill. We use this `Skill` interface as a compact, standardized way
* of expressing task relevancy to other Agents; instead of relying solely on
* the natural-language `description`.
* */
export interface Skill {
/** Machine-friendly name. */
id: string;
/** Human-freindly name. */
name: string;
/** The description of the skill. */
description: string;
tags?: string[];
examples?: string[];
}
export interface Agent {
/** Machine-friendly name. */
id: string;
/** Human-freindly name. */
name: string;
modelName: string;
/** The system prompt. Not exposed to other models. Therefore, it's safe to
* include instructions like "DO" and "DO NOT", etc. */
systemMessage: string;
/** Exposed to other Agents, to help tham decide whether to delegate a given
* task to this Agent. */
description: string;
/** See JSDoc on the `Skill` interface. */
skills?: Skill[];
tools?: Record<string, Tool>;
}