API Plugin Model

Smarter API PluginData Sql Connection Manifest Constants

Smarter API Manifest - Plugin.spec

pydantic model smarter.apps.plugin.manifest.models.api_plugin.spec.ApiData[source]

Bases: SmarterBasePydanticModel

Smarter API - apiData class.

Show JSON schema
{
   "title": "ApiData",
   "description": "Smarter API - apiData class.",
   "type": "object",
   "properties": {
      "endpoint": {
         "description": "The endpoint path for the API. Example: '/v1/weather'.",
         "maxLength": 255,
         "title": "Endpoint",
         "type": "string"
      },
      "method": {
         "default": "GET",
         "description": "The HTTP method to use for the API request. Default is 'GET'.",
         "maxLength": 10,
         "title": "Method",
         "type": "string"
      },
      "urlParams": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/UrlParam"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of URL parameters to be included in the API request. Example: {'city': 'San Francisco'}",
         "title": "Urlparams"
      },
      "headers": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/RequestHeader"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A list of JSON dict containing headers to be sent with the API request. Example: {'Authorization': 'Bearer <token>'}",
         "title": "Headers"
      },
      "body": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "items": {},
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Any valid JSON object containing the body of the API request, if applicable.",
         "title": "Body"
      },
      "parameters": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Parameter"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A JSON dict containing parameter names and data types. Example: {'city': {'type': 'string', 'description': 'City name'}}",
         "title": "Parameters"
      },
      "testValues": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/TestValue"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A JSON dict containing test values for each parameter. Example: {'city': 'San Francisco'}",
         "title": "Testvalues"
      },
      "limit": {
         "anyOf": [
            {
               "exclusiveMinimum": 1,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": 100,
         "description": "The maximum number of records to return from the API. Default is 100.",
         "title": "Limit"
      }
   },
   "$defs": {
      "Parameter": {
         "description": "Parameter class for parameterized Plugins. This structure is\nintended to match that which is used in the OpenAPI\nfunction calling specification.\nIt is used to define the parameters that a plugin can accept,\nand also for creating the function calling prompt api.",
         "properties": {
            "name": {
               "description": "The name of the parameter.",
               "title": "Name",
               "type": "string"
            },
            "type": {
               "$ref": "#/$defs/ParameterType",
               "description": "The data type of the parameter (one of: string, number, integer, boolean, object, array, null)."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A description of the parameter.",
               "title": "Description"
            },
            "required": {
               "default": false,
               "description": "Whether the parameter is required.",
               "title": "Required",
               "type": "boolean"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of allowed values for the parameter. Example: ['Celsius', 'Fahrenheit']",
               "title": "Enum"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The default value of the parameter, if any.",
               "title": "Default"
            }
         },
         "required": [
            "name",
            "type"
         ],
         "title": "Parameter",
         "type": "object"
      },
      "ParameterType": {
         "description": "Enum for parameter types.",
         "enum": [
            "string",
            "number",
            "integer",
            "boolean",
            "object",
            "array",
            "null"
         ],
         "title": "ParameterType",
         "type": "string"
      },
      "RequestHeader": {
         "description": "Model for storing HTTP request headers.",
         "properties": {
            "name": {
               "description": "The name of the HTTP header.",
               "title": "Name",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The value of the HTTP header.",
               "title": "Value"
            }
         },
         "required": [
            "name",
            "value"
         ],
         "title": "RequestHeader",
         "type": "object"
      },
      "TestValue": {
         "description": "TestValue class for SqlPlugin and ApiPlugin test values.",
         "properties": {
            "name": {
               "description": "The name of the parameter being tested.",
               "title": "Name",
               "type": "string"
            },
            "value": {
               "description": "The test value for the parameter.",
               "title": "Value"
            }
         },
         "required": [
            "name",
            "value"
         ],
         "title": "TestValue",
         "type": "object"
      },
      "UrlParam": {
         "description": "Model for storing url param k-v pairs.",
         "properties": {
            "key": {
               "description": "The key (ie 'name') of the url param.",
               "title": "Key",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The value for the key.",
               "title": "Value"
            }
         },
         "required": [
            "key",
            "value"
         ],
         "title": "UrlParam",
         "type": "object"
      }
   },
   "required": [
      "endpoint"
   ]
}

