Merge branch 'main' into Matt23-star/main
This commit is contained in:
commit
dec4148075
4 changed files with 46 additions and 2 deletions
|
|
@ -2,6 +2,13 @@
|
|||
uri = neo4j+s://xxxxxxxx.databases.neo4j.io
|
||||
username = neo4j
|
||||
password = your-password
|
||||
connection_pool_size = 100
|
||||
connection_timeout = 30.0
|
||||
connection_acquisition_timeout = 30.0
|
||||
max_transaction_retry_time = 30.0
|
||||
max_connection_lifetime = 300.0
|
||||
liveness_check_timeout = 30.0
|
||||
keep_alive = true
|
||||
|
||||
[mongodb]
|
||||
uri = mongodb+srv://name:password@your-cluster-address
|
||||
|
|
|
|||
|
|
@ -255,7 +255,10 @@ NEO4J_PASSWORD='your_password'
|
|||
NEO4J_MAX_CONNECTION_POOL_SIZE=100
|
||||
NEO4J_CONNECTION_TIMEOUT=30
|
||||
NEO4J_CONNECTION_ACQUISITION_TIMEOUT=30
|
||||
MAX_TRANSACTION_RETRY_TIME=30
|
||||
NEO4J_MAX_TRANSACTION_RETRY_TIME=30
|
||||
NEO4J_MAX_CONNECTION_LIFETIME=300
|
||||
NEO4J_LIVENESS_CHECK_TIMEOUT=30
|
||||
NEO4J_KEEP_ALIVE=true
|
||||
# NEO4J_WORKSPACE=forced_workspace_name
|
||||
|
||||
### MongoDB Configuration
|
||||
|
|
|
|||
|
|
@ -98,6 +98,22 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
config.get("neo4j", "max_transaction_retry_time", fallback=30.0),
|
||||
),
|
||||
)
|
||||
MAX_CONNECTION_LIFETIME = float(
|
||||
os.environ.get(
|
||||
"NEO4J_MAX_CONNECTION_LIFETIME",
|
||||
config.get("neo4j", "max_connection_lifetime", fallback=300.0),
|
||||
),
|
||||
)
|
||||
LIVENESS_CHECK_TIMEOUT = float(
|
||||
os.environ.get(
|
||||
"NEO4J_LIVENESS_CHECK_TIMEOUT",
|
||||
config.get("neo4j", "liveness_check_timeout", fallback=30.0),
|
||||
),
|
||||
)
|
||||
KEEP_ALIVE = os.environ.get(
|
||||
"NEO4J_KEEP_ALIVE",
|
||||
config.get("neo4j", "keep_alive", fallback="true"),
|
||||
).lower() in ("true", "1", "yes", "on")
|
||||
DATABASE = os.environ.get(
|
||||
"NEO4J_DATABASE", re.sub(r"[^a-zA-Z0-9-]", "-", self.namespace)
|
||||
)
|
||||
|
|
@ -109,6 +125,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
connection_timeout=CONNECTION_TIMEOUT,
|
||||
connection_acquisition_timeout=CONNECTION_ACQUISITION_TIMEOUT,
|
||||
max_transaction_retry_time=MAX_TRANSACTION_RETRY_TIME,
|
||||
max_connection_lifetime=MAX_CONNECTION_LIFETIME,
|
||||
liveness_check_timeout=LIVENESS_CHECK_TIMEOUT,
|
||||
keep_alive=KEEP_ALIVE,
|
||||
)
|
||||
|
||||
# Try to connect to the database and create it if it doesn't exist
|
||||
|
|
@ -801,6 +820,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
neo4jExceptions.TransientError,
|
||||
neo4jExceptions.WriteServiceUnavailable,
|
||||
neo4jExceptions.ClientError,
|
||||
neo4jExceptions.SessionExpired,
|
||||
ConnectionResetError,
|
||||
OSError,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
@ -846,6 +868,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
neo4jExceptions.TransientError,
|
||||
neo4jExceptions.WriteServiceUnavailable,
|
||||
neo4jExceptions.ClientError,
|
||||
neo4jExceptions.SessionExpired,
|
||||
ConnectionResetError,
|
||||
OSError,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
@ -1313,6 +1338,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
neo4jExceptions.TransientError,
|
||||
neo4jExceptions.WriteServiceUnavailable,
|
||||
neo4jExceptions.ClientError,
|
||||
neo4jExceptions.SessionExpired,
|
||||
ConnectionResetError,
|
||||
OSError,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
@ -1349,6 +1377,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
neo4jExceptions.TransientError,
|
||||
neo4jExceptions.WriteServiceUnavailable,
|
||||
neo4jExceptions.ClientError,
|
||||
neo4jExceptions.SessionExpired,
|
||||
ConnectionResetError,
|
||||
OSError,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
@ -1370,6 +1401,9 @@ class Neo4JStorage(BaseGraphStorage):
|
|||
neo4jExceptions.TransientError,
|
||||
neo4jExceptions.WriteServiceUnavailable,
|
||||
neo4jExceptions.ClientError,
|
||||
neo4jExceptions.SessionExpired,
|
||||
ConnectionResetError,
|
||||
OSError,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3105,7 +3105,7 @@ async def naive_query(
|
|||
text_units_str = json.dumps(text_units_context, ensure_ascii=False)
|
||||
if query_param.only_need_context:
|
||||
return f"""
|
||||
---Document Chunks---
|
||||
---Document Chunks(DC)---
|
||||
|
||||
```json
|
||||
{text_units_str}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue