找到了一些开源项目,但都还比较初期。
- 从方案上来看,有些采用了 jupyter kernel,有些则是另外打造了运行环境;
- 从 prompt 上来看,有些项目重在给 gpt 一个顺畅的设定,另一些则是在 prompt 中限定了gpt可以使用的 python 包的具体版本,期望这样可以让gpt生成的代码减少一些错误。
gpt-code-ui
https://ricklamers.io/posts/gpt-code/
这个项目是目前star最多的
借助Jupyter kernels来实现代码运行,但是限制得比较死,每次回答强制调用代码运行
他的 prompt 长这样:
prompt = f"""First, here is a history of what I asked you to do earlier.
The actual prompt follows after ENDOFHISTORY.
History:
{
message_buffer.get_string