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.
Based on the error we were seeing in the Dev Containers extension in VS Code Desktop
redis.exceptions.ConnectionError: Error connecting to localhost:6379. Multiple exceptions: [Errno 111] Connect call failed ('127.0.0.1', 6379), [Errno 99] Cannot assign requested address.
, I found various recommendations about updating the config in the Docker Compose file (example).It looks like this dev container was using https://github.com/jongio/chatgpt-retrieval-plugin/blob/main/examples/docker/redis/docker-compose.yml in
postCreateCommand
. I updated to creating a new, dedicated Docker Compose file in .devcontainer. If you'd prefer to update the example one, I think that's fine too.I was then getting
"TypeError: string indices must be integers"
, so I uncommentedTrue
in the redis_datastore.py method (thanks @jongio for the recommendation). Since that was required for me to get this app to run, and I think it's safe to ignore that check since we know the install is coming from the dev container, I kept it in this PR.As shared with @jongio in chat, http://localhost:8000/sub/openapi.json loaded for me with this updated config, and I no longer see the redis connection error, so I think it's now working in Dev Containers. I haven't tried in Codespaces, so @jongio it's probably worth verifying this doesn't affect anything there.