Config:
  • from_attributes: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

Fields:
Validators:
field body: Union[dict[str, Any], list[Any], None] = None

Any valid JSON object containing the body of the API request, if applicable.

Validated by:
field endpoint: str [Required]

The endpoint path for the API. Example: ‘/v1/weather’.

Constraints:
  • max_length = 255

Validated by:
field headers: Optional[List[RequestHeader]] = None

A list of JSON dict containing headers to be sent with the API request. Example: {‘Authorization’: ‘Bearer <token>’}

Validated by:
field limit: Optional[int] = 100

The maximum number of records to return from the API. Default is 100.

Constraints:
  • gt = 1

Validated by:
field method: str = 'GET'

The HTTP method to use for the API request. Default is ‘GET’.

Constraints:
  • max_length = 10

Validated by:
field parameters: Optional[List[Parameter]] = None

A JSON dict containing parameter names and data types. Example: {‘city’: {‘type’: ‘string’, ‘description’: ‘City name’}}

Validated by:
field testValues: Optional[List[TestValue]] = None

A JSON dict containing test values for each parameter. Example: {‘city’: ‘San Francisco’}

Validated by:
field urlParams: Optional[List[UrlParam]] = None

A list of URL parameters to be included in the API request. Example: {‘city’: ‘San Francisco’}

Validated by:
validator validate_endpoint  »  endpoint[source]
validator validate_method  »  method[source]
pydantic model smarter.apps.plugin.manifest.models.api_plugin.spec.SAMApiPluginSpec[source]

Bases: SAMPluginCommonSpec

Smarter API Manifest ApiConnection.spec

