Prompty#

class langchain_prompty.core.Prompty[source]#

基础类:BaseModel

基础提示模型。

通过解析和验证来自关键字参数的输入数据来创建一个新模型。

如果输入数据无法验证以形成有效模型,则引发 [ValidationError][pydantic_core.ValidationError]。

self 被显式地设为仅位置参数,以允许 self 作为字段名称。

param authors: List[str] = []#
param base: str = ''#
param basePrompty: Prompty | None = None#
param content: str = ''#
param description: str = ''#
param file: FilePath = ''#
Constraints:
  • path_type = file

param inputs: Dict[str, PropertySettings] = {}#
param model: ModelSettings [Optional]#
param name: str = ''#
param outputs: Dict[str, PropertySettings] = {}#
param sample: dict = {}#
param tags: List[str] = []#
param template: TemplateSettings [Required]#
param version: str = ''#
static normalize(attribute: Any, parent: Path, env_error: bool = True) Any[source]#
Parameters:
  • 属性 (任意类型)

  • parent (路径)

  • env_error (bool)

Return type:

任何

to_safe_dict() Dict[str, Any][source]#
Return type:

Dict[str, Any]

to_safe_json() str[来源]#
Return type:

字符串