fix: add missing api_key field for custom provider in Dockerfile.hermes#81
Merged
Merged
Conversation
The CMD script writes MODEL_API_KEY to .env as OPENAI_API_KEY but does not include it in config.yaml's model section. Hermes with provider: custom reads api_key from model.api_key in config.yaml, not from OPENAI_API_KEY in .env. This causes 401 Authentication Fails when users start a conversation inside the container. Fix: add api_key field to the generated config.yaml model section.
Collaborator
|
感谢快速修复!根因清晰,我们会尽快review后合入 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #77
问题
Hermes Docker 镜像启动后,用户执行
docker exec -it hermes-memory hermes进入对话时报错:根因:
Dockerfile.hermes的 CMD 脚本将MODEL_API_KEY写入了.env文件(OPENAI_API_KEY=xxx),但生成的config.yaml中model段缺少api_key字段。Hermes 对provider: custom从config.yaml的model.api_key读取凭据,不从.env的OPENAI_API_KEY读取,因此认证失败。修复
在
printf生成的config.yaml中增加api_key: "${MODEL_API_KEY}"字段。修改后的 config.yaml 内容:
变更文件
docker/opensource/Dockerfile.hermesprintf增加api_key字段CHANGELOG.md验证
已在运行中的容器内直接修复
config.yaml验证修复有效。用户使用修复后的 Dockerfile 重新构建镜像即可正常使用。