VapiAI / client-sdk-web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seems that `FunctionTool` now includes some mandatory properties that seems vapi internal ones: id, orgId, createdAt, updatedAt

remyma opened this issue · comments

Seems that FunctionTool now includes some mandatory properties that seems vapi internal ones: id, orgId, createdAt, updatedAt

export interface FunctionTool {
  /**
   * This determines if the tool is async.
   *
   * If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.
   *
   * If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.
   *
   * Defaults to synchronous (`false`).
   * @example false
   */
  async?: boolean;
  /**
   * These are the messages that will be spoken to the user as the tool is running.
   *
   * For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.
   */
  messages?: (ToolMessageStart | ToolMessageComplete | ToolMessageFailed | ToolMessageDelayed)[];
  /** The type of tool. "function" for Function tool. */
  type: 'function';
  /** The unique identifier for the tool library. */
  id: string;
  /** The unique identifier for the organization that this tool library belongs to. */
  orgId: string;
  /**
   * The ISO 8601 date-time string of when the tool library was created.
   * @format date-time
   */
  createdAt: string;
  /**
   * The ISO 8601 date-time string of when the tool library was last updated.
   * @format date-time
   */
  updatedAt: string;
  /**
   * This is the function definition of the tool.
   *
   * For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, this is a custom function definition.
   */
  function?: OpenAIFunction;
  /**
   * This is the server that will be hit when this tool is requested by the model.
   *
   * All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.
   *
   * This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.
   */
  server?: Server;
}

I should not have to implement it when dealing with a transiant assistant.

Use CreateFunctionToolDTO