Show JSON schema
{
   "title": "SAMApiPluginSpec",
   "description": "Smarter API Manifest ApiConnection.spec",
   "type": "object",
   "properties": {
      "selector": {
         "$ref": "#/$defs/SAMPluginCommonSpecSelector",
         "description": "Plugin.spec.selector[obj]: the selector logic to use for the Plugin"
      },
      "prompt": {
         "$ref": "#/$defs/SAMPluginCommonSpecPrompt",
         "description": "Plugin.spec.prompt[obj]: the LLM prompt engineering to apply to the Plugin"
      },
      "connection": {
         "description": "ApiPlugin.spec.selector[obj]: the name of an existing SqlConnector to use for the ApiPlugin",
         "title": "Connection",
         "type": "string"
      },
      "apiData": {
         "$ref": "#/$defs/ApiData",
         "description": "ApiPlugin.spec.selector[obj]: the ApiData to use for the ApiPlugin"
      }
   },
   "$defs": {
      "ApiData": {
         "description": "Smarter API - apiData class.",
         "properties": {
            "endpoint": {
               "description": "The endpoint path for the API. Example: '/v1/weather'.",
               "maxLength": 255,
               "title": "Endpoint",
               "type": "string"
            },
            "method": {
               "default": "GET",
               "description": "The HTTP method to use for the API request. Default is 'GET'.",
               "maxLength": 10,
               "title": "Method",
               "type": "string"
            },
            "urlParams": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UrlParam"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of URL parameters to be included in the API request. Example: {'city': 'San Francisco'}",
               "title": "Urlparams"
            },
            "headers": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/RequestHeader"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of JSON dict containing headers to be sent with the API request. Example: {'Authorization': 'Bearer <token>'}",
               "title": "Headers"
            },
            "body": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "items": {},
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any valid JSON object containing the body of the API request, if applicable.",
               "title": "Body"
            },
            "parameters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Parameter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A JSON dict containing parameter names and data types. Example: {'city': {'type': 'string', 'description': 'City name'}}",
               "title": "Parameters"
            },
            "testValues": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/TestValue"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A JSON dict containing test values for each parameter. Example: {'city': 'San Francisco'}",
               "title": "Testvalues"
            },
            "limit": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 100,
               "description": "The maximum number of records to return from the API. Default is 100.",
               "title": "Limit"
            }
         },
         "required": [
            "endpoint"
         ],
         "title": "ApiData",
         "type": "object"
      },
      "Parameter": {
         "description": "Parameter class for parameterized Plugins. This structure is\nintended to match that which is used in the OpenAPI\nfunction calling specification.\nIt is used to define the parameters that a plugin can accept,\nand also for creating the function calling prompt api.",
         "properties": {
            "name": {
               "description": "The name of the parameter.",
               "title": "Name",
               "type": "string"
            },
            "type": {
               "$ref": "#/$defs/ParameterType",
               "description": "The data type of the parameter (one of: string, number, integer, boolean, object, array, null)."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A description of the parameter.",
               "title": "Description"
            },
            "required": {
               "default": false,
               "description": "Whether the parameter is required.",
               "title": "Required",
               "type": "boolean"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of allowed values for the parameter. Example: ['Celsius', 'Fahrenheit']",
               "title": "Enum"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The default value of the parameter, if any.",
               "title": "Default"
            }
         },
         "required": [
            "name",
            "type"
         ],
         "title": "Parameter",
         "type": "object"
      },
      "ParameterType": {
         "description": "Enum for parameter types.",
         "enum": [
            "string",
            "number",
            "integer",
            "boolean",
            "object",
            "array",
            "null"
         ],
         "title": "ParameterType",
         "type": "string"
      },
      "RequestHeader": {
         "description": "Model for storing HTTP request headers.",
         "properties": {
            "name": {
               "description": "The name of the HTTP header.",
               "title": "Name",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The value of the HTTP header.",
               "title": "Value"
            }
         },
         "required": [
            "name",
            "value"
         ],
         "title": "RequestHeader",
         "type": "object"
      },
      "SAMPluginCommonSpecPrompt": {
         "description": "Smarter API Plugin Manifest - Spec - Prompt class.",
         "properties": {
            "provider": {
               "default": "openai",
               "description": "Plugin.spec.prompt.provider[str]. Optional. The provider of the LLM. Defaults to openai. The provider is the vendor name for the LLM service that will be used to generate the prompt response.",
               "title": "Provider",
               "type": "string"
            },
            "systemRole": {
               "description": "Plugin.spec.prompt.systemRole[str]. Required. The system role that the Plugin will use for the LLM text completion prompt. Be verbose and specific. Ensure that systemRole accurately conveys to the LLM how you want it to use the Plugin data that is returned.",
               "title": "Systemrole",
               "type": "string"
            },
            "model": {
               "default": "gpt-4o-mini",
               "description": "Plugin.spec.prompt.model[str] Optional. The model of the Plugin. Defaults to gpt-4o-mini. Must be one of: ['babbage-002', 'chatgpt-4o-latest', 'codex-mini-latest', 'computer-use-preview', 'computer-use-preview-2025-03-11', 'davinci-002', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-instruct', 'gpt-3.5-turbo-instruct-0914', 'gpt-4', 'gpt-4-0125-preview', 'gpt-4-0613', 'gpt-4-1106-preview', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-turbo-preview', 'gpt-4.1', 'gpt-4.1-2025-04-14', 'gpt-4.1-mini', 'gpt-4.1-mini-2025-04-14', 'gpt-4.1-nano', 'gpt-4.1-nano-2025-04-14', 'gpt-4o', 'gpt-4o-2024-05-13', 'gpt-4o-2024-08-06', 'gpt-4o-2024-11-20', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-audio-preview-2025-06-03', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'gpt-4o-mini-realtime-preview', 'gpt-4o-mini-realtime-preview-2024-12-17', 'gpt-4o-mini-search-preview', 'gpt-4o-mini-search-preview-2025-03-11', 'gpt-4o-mini-transcribe', 'gpt-4o-mini-tts', 'gpt-4o-realtime-preview', 'gpt-4o-realtime-preview-2024-10-01', 'gpt-4o-realtime-preview-2024-12-17', 'gpt-4o-realtime-preview-2025-06-03', 'gpt-4o-search-preview', 'gpt-4o-search-preview-2025-03-11', 'gpt-4o-transcribe', 'gpt-5', 'gpt-5-2025-08-07', 'gpt-5-chat-latest', 'gpt-5-mini', 'gpt-5-mini-2025-08-07', 'gpt-5-nano', 'gpt-5-nano-2025-08-07', 'gpt-audio', 'gpt-audio-2025-08-28', 'gpt-image-1', 'gpt-realtime', 'gpt-realtime-2025-08-28', 'o1', 'o1-2024-12-17', 'o1-mini', 'o1-mini-2024-09-12', 'o1-pro', 'o1-pro-2025-03-19', 'o3', 'o3-2025-04-16', 'o3-mini', 'o3-mini-2025-01-31', 'o4-mini', 'o4-mini-2025-04-16', 'o4-mini-deep-research', 'o4-mini-deep-research-2025-06-26', 'omni-moderation-2024-09-26', 'omni-moderation-latest', 'tts-1', 'tts-1-1106', 'tts-1-hd', 'tts-1-hd-1106']",
               "title": "Model",
               "type": "string"
            },
            "temperature": {
               "default": 0.5,
               "description": "Plugin.spec.prompt.temperature[float] Optional. The temperature of the Plugin. Defaults to 0.5. Should be between 0 and 1.0. The higher the temperature, the more creative the response. The lower the temperature, the more predictable the response.",
               "maximum": 1.0,
               "minimum": 0,
               "title": "Temperature",
               "type": "number"
            },
            "maxTokens": {
               "default": 2048,
               "description": "Plugin.spec.prompt.maxTokens[int]. Optional. The maxTokens of the Plugin. Defaults to 2048. The maximum number of tokens the LLM should generate in the prompt response. ",
               "exclusiveMinimum": 0,
               "title": "Maxtokens",
               "type": "integer"
            }
         },
         "required": [
            "systemRole"
         ],
         "title": "SAMPluginCommonSpecPrompt",
         "type": "object"
      },
      "SAMPluginCommonSpecSelector": {
         "description": "Smarter API Plugin Manifest - Spec - Selector class.",
         "properties": {
            "directive": {
               "description": "Plugin.spec.selector.directive[str]: Required. the kind of selector directive to use for the Plugin. Must be one of: ['search_terms', 'always', 'llm']",
               "title": "Directive",
               "type": "string"
            },
            "searchTerms": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Plugin.spec.selector.searchTerms[list]. Optional. The keyword search terms to use when the Plugin directive is 'search_terms'. Keywords are most effective when constrained to 1 or 2 words each and lists are limited to a few dozen items.",
               "title": "Searchterms"
            }
         },
         "required": [
            "directive"
         ],
         "title": "SAMPluginCommonSpecSelector",
         "type": "object"
      },
      "TestValue": {
         "description": "TestValue class for SqlPlugin and ApiPlugin test values.",
         "properties": {
            "name": {
               "description": "The name of the parameter being tested.",
               "title": "Name",
               "type": "string"
            },
            "value": {
               "description": "The test value for the parameter.",
               "title": "Value"
            }
         },
         "required": [
            "name",
            "value"
         ],
         "title": "TestValue",
         "type": "object"
      },
      "UrlParam": {
         "description": "Model for storing url param k-v pairs.",
         "properties": {
            "key": {
               "description": "The key (ie 'name') of the url param.",
               "title": "Key",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The value for the key.",
               "title": "Value"
            }
         },
         "required": [
            "key",
            "value"
         ],
         "title": "UrlParam",
         "type": "object"
      }
   },
   "required": [
      "selector",
      "prompt",
      "connection",
      "apiData"
   ]
}

Config:
  • from_attributes: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

Fields:
Validators:
field apiData: ApiData [Required]

ApiPlugin.spec.selector[obj]: the ApiData to use for the ApiPlugin

Validated by:
field connection: str [Required]

ApiPlugin.spec.selector[obj]: the name of an existing SqlConnector to use for the ApiPlugin

Validated by:
validator validate_connection  »  connection[source]
class_identifier: ClassVar[str] = 'ApiPlugin.spec'
smarter.apps.plugin.manifest.models.api_plugin.spec.should_log(level)[source]

Check if logging should be done based on the waffle switch.

Smarter API Plugin Manifest

pydantic model smarter.apps.plugin.manifest.models.api_plugin.model.SAMApiPlugin[source]

Bases: SAMPluginCommon

Smarter API Manifest - ApiPlugin Model

Show JSON schema
{
   "title": "SAMApiPlugin",
   "description": "Smarter API Manifest - ApiPlugin Model",
   "type": "object",
   "properties": {
      "apiVersion": {
         "description": "apiVersion[String]: Required. The API version of the AbstractSAMBase.",
         "title": "Apiversion",
         "type": "string"
      },
      "kind": {
         "description": "kind[String]: Required. The kind of resource described by the manifest.",
         "title": "Kind",
         "type": "string"
      },
      "metadata": {
         "$ref": "#/$defs/SAMPluginCommonMetadata",
         "description": "Plugin.metadata[obj]: Required, the Plugin metadata."
      },
      "spec": {
         "$ref": "#/$defs/SAMApiPluginSpec",
         "description": "ApiPlugin.spec[obj]: Required, the ApiPlugin specification."
      },
      "status": {
         "anyOf": [
            {
               "$ref": "#/$defs/SAMPluginCommonStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Plugin.status[obj]: Optional, Read-only. Stateful status information about the Plugin."
      }
   },
   "$defs": {
      "ApiData": {
         "description": "Smarter API - apiData class.",
         "properties": {
            "endpoint": {
               "description": "The endpoint path for the API. Example: '/v1/weather'.",
               "maxLength": 255,
               "title": "Endpoint",
               "type": "string"
            },
            "method": {
               "default": "GET",
               "description": "The HTTP method to use for the API request. Default is 'GET'.",
               "maxLength": 10,
               "title": "Method",
               "type": "string"
            },
            "urlParams": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/UrlParam"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of URL parameters to be included in the API request. Example: {'city': 'San Francisco'}",
               "title": "Urlparams"
            },
            "headers": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/RequestHeader"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of JSON dict containing headers to be sent with the API request. Example: {'Authorization': 'Bearer <token>'}",
               "title": "Headers"
            },
            "body": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "items": {},
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Any valid JSON object containing the body of the API request, if applicable.",
               "title": "Body"
            },
            "parameters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Parameter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A JSON dict containing parameter names and data types. Example: {'city': {'type': 'string', 'description': 'City name'}}",
               "title": "Parameters"
            },
            "testValues": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/TestValue"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A JSON dict containing test values for each parameter. Example: {'city': 'San Francisco'}",
               "title": "Testvalues"
            },
            "limit": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 100,
               "description": "The maximum number of records to return from the API. Default is 100.",
               "title": "Limit"
            }
         },
         "required": [
            "endpoint"
         ],
         "title": "ApiData",
         "type": "object"
      },
      "Parameter": {
         "description": "Parameter class for parameterized Plugins. This structure is\nintended to match that which is used in the OpenAPI\nfunction calling specification.\nIt is used to define the parameters that a plugin can accept,\nand also for creating the function calling prompt api.",
         "properties": {
            "name": {
               "description": "The name of the parameter.",
               "title": "Name",
               "type": "string"
            },
            "type": {
               "$ref": "#/$defs/ParameterType",
               "description": "The data type of the parameter (one of: string, number, integer, boolean, object, array, null)."
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A description of the parameter.",
               "title": "Description"
            },
            "required": {
               "default": false,
               "description": "Whether the parameter is required.",
               "title": "Required",
               "type": "boolean"
            },
            "enum": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A list of allowed values for the parameter. Example: ['Celsius', 'Fahrenheit']",
               "title": "Enum"
            },
            "default": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The default value of the parameter, if any.",
               "title": "Default"
            }
         },
         "required": [
            "name",
            "type"
         ],
         "title": "Parameter",
         "type": "object"
      },
      "ParameterType": {
         "description": "Enum for parameter types.",
         "enum": [
            "string",
            "number",
            "integer",
            "boolean",
            "object",
            "array",
            "null"
         ],
         "title": "ParameterType",
         "type": "string"
      },
      "RequestHeader": {
         "description": "Model for storing HTTP request headers.",
         "properties": {
            "name": {
               "description": "The name of the HTTP header.",
               "title": "Name",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The value of the HTTP header.",
               "title": "Value"
            }
         },
         "required": [
            "name",
            "value"
         ],
         "title": "RequestHeader",
         "type": "object"
      },
      "SAMApiPluginSpec": {
         "description": "Smarter API Manifest ApiConnection.spec",
         "properties": {
            "selector": {
               "$ref": "#/$defs/SAMPluginCommonSpecSelector",
               "description": "Plugin.spec.selector[obj]: the selector logic to use for the Plugin"
            },
            "prompt": {
               "$ref": "#/$defs/SAMPluginCommonSpecPrompt",
               "description": "Plugin.spec.prompt[obj]: the LLM prompt engineering to apply to the Plugin"
            },
            "connection": {
               "description": "ApiPlugin.spec.selector[obj]: the name of an existing SqlConnector to use for the ApiPlugin",
               "title": "Connection",
               "type": "string"
            },
            "apiData": {
               "$ref": "#/$defs/ApiData",
               "description": "ApiPlugin.spec.selector[obj]: the ApiData to use for the ApiPlugin"
            }
         },
         "required": [
            "selector",
            "prompt",
            "connection",
            "apiData"
         ],
         "title": "SAMApiPluginSpec",
         "type": "object"
      },
      "SAMPluginCommonMetadata": {
         "description": "Smarter API Plugin Manifest - common Metadata class.",
         "properties": {
            "name": {
               "description": "The camelCase name of the manifest resource",
               "title": "Name",
               "type": "string"
            },
            "description": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "The description for this resource. Be brief. Keep it under 255 characters.",
               "title": "Description"
            },
            "version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "The semantic version of the manifest. Example: 0.1.0",
               "title": "Version"
            },
            "tags": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "The tags of the manifest. Used for generic resource categorization and search. Example: ['tag1', 'tag2']",
               "title": "Tags"
            },
            "annotations": {
               "anyOf": [
                  {
                     "items": {
                        "additionalProperties": {
                           "anyOf": [
                              {
                                 "type": "string"
                              },
                              {
                                 "type": "integer"
                              },
                              {
                                 "type": "number"
                              },
                              {
                                 "type": "boolean"
                              },
                              {
                                 "format": "date",
                                 "type": "string"
                              },
                              {
                                 "format": "date-time",
                                 "type": "string"
                              },
                              {
                                 "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                 "type": "string"
                              },
                              {
                                 "format": "uuid",
                                 "type": "string"
                              },
                              {
                                 "format": "binary",
                                 "type": "string"
                              },
                              {
                                 "items": {},
                                 "type": "array"
                              },
                              {
                                 "additionalProperties": true,
                                 "type": "object"
                              }
                           ]
                        },
                        "type": "object"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "The manifest annotations. Used for storing arbitrary metadata as\n            key-value pairs. Example: [{'smarter.sh/test-manifest/project-name': 'Scooby dooby do'}]. The\n            key should be a valid url-friendly string. The value accepts\n            multi-line string values (YAML block scalars) and various scalar types including\n            str, int, float, bool, datetime.date, datetime.datetime, decimal.Decimal, uuid.UUID, bytes, list, dict.\n            ",
               "title": "Annotations"
            },
            "pluginClass": {
               "description": "The class of the plugin. one of: ['static', 'api', 'sql']",
               "title": "Pluginclass",
               "type": "string"
            }
         },
         "required": [
            "name",
            "description",
            "version",
            "pluginClass"
         ],
         "title": "SAMPluginCommonMetadata",
         "type": "object"
      },
      "SAMPluginCommonSpecPrompt": {
         "description": "Smarter API Plugin Manifest - Spec - Prompt class.",
         "properties": {
            "provider": {
               "default": "openai",
               "description": "Plugin.spec.prompt.provider[str]. Optional. The provider of the LLM. Defaults to openai. The provider is the vendor name for the LLM service that will be used to generate the prompt response.",
               "title": "Provider",
               "type": "string"
            },
            "systemRole": {
               "description": "Plugin.spec.prompt.systemRole[str]. Required. The system role that the Plugin will use for the LLM text completion prompt. Be verbose and specific. Ensure that systemRole accurately conveys to the LLM how you want it to use the Plugin data that is returned.",
               "title": "Systemrole",
               "type": "string"
            },
            "model": {
               "default": "gpt-4o-mini",
               "description": "Plugin.spec.prompt.model[str] Optional. The model of the Plugin. Defaults to gpt-4o-mini. Must be one of: ['babbage-002', 'chatgpt-4o-latest', 'codex-mini-latest', 'computer-use-preview', 'computer-use-preview-2025-03-11', 'davinci-002', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-instruct', 'gpt-3.5-turbo-instruct-0914', 'gpt-4', 'gpt-4-0125-preview', 'gpt-4-0613', 'gpt-4-1106-preview', 'gpt-4-turbo', 'gpt-4-turbo-2024-04-09', 'gpt-4-turbo-preview', 'gpt-4.1', 'gpt-4.1-2025-04-14', 'gpt-4.1-mini', 'gpt-4.1-mini-2025-04-14', 'gpt-4.1-nano', 'gpt-4.1-nano-2025-04-14', 'gpt-4o', 'gpt-4o-2024-05-13', 'gpt-4o-2024-08-06', 'gpt-4o-2024-11-20', 'gpt-4o-audio-preview', 'gpt-4o-audio-preview-2024-10-01', 'gpt-4o-audio-preview-2024-12-17', 'gpt-4o-audio-preview-2025-06-03', 'gpt-4o-mini', 'gpt-4o-mini-2024-07-18', 'gpt-4o-mini-audio-preview', 'gpt-4o-mini-audio-preview-2024-12-17', 'gpt-4o-mini-realtime-preview', 'gpt-4o-mini-realtime-preview-2024-12-17', 'gpt-4o-mini-search-preview', 'gpt-4o-mini-search-preview-2025-03-11', 'gpt-4o-mini-transcribe', 'gpt-4o-mini-tts', 'gpt-4o-realtime-preview', 'gpt-4o-realtime-preview-2024-10-01', 'gpt-4o-realtime-preview-2024-12-17', 'gpt-4o-realtime-preview-2025-06-03', 'gpt-4o-search-preview', 'gpt-4o-search-preview-2025-03-11', 'gpt-4o-transcribe', 'gpt-5', 'gpt-5-2025-08-07', 'gpt-5-chat-latest', 'gpt-5-mini', 'gpt-5-mini-2025-08-07', 'gpt-5-nano', 'gpt-5-nano-2025-08-07', 'gpt-audio', 'gpt-audio-2025-08-28', 'gpt-image-1', 'gpt-realtime', 'gpt-realtime-2025-08-28', 'o1', 'o1-2024-12-17', 'o1-mini', 'o1-mini-2024-09-12', 'o1-pro', 'o1-pro-2025-03-19', 'o3', 'o3-2025-04-16', 'o3-mini', 'o3-mini-2025-01-31', 'o4-mini', 'o4-mini-2025-04-16', 'o4-mini-deep-research', 'o4-mini-deep-research-2025-06-26', 'omni-moderation-2024-09-26', 'omni-moderation-latest', 'tts-1', 'tts-1-1106', 'tts-1-hd', 'tts-1-hd-1106']",
               "title": "Model",
               "type": "string"
            },
            "temperature": {
               "default": 0.5,
               "description": "Plugin.spec.prompt.temperature[float] Optional. The temperature of the Plugin. Defaults to 0.5. Should be between 0 and 1.0. The higher the temperature, the more creative the response. The lower the temperature, the more predictable the response.",
               "maximum": 1.0,
               "minimum": 0,
               "title": "Temperature",
               "type": "number"
            },
            "maxTokens": {
               "default": 2048,
               "description": "Plugin.spec.prompt.maxTokens[int]. Optional. The maxTokens of the Plugin. Defaults to 2048. The maximum number of tokens the LLM should generate in the prompt response. ",
               "exclusiveMinimum": 0,
               "title": "Maxtokens",
               "type": "integer"
            }
         },
         "required": [
            "systemRole"
         ],
         "title": "SAMPluginCommonSpecPrompt",
         "type": "object"
      },
      "SAMPluginCommonSpecSelector": {
         "description": "Smarter API Plugin Manifest - Spec - Selector class.",
         "properties": {
            "directive": {
               "description": "Plugin.spec.selector.directive[str]: Required. the kind of selector directive to use for the Plugin. Must be one of: ['search_terms', 'always', 'llm']",
               "title": "Directive",
               "type": "string"
            },
            "searchTerms": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Plugin.spec.selector.searchTerms[list]. Optional. The keyword search terms to use when the Plugin directive is 'search_terms'. Keywords are most effective when constrained to 1 or 2 words each and lists are limited to a few dozen items.",
               "title": "Searchterms"
            }
         },
         "required": [
            "directive"
         ],
         "title": "SAMPluginCommonSpecSelector",
         "type": "object"
      },
      "SAMPluginCommonStatus": {
         "description": "Smarter API Plugin Manifest - Status class.",
         "properties": {
            "recordLocator": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "recordLocator[String]: An optional identifier used to locate the resource record associated with this manifest. Read only.",
               "title": "Recordlocator"
            },
            "created": {
               "description": "The date in which this resource was created. Read only.",
               "format": "date-time",
               "title": "Created",
               "type": "string"
            },
            "modified": {
               "description": "The date in which this resource was most recently changed. Read only.",
               "format": "date-time",
               "title": "Modified",
               "type": "string"
            },
            "accountNumber": {
               "description": "Plugin.status.account_number: The account owner of this Plugin. Read only.",
               "title": "Accountnumber",
               "type": "string"
            },
            "username": {
               "description": "Plugin.status.account_number: The Smarter user who created this Plugin. Read only.",
               "title": "Username",
               "type": "string"
            }
         },
         "required": [
            "created",
            "modified",
            "accountNumber",
            "username"
         ],
         "title": "SAMPluginCommonStatus",
         "type": "object"
      },
      "TestValue": {
         "description": "TestValue class for SqlPlugin and ApiPlugin test values.",
         "properties": {
            "name": {
               "description": "The name of the parameter being tested.",
               "title": "Name",
               "type": "string"
            },
            "value": {
               "description": "The test value for the parameter.",
               "title": "Value"
            }
         },
         "required": [
            "name",
            "value"
         ],
         "title": "TestValue",
         "type": "object"
      },
      "UrlParam": {
         "description": "Model for storing url param k-v pairs.",
         "properties": {
            "key": {
               "description": "The key (ie 'name') of the url param.",
               "title": "Key",
               "type": "string"
            },
            "value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "type": "number"
                  },
                  {
                     "type": "boolean"
                  }
               ],
               "description": "The value for the key.",
               "title": "Value"
            }
         },
         "required": [
            "key",
            "value"
         ],
         "title": "UrlParam",
         "type": "object"
      }
   },
   "required": [
      "apiVersion",
      "kind",
      "metadata",
      "spec"
   ]
}

Config:
  • from_attributes: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

Fields:
Validators:

field spec: SAMApiPluginSpec [Required]

ApiPlugin.spec[obj]: Required, the ApiPlugin specification.

Validated by:
class_identifier: ClassVar[str] = 'ApiPlugin'