使用open-interpreter配合ai操作本地文件

Open-Interpreter

Open-Interpreter是一个开源的AI语言模型,可以让你用自己的话和AI对话。它可以帮助你处理文件、浏览网页、搜索信息、进行计算、进行翻译、进行音乐播放等。

如何使用

  1. 在终端中使用
  2. 在编辑器中通过编写代码的方式使用

在终端中使用

在 windows 系统中,你可以在命令提示符(cmd)中输入以下命令来安装 Open-Interpreter:

1
iex "& {$(irm https://raw.githubusercontent.com/KillianLucas/open-interpreter/main/installers/oi-windows-installer-conda.ps1)}"

安装完了之后,在桌面上会有一个 open-interpreter 的快捷方式,你可以双击打开它。

1
interpreter --api_base "https://api.siliconflow.cn/v1" --api_key "<你的key>" --model <deepseek-ai/DeepSeek-Coder-V2-Instruct>

安装完了之后要使用的话必须要先打开运行环境:

1
2
conda env list
conda activate oi

进入了 oi 环境之后,你可以输入 interpreter 命令来打开 Open-Interpreter。

1
interpreter

配置方法:

1
interpreter --api_base "https://api.siliconflow.cn/v1" --api_key "<你的key>" --model <deepseek-ai/DeepSeek-Coder-V2-Instruct>

在编辑器中通过编写代码的方式使用

你可以在编辑器中通过编写代码的方式使用 Open-Interpreter。

首先,你需要安装 Open-Interpreter。你可以通过 pip 安装:

1
pip install open-interpreter

然后,你需要配置 Open-Interpreter。你可以通过以下代码来配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from interpreter import interpreter

interpreter.os = True
interpreter.llm.supports_vision = False

interpreter.llm.api_base = "https://api.siliconflow.cn/v1"
interpreter.llm.api_key = "<你的key>"
interpreter.llm.model = "deepseek-ai/DeepSeek-R1"#这个就是你使用的大模型的名字


interpreter.llm.supports_functions = True
interpreter.llm.context_window = 110000
interpreter.llm.max_tokens = 4096
interpreter.auto_run = True
interpreter.loop = True

interpreter.computer.emit_images = False
interpreter.computer.import_computer_api = True

interpreter.chat("你是谁?")

但是,这里有一个问题。就是使用硅迹流动的接口的话,总是说 模型的名字不对 。
这里不知道有什么解决方法。


使用open-interpreter配合ai操作本地文件
https://ysc2.github.io/ysc2.github.io/2025/02/15/使用open-interpreter配合ai操作本地文件/
作者
Ysc
发布于
2025年2月15日
许可协议