{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "description": "JSON Schema for hprompt frontmatter | hprompt frontmatter的JSON Schema定义", "properties": { "model": { "type": "string", "description": "LLM model name | LLM模型名称" }, "temperature": { "type": "number", "minimum": 0, "maximum": 2, "default": 1, "description": "Sampling temperature | 采样温度" }, "top_p": { "type": "number", "minimum": 0, "maximum": 1, "default": 1, "description": "Nucleus sampling parameter | 核采样参数" }, "max_completion_tokens": { "type": ["integer", "null"], "description": "Maximum number of tokens to generate | 最大生成token数" }, "max_tokens": { "type": ["integer", "null"], "description": "Maximum number of tokens to generate | 最大生成token数" }, "frequency_penalty": { "anyOf": [ { "type": "number", "minimum": -2, "maximum": 2 }, { "type": "null" } ], "default": 0, "description": "Frequency penalty for token repetition | 重复惩罚参数" }, "presence_penalty": { "anyOf": [ { "type": "number", "minimum": -2, "maximum": 2 }, { "type": "null" } ], "default": 0, "description": "Presence penalty for new tokens | 新token惩罚参数" }, "timeout": { "type": "number", "minimum": 0, "description": "Request timeout in seconds | 请求超时时间(秒)" }, "stream": { "type": "boolean", "description": "Enable streaming response | 启用流式响应" }, "response_format": { "type": "object", "properties": { "type": { "type": "string", "enum": ["text", "json_schema", "json_object"], "description": "Response format type | 响应格式类型" }, "json_schema": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the response format | 响应格式名称" }, "description": { "type": "string", "description": "Description of the response format | 响应格式描述" }, "schema": { "type": "object", "description": "The JSON Schema for the expected response | 预期响应的JSON Schema" }, "strict": { "type": "boolean", "default": false, "description": "Whether to enforce strict adherence to the schema | 是否强制遵守schema" } }, "required": ["name"], "description": "JSON Schema for the expected response | 预期响应的JSON Schema" } }, "required": ["type"], "if": { "properties": { "type": { "const": "json_schema" } } }, "then": { "required": ["json_schema"] }, "description": "Response format specification (e.g. JSON mode) | 响应格式规范(如JSON模式)" }, "tool_choice": { "description": "Controls which (if any) tool is called by the model.", "anyOf": [ { "type": "string", "enum": ["none", "auto", "required"], "description": "Tool choice mode" }, { "type": "object", "oneOf": [ { "type": "object", "required": ["type", "function"], "properties": { "type": { "type": "string", "const": "function" }, "function": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "description": "The name of the function to call" } } } } }, { "type": "object", "required": ["type", "custom"], "properties": { "type": { "type": "string", "const": "custom" }, "custom": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "description": "The name of the custom tool to call" } } } } }, { "type": "object", "required": ["type", "allowed_tools"], "properties": { "type": { "type": "string", "const": "allowed_tools" }, "allowed_tools": { "type": "object", "required": ["mode", "tools"], "properties": { "mode": { "type": "string", "enum": ["auto", "required"], "description": "How the model should use the allowed tools" }, "tools": { "type": "array", "description": "A list of tool definitions the model is allowed to call", "items": { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["function", "custom"] }, "function": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] }, "custom": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"] } } } } } } } } ] } ] }, "tools": { "type": "array", "description": "Tool/function definitions for function calling | 工具/函数定义列表", "items": { "oneOf": [ { "type": "object", "required": ["type", "function"], "properties": { "type": { "type": "string", "const": "function", "description": "Tool type | 工具类型" }, "function": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "description": "Function name | 函数名称" }, "description": { "type": "string", "description": "Function description | 函数描述" }, "parameters": { "type": "object", "description": "Function parameters schema | 函数参数 schema" }, "strict": { "type": "boolean", "default": false, "description": "Whether to enforce strict schema adherence" } } } } }, { "type": "object", "required": ["type", "custom"], "properties": { "type": { "type": "string", "const": "custom" }, "custom": { "type": "object", "description": "Custom tool definition" } } } ] } }, "api_key": { "type": "string", "description": "API key for authentication (recommended to store in credential file) | API密钥(建议存放在凭证文件中)" }, "organization": { "type": "string", "description": "Organization ID (for OpenAI) | 组织ID(OpenAI)" }, "api_type": { "type": "string", "enum": ["openai", "azure"], "description": "API provider type | API提供商类型" }, "api_base": { "type": "string", "description": "API base URL (for Azure or custom endpoints) | API基础URL(Azure或自定义端点)" }, "api_version": { "type": "string", "description": "API version (for Azure) | API版本(Azure)" }, "stop": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" }, "maximum": 4 }, { "type": "null" } ], "default": null, "description": "Stop sequence(s) | 停止序列" }, "logit_bias": { "anyOf": [ { "type": "object", "additionalProperties": { "type": "number", "minimum": -100, "maximum": 100 } }, { "type": "null" } ], "default": null, "description": "Modify the likelihood of specified tokens appearing in the completion | 修改指定token出现的可能性" }, "logprobs": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": false, "description": "Whether to return log probabilities of the output tokens | 是否返回输出token的对数概率" }, "top_logprobs": { "type": "integer", "minimum": 0, "maximum": 20, "description": "Number of most likely tokens to return at each position | 每个位置返回的最可能token数量" }, "n": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 1, "description": "Number of completions to generate | 生成的补全数量" }, "meta": { "type": "object", "description": "Runtime configuration options | 运行时配置选项", "properties": { "record_request": { "type": "string", "enum": ["blacklist", "whitelist", "none", "all"], "description": "Record request arguments mode: blacklist (all except specified), whitelist (only specified), none (no recording), all (all arguments) | 记录请求参数模式:blacklist(除了指定的)、whitelist(仅指定的)、none(不记录)、all(全部)" }, "record_blacklist": { "type": "array", "items": { "type": "string" }, "description": "Request arguments to exclude from recording (when using blacklist mode) | 记录时排除的请求参数列表(blacklist模式)" }, "record_whitelist": { "type": "array", "items": { "type": "string" }, "description": "Request arguments to include in recording (when using whitelist mode) | 记录时包含的请求参数列表(whitelist模式)" }, "var_map": { "type": "object", "description": "Variable substitution map | 变量替换映射" }, "var_map_path": { "type": "string", "description": "Path to variable substitution file (text, JSON, or YAML) | 变量替换文件路径(text、JSON或YAML格式)" }, "var_map_file_format": { "type": "string", "enum": ["json", "yaml", "text"], "description": "Variable map file format (auto-detected from extension if not specified) | 变量映射文件格式(未指定时从扩展名自动检测)" }, "output_path": { "type": "string", "description": "Output file path for response (supports strftime format like %Y-%m-%d) | 响应输出文件路径(支持strftime格式如%Y-%m-%d)" }, "output_path_buffering": { "type": "integer", "description": "Buffer size for output file: -1 for system default, 0 for unbuffered, 1 for line buffered, or positive value for buffer size | 输出文件缓冲大小:-1为系统默认、0为无缓冲、1为行缓冲、或正整数" }, "output_evaled_prompt_path": { "type": "string", "description": "Output file path for evaluated prompt (with variables substituted, supports strftime format) | 评估后的prompt输出文件路径(变量已替换,支持strftime格式)" }, "overwrite_if_exists": { "type": "boolean", "description": "If output path exists, overwrite it | 如果输出路径存在,是否覆盖" }, "credential_path": { "type": "string", "description": "Path to credential file (.env, .json, or .yaml) | 凭证文件路径(.env、.json或.yaml格式)" }, "credential_type": { "type": "string", "enum": ["env", "json", "yaml"], "description": "Credential file type: env (environment variables), json (JSON object), yaml (YAML object) | 凭证文件类型:env(环境变量)、json(JSON对象)、yaml(YAML对象)" }, "verbose": { "type": "boolean", "description": "Enable verbose output to stderr | 启用详细输出到stderr" } } } } }