# params | Marsho AI
Kawaii, Intelligent and Easy to Extend

Skip to content

# Module `nonebot_plugin_marshoai.plugin.func_call.params` ​

### var `P` ​

- Description: 参数类型泛型

- Default: `TypeVar('P', bound='Parameter')`

### class `ParamTypes` ​

#### attr `STRING = 'string'` ​

#### attr `INTEGER = 'integer'` ​

#### attr `ARRAY = 'array'` ​

#### attr `OBJECT = 'object'` ​

#### attr `BOOLEAN = 'boolean'` ​

#### attr `NUMBER = 'number'` ​

### class `Parameter(BaseModel)` ​

#### func `data(self) -> dict[str, Any]` ​

Source code or View on GitHub
python

    def data(self) -> dict[str, Any]:
        return {'type': self.type_, 'description': self.description, **{k: v for k, v in self.properties.items() if v is not None}}

#### attr `type_: str = NO_DEFAULT` ​

#### attr `description: str = NO_DEFAULT` ​

#### attr `default: Any = None` ​

#### attr `properties: dict[str, Any] = {}` ​

#### attr `required: bool = False` ​

### class `String(Parameter)` ​

#### attr `type_: str = ParamTypes.STRING` ​

#### attr `properties: dict[str, Any] = Field(default_factory=dict)` ​

#### attr `enum: list[str] | None = None` ​

### class `Integer(Parameter)` ​

#### attr `type_: str = ParamTypes.INTEGER` ​

#### attr `properties: dict[str, Any] = Field(default_factory=lambda: {'minimum': 0, 'maximum': 100})` ​

#### attr `minimum: int | None = None` ​

#### attr `maximum: int | None = None` ​

### class `Array(Parameter)` ​

#### attr `type_: str = ParamTypes.ARRAY` ​

#### attr `properties: dict[str, Any] = Field(default_factory=lambda: {'items': {'type': 'string'}})` ​

#### attr `items: str = Field('string', description='数组元素类型')` ​

### class `FunctionCall(BaseModel)` ​

#### func `hash self => int` ​

Source code or View on GitHub
python

    def __hash__(self) -> int:
        return hash(self.name)

#### func `data(self) -> dict[str, Any]` ​

Description: 生成函数描述信息

Return: dict[str, Any]: 函数描述信息 字典

Source code or View on GitHub
python

    def data(self) -> dict[str, Any]:
        return {'type': 'function', 'function': {'name': self.name, 'description': self.description, 'parameters': {'type': 'object', 'properties': {k: v.data() for k, v in self.arguments.items()}}, 'required': [k for k, v in self.arguments.items() if v.default is None], **self.kwargs}}

#### attr `name: str = NO_DEFAULT` ​

#### attr `description: str = NO_DEFAULT` ​

#### attr `arguments: dict[str, Parameter] = NO_DEFAULT` ​

#### attr `function: FUNCTION_CALL_FUNC = NO_DEFAULT` ​

#### attr `kwargs: dict[str, Any] = {}` ​