fix(hindsight): correct client constructor args and add configurable api_url - #4997
Closed
nils010485 wants to merge 1 commit into
Closed
fix(hindsight): correct client constructor args and add configurable api_url#4997nils010485 wants to merge 1 commit into
nils010485 wants to merge 1 commit into
Conversation
…api_url The Hindsight() constructor expects base_url as the first positional argument, but _make_client() passed api_key in that position. This made cloud mode completely non-functional. Also adds configurable api_url (via config, HINDSIGHT_API_URL env var, or setup wizard) so self-hosted Docker instances can be used instead of the default cloud endpoint. Timeout increased from 30s to 120s. Fixes the remaining issue from PR NousResearch#4762 (sequential dispatch was already fixed by PR NousResearch#4803).
Contributor
Author
|
Reviewing with external agents before finalizing |
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.
Summary
Fixes the Hindsight cloud client constructor and adds support for self-hosted instances.
Bug: broken constructor arguments
_make_client()passedapi_keyas the first positional argument toHindsight(), but the constructor signature isHindsight(base_url, api_key=None, timeout=300.0). Cloud mode never worked.Feature: configurable api_url for self-hosted instances
Adds
api_urlconfiguration field so users running Hindsight via self-hosted Docker can point to their local instance instead of the default cloud endpoint.Resolution order:
config.json→HINDSIGHT_API_URLenv var → default (https://api.hindsight.vectorize.io)Changes
plugins/memory/hindsight/__init__.py(9 insertions, 1 deletion):_load_config(): addapiUrlfromHINDSIGHT_API_URLenv varget_config_schema(): addapi_urlfield with env var hint and default_make_client(): resolvebase_urlfrom config → env → default; pass as named arg; timeout 120sContext
Related to PR #4762 (closed by maintainer). The sequential dispatch fix from that PR was already merged separately as PR #4803. This PR covers the remaining fix: the constructor argument order and self-hosted URL support.
Testing