AI模型
Mkdirs 在提交界面使用 AI 模型来分析网站的内容,并将分析结果自动填充到提交表单中,从而大幅度提高导航站提交和数据录入流程的效率。
Mkdirs 使用 Vercel AI SDK 作为 AI 模型的封装,并默认支持 OpenAI ChatGPT、Google Gemini 和 DeepSeek 3个模型,可以根据导航站的需求选择使用。
配置
-
确定要使用的 AI 模型
您可以选择使用
google
、deepseek
或openai
作为 AI 模型,并在.env
文件中设置DEFAULT_AI_PROVIDER
变量。.env # [only required if you are using AI models to auto fill the submission form]# default ai provider: ``, `google`, `deepseek`, `openai`# -----------------------------------------------------------------------------DEFAULT_AI_PROVIDER= -
获取对应 AI 模型的 API Key
2.1 获取 Google Gemini API Key
获取 API Key 的链接:Google Gemini API Key
.env # [only required if you are using Google Gemini]# NOTE: if you set `DEFAULT_AI_PROVIDER=google`, you should set this API_KEY# -----------------------------------------------------------------------------GOOGLE_GENERATIVE_AI_API_KEY=2.2 获取 DeepSeek API Key
获取 API Key 的链接:DeepSeek API Key
.env # [only required if you are using DeepSeek]# NOTE: if you set `DEFAULT_AI_PROVIDER=deepseek`, you should set this API_KEY# -----------------------------------------------------------------------------DEEPSEEK_API_KEY=2.3 获取 OpenAI ChatGPT API Key
获取 API Key 的链接:OpenAI ChatGPT API Key
.env # [only required if you are using OpenAI]# NOTE: if you set `DEFAULT_AI_PROVIDER=openai`, you should set this API_KEY# -----------------------------------------------------------------------------OPENAI_API_KEY= -
设置启用 AI 自动填表的功能
如果需要启用 AI 模型实现自动填表的功能,请将
SUPPORT_AI_SUBMIT
设置为true
。src/lib/constants.ts # support AI submit, default is false# NOTE: if you set true, you should make sure the AI provider# and the API_KEY is set in the env variables.# if something is wrong in AI submit, you can set false to disable it.export const SUPPORT_AI_SUBMIT = true;
配置完成之后,如果开启 AI 自动填表功能,在提交表单时,就会出现 “AI 自动填充” 按钮,点击该按钮,AI 模型会自动解析网页内容并自动填充表单。
视频教程
这个视频演示了如何使用 AI 模型自动填充提交表单的功能流程。