Files
inventory/templates/ai_settings.html

92 lines
4.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI参数设置</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<header class="hero slim">
<div>
<h1>AI参数设置</h1>
<p>在此统一配置 AI 补货、自然语言搜索、入库预处理与标签标准化参数</p>
</div>
<div class="hero-actions">
<a class="btn btn-light" href="{{ url_for('types_page') }}">返回仓库概览</a>
{% include '_account_menu.html' %}
</div>
</header>
<main class="container">
{% if error %}
<p class="alert">{{ error }}</p>
{% endif %}
{% if notice %}
<p class="notice">{{ notice }}</p>
{% endif %}
<section class="panel">
<form class="form-grid" method="post">
<h2 class="full">通用 AI 参数</h2>
<p class="hint full">以下参数会同时用于 AI 入库预处理、自然语言搜索、重复巡检、补货建议、标签与备注标准化。</p>
<label>
API URL *
<input type="text" name="api_url" required value="{{ settings.api_url }}" placeholder="https://api.siliconflow.cn/v1/chat/completions">
</label>
<label>
模型名称 *
<input type="text" name="model" required value="{{ settings.model }}" placeholder="Qwen/Qwen2.5-7B-Instruct">
</label>
<label class="full">
API Key *
<input type="text" name="api_key" required value="{{ settings.api_key }}" placeholder="sk-...">
</label>
<label>
超时(秒)
<input type="number" name="timeout" min="5" value="{{ settings.timeout }}">
</label>
<p class="hint full">若使用较慢模型(如 GLM-5、较大推理模型生成补货建议超时可先将这里调到 60-90 秒再重试。</p>
<label>
低库存阈值
<input type="number" name="restock_threshold" min="0" value="{{ settings.restock_threshold }}">
</label>
<label>
建议条目上限
<input type="number" name="restock_limit" min="1" value="{{ settings.restock_limit }}">
</label>
<h2 class="full">立创商品信息接口参数</h2>
<p class="hint full">固定 Base URL: <code>https://open-api.jlc.com</code></p>
<p class="hint full">固定请求路径: <code>/lcsc/openapi/sku/product/basic</code></p>
<label class="full">
app_id
<input type="text" name="lcsc_app_id" value="{{ settings.lcsc_app_id }}" placeholder="JOP appid">
</label>
<label>
access_key
<input type="text" name="lcsc_access_key" value="{{ settings.lcsc_access_key }}" placeholder="JOP accesskey">
</label>
<label>
secret_key
<input type="text" name="lcsc_secret_key" value="{{ settings.lcsc_secret_key }}" placeholder="JOP secretkey">
</label>
<label>
立创接口超时(秒)
<input type="number" name="lcsc_timeout" min="5" value="{{ settings.lcsc_timeout }}">
</label>
<label class="full">
<input type="checkbox" name="lock_storage_mode" value="1" {% if settings.lock_storage_mode %}checked{% endif %}>
开启锁仓模式(禁止删除位置绑定、禁止替换当前位置料号)
</label>
<p class="hint full">输入 C 编号(如 <code>C23186</code>)时,系统按 <code>productCode</code> 查询;输入纯数字时按 <code>productId</code> 查询。</p>
<div class="actions full">
<button class="btn" type="submit">保存参数</button>
<a class="btn btn-light" href="{{ url_for('types_page') }}">取消</a>
</div>
</form>
</section>
</main>
</body>
</html>