Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

如何配置Midscene.js使用自定义的AI模型服务?

2025-09-10 1.8 K

模型服务配置指南

Midscene.js支持灵活替换底层AI模型,方便企业接入自研或其他第三方模型服务。

Environment variable configuration

// .env文件示例
export OPENAI_API_KEY="sk-your-key"
export MIDSCENE_MODEL_NAME="gpt-4-turbo"
export MIDSCENE_API_BASE="https://api.your-service.com/v1"

支持的主流模型

  • OpenAI系列:gpt-4o/gpt-4-turbo
  • Anthropic Claude系列
  • 本地部署的Llama3等开源模型

自定义适配

  1. 实现统一的ChatCompletion接口
  2. 处理多模态输入(文本+截图)
  3. 确保返回结构化操作指令
  4. 处理token限制和响应延迟

Caveats:
1. 不同模型的指令跟随能力差异较大
2. 视觉模型需支持base64图像输入
3. 建议在测试环境验证模型兼容性
4. 可通过设置temperature参数控制生成稳定性

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish