SQL Plugin Model

Smarter API PluginData Sql Connection Manifest Constants

Smarter API Manifest - Plugin.spec

pydantic model smarter.apps.plugin.manifest.models.sql_plugin.spec.SAMSqlPluginSpec[source]

Bases: SAMPluginCommonSpec

Smarter API SqlData Connection Manifest SqlConnection.spec

Show JSON schema
{
   "title": "SAMSqlPluginSpec",
   "description": "Smarter API SqlData Connection Manifest SqlConnection.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": "SqlPlugin.spec.selector[obj]: the name of an existing SqlConnector to use for the SqlPlugin",
         "title": "Connection",
         "type": "string"
      },
      "sqlData": {
         "$ref": "#/$defs/SqlData",
         "description": "SqlPlugin.spec.selector[obj]: the SqlData to use for the SqlPlugin"
      }
   },
   "$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"
      },
      "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"
      },
      "SqlData": {
         "description": "Smarter API - generic API Connection class.",
         "properties": {
            "sqlQuery": {
               "description": "The SQL query that this plugin will execute when invoked by the user prompt.",
               "title": "Sqlquery",
               "type": "string"
            },
            "parameters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Parameter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A JSON dict containing parameter names and data types. Example: {'unit': {'type': 'string', 'enum': ['Celsius', 'Fahrenheit'], 'description': 'The temperature unit to use.'}}",
               "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: {'product_id': 1234}.",
               "title": "Testvalues"
            },
            "limit": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 100,
               "description": "The maximum number of rows to return from the query. Must be a non-negative integer.",
               "title": "Limit"
            }
         },
         "required": [
            "sqlQuery"
         ],
         "title": "SqlData",
         "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"
      }
   },
   "required": [
      "selector",
      "prompt",
      "connection",
      "sqlData"
   ]
}

Config:
  • from_attributes: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

Fields:
Validators:
field connection: str [Required]

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

Validated by:
field sqlData: SqlData [Required]

SqlPlugin.spec.selector[obj]: the SqlData to use for the SqlPlugin

Validated by:
validator validate_limit  »  connection[source]
class_identifier: ClassVar[str] = 'SqlPlugin.spec'
pydantic model smarter.apps.plugin.manifest.models.sql_plugin.spec.SqlData[source]

Bases: SmarterBasePydanticModel

Smarter API - generic API Connection class.

Show JSON schema
{
   "title": "SqlData",
   "description": "Smarter API - generic API Connection class.",
   "type": "object",
   "properties": {
      "sqlQuery": {
         "description": "The SQL query that this plugin will execute when invoked by the user prompt.",
         "title": "Sqlquery",
         "type": "string"
      },
      "parameters": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Parameter"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A JSON dict containing parameter names and data types. Example: {'unit': {'type': 'string', 'enum': ['Celsius', 'Fahrenheit'], 'description': 'The temperature unit to use.'}}",
         "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: {'product_id': 1234}.",
         "title": "Testvalues"
      },
      "limit": {
         "anyOf": [
            {
               "exclusiveMinimum": 0,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": 100,
         "description": "The maximum number of rows to return from the query. Must be a non-negative integer.",
         "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"
      },
      "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"
      }
   },
   "required": [
      "sqlQuery"
   ]
}

Config:
  • from_attributes: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

Fields:
Validators:

field limit: Optional[int] = 100

The maximum number of rows to return from the query. Must be a non-negative integer.

Constraints:
  • gt = 0

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

A JSON dict containing parameter names and data types. Example: {‘unit’: {‘type’: ‘string’, ‘enum’: [‘Celsius’, ‘Fahrenheit’], ‘description’: ‘The temperature unit to use.’}}

Validated by:
field sqlQuery: str [Required]

The SQL query that this plugin will execute when invoked by the user prompt.

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

A JSON dict containing test values for each parameter. Example: {‘product_id’: 1234}.

Validated by:
smarter.apps.plugin.manifest.models.sql_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.sql_plugin.model.SAMSqlPlugin[source]

Bases: SAMPluginCommon

Smarter API Manifest - Sql Connection Model

Show JSON schema
{
   "title": "SAMSqlPlugin",
   "description": "Smarter API Manifest - Sql Connection 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/SAMSqlPluginSpec",
         "description": "SqlPlugin.spec[obj]: Required, the SqlPlugin specification."
      },
      "status": {
         "anyOf": [
            {
               "$ref": "#/$defs/SAMPluginCommonStatus"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Plugin.status[obj]: Optional, Read-only. Stateful status information about the Plugin."
      }
   },
   "$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"
      },
      "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"
      },
      "SAMSqlPluginSpec": {
         "description": "Smarter API SqlData Connection Manifest SqlConnection.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": "SqlPlugin.spec.selector[obj]: the name of an existing SqlConnector to use for the SqlPlugin",
               "title": "Connection",
               "type": "string"
            },
            "sqlData": {
               "$ref": "#/$defs/SqlData",
               "description": "SqlPlugin.spec.selector[obj]: the SqlData to use for the SqlPlugin"
            }
         },
         "required": [
            "selector",
            "prompt",
            "connection",
            "sqlData"
         ],
         "title": "SAMSqlPluginSpec",
         "type": "object"
      },
      "SqlData": {
         "description": "Smarter API - generic API Connection class.",
         "properties": {
            "sqlQuery": {
               "description": "The SQL query that this plugin will execute when invoked by the user prompt.",
               "title": "Sqlquery",
               "type": "string"
            },
            "parameters": {
               "anyOf": [
                  {
                     "items": {
                        "$ref": "#/$defs/Parameter"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A JSON dict containing parameter names and data types. Example: {'unit': {'type': 'string', 'enum': ['Celsius', 'Fahrenheit'], 'description': 'The temperature unit to use.'}}",
               "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: {'product_id': 1234}.",
               "title": "Testvalues"
            },
            "limit": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 100,
               "description": "The maximum number of rows to return from the query. Must be a non-negative integer.",
               "title": "Limit"
            }
         },
         "required": [
            "sqlQuery"
         ],
         "title": "SqlData",
         "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"
      }
   },
   "required": [
      "apiVersion",
      "kind",
      "metadata",
      "spec"
   ]
}

Config:
  • from_attributes: bool = True

  • arbitrary_types_allowed: bool = True

  • frozen: bool = True

Fields:
Validators:

field spec: SAMSqlPluginSpec [Required]

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

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