What a plugin reads and the routes serve: the declared bindings and a Project's choices.
API
@Interface("@prismshadow/penguin-server#ToolModelBindings")
export abstract class ToolModelBindings {
abstract list(projectId: string): Promise<ToolModelBindingView[]>;
abstract get(projectId: string, key: string): Promise<ModelRefDto | undefined>;
abstract set(
projectId: string,
key: string,
model: ModelRefDto | null,
): Promise<ToolModelBindingView[]>;
abstract testRequest(model: ToolModelTestSubject): ToolModelTestRequest | undefined;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (4)
list
list(projectId: string): Promise<ToolModelBindingView[]>Every declared binding, in load order, with this Project's model and its candidates.
stringPromise<ToolModelBindingView[]>get
get(projectId: string, key: string): Promise<ModelRefDto | undefined>The model bound to key in this Project, or undefined: none is, or the one bound is no
longer configured. Reads the file's entry whether or not a loaded plugin declares the key.
stringstringPromise<ModelRefDto | undefined>set
set(projectId: string, key: string, model: ModelRefDto | null): Promise<ToolModelBindingView[]>Binds a declared key, or with null unbinds it, and answers the list. An undeclared key is a
404 unknown_binding; a model the Project does not configure a 400; one the binding does
not accept a 400 model_not_accepted.
stringstringModelRefDto | nullPromise<ToolModelBindingView[]>testRequest
testRequest(model: ToolModelTestSubject): ToolModelTestRequest | undefinedThe request the connection test sends this model: the test request of the first binding, in load order, that declares one and accepts the model; undefined when none does (the chat probe). The model need not be configured yet — a draft is tested before it is saved.
ToolModelTestSubjectToolModelTestRequest | undefined