Fix: Missing app_id on Neptune Analytics client (#3278)
Signed-off-by: Andy Kwok <andy.kwok@improving.com>
This commit is contained in:
@@ -42,6 +42,7 @@ class MemgraphConfig(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class NeptuneConfig(BaseModel):
|
class NeptuneConfig(BaseModel):
|
||||||
|
app_id: Optional[str] = Field("Mem0", description="APP_ID for the connection")
|
||||||
endpoint: Optional[str] = (
|
endpoint: Optional[str] = (
|
||||||
Field(
|
Field(
|
||||||
None,
|
None,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from .base import NeptuneBase
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from langchain_aws import NeptuneAnalyticsGraph
|
from langchain_aws import NeptuneAnalyticsGraph
|
||||||
|
from botocore.config import Config
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError("langchain_aws is not installed. Please install it using 'make install_all'.")
|
raise ImportError("langchain_aws is not installed. Please install it using 'make install_all'.")
|
||||||
|
|
||||||
@@ -16,9 +17,11 @@ class MemoryGraph(NeptuneBase):
|
|||||||
|
|
||||||
self.graph = None
|
self.graph = None
|
||||||
endpoint = self.config.graph_store.config.endpoint
|
endpoint = self.config.graph_store.config.endpoint
|
||||||
|
app_id = self.config.graph_store.config.app_id
|
||||||
if endpoint and endpoint.startswith("neptune-graph://"):
|
if endpoint and endpoint.startswith("neptune-graph://"):
|
||||||
graph_identifier = endpoint.replace("neptune-graph://", "")
|
graph_identifier = endpoint.replace("neptune-graph://", "")
|
||||||
self.graph = NeptuneAnalyticsGraph(graph_identifier)
|
self.graph = NeptuneAnalyticsGraph(graph_identifier = graph_identifier,
|
||||||
|
config = Config(user_agent_appid=app_id))
|
||||||
|
|
||||||
if not self.graph:
|
if not self.graph:
|
||||||
raise ValueError("Unable to create a Neptune client: missing 'endpoint' in config")
|
raise ValueError("Unable to create a Neptune client: missing 'endpoint' in config")
|
||||||
|
|||||||
Reference in New Issue
Block a user