MCPcopy Create free account
hub / github.com/Stevenic/codepilot / addFunction

Method addFunction

src/Codepilot.ts:38–41  ·  view source on GitHub ↗

* Registers a new function to be used in the chat completion. * @remarks * This is used to add new capabilities to Codepilot's chat feature * @param name The name of the function. * @param schema The schema of the function. * @param fn The function to be executed.

(schema: ChatCompletionFunction, fn: (args: TArgs) => Promise<any>)

Source from the content-addressed store, hash-verified

36 * @param fn The function to be executed.
37 */
38 public addFunction<TArgs = Record<string, any>>(schema: ChatCompletionFunction, fn: (args: TArgs) => Promise<any>): this {
39 this._functions.set(schema.name, { schema, fn });
40 return this;
41 }
42
43 /**
44 * Starts the chat session and listens for user input.

Callers 1

addCreateFileFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected