实现 Issue #232: 通过docker交互式来使用gemini #233
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
改动摘要
成功实现了Gemini的Docker交互式模式功能,通过新的
gemini_interactive.go
文件提供了与Claude交互式模式类似的功能。Docker容器启动时直接使用Gemini作为entrypoint,通过stdin/stdout管道进行交互通信,避免了每次都启动新的docker exec
进程的开销。具体改动
新增文件
internal/code/gemini_interactive.go
:geminiInteractive
结构体和相关方法claude_interactive.go
类似的交互式Docker容器管理功能GeminiInteractiveResponseReader
用于处理响应流读取修改文件
internal/config/config.go
:GeminiConfig
结构体中添加了Interactive bool
字段loadFromEnv()
函数中添加了对GEMINI_INTERACTIVE
环境变量的支持修改文件
internal/code/code.go
:cfg.Gemini.Interactive
为true时调用NewGeminiInteractive()
新增测试文件
internal/code/gemini_interactive_test.go
:修改配置示例
config.example.yaml
:interactive
字段的示例配置所有改动均通过编译测试,功能完整且不破坏原有逻辑。
AI 完整输出
改动摘要
成功实现了Gemini的Docker交互式模式功能,通过新的
gemini_interactive.go
文件提供了与Claude交互式模式类似的功能。Docker容器启动时直接使用Gemini作为entrypoint,通过stdin/stdout管道进行交互通信,避免了每次都启动新的docker exec
进程的开销。具体改动
新增文件
internal/code/gemini_interactive.go
:geminiInteractive
结构体和相关方法claude_interactive.go
类似的交互式Docker容器管理功能GeminiInteractiveResponseReader
用于处理响应流读取修改文件
internal/config/config.go
:GeminiConfig
结构体中添加了Interactive bool
字段loadFromEnv()
函数中添加了对GEMINI_INTERACTIVE
环境变量的支持修改文件
internal/code/code.go
:cfg.Gemini.Interactive
为true时调用NewGeminiInteractive()
新增测试文件
internal/code/gemini_interactive_test.go
:修改配置示例
config.example.yaml
:interactive
字段的示例配置所有改动均通过编译测试,功能完整且不破坏原有逻辑。
原始 Prompt
根据Issue修改代码:
标题:通过docker交互式来使用gemini
描述:我的设想是:
输出格式:
改动摘要
简要说明改动内容
具体改动