MCPcopy Create free account
hub / github.com/microsoft/TypeChat / AgentRouter

Interface AgentRouter

typescript/examples/multiSchema/src/router.ts:6–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import { TaskClassification, TaskClassificationResponse } from "./classificationSchema";
5
6export interface AgentRouter<T extends object> {
7 _taskTypes: TaskClassification[];
8 _agentMap: { [name: string]: Agent<T> };
9 _taskClassifier: TypeChatJsonTranslator<TaskClassificationResponse>
10 _handlerUnknownTask: MessageHandler<T>;
11 registerAgent(name: string, agent: Agent<T>): Promise<void>
12 routeRequest(request: string): Promise<void>
13}
14
15export function createAgentRouter<T extends object>(model: TypeChatLanguageModel, schema: string, typeName: string): AgentRouter<T> {
16 const validator = createTypeScriptJsonValidator<TaskClassificationResponse>(schema, typeName)

Callers 2

main.tsFile · 0.80
main.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…