Skip to content

Commit 9ec3cb2

Browse files
committed
Refactor client references in code and documentation
This commit updates the `robosystems_client` to replace references from `extensions` to `clients`, reflecting a shift in the architecture. Key changes include: - Updated `pyproject.toml` to exclude test directories more broadly. - Refactored the `__init__.py` file to use the new `clients` instance for monitoring and executing queries. - Revised the `README.md` to reflect the new import paths for client classes, ensuring accurate documentation for users. These changes enhance clarity and maintainability of the codebase.
1 parent dfe191d commit 9ec3cb2

3 files changed

Lines changed: 34 additions & 34 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ include = [
7575

7676
[tool.basedpyright]
7777
include = ["robosystems_client/clients"]
78-
exclude = ["robosystems_client/clients/tests"]
78+
exclude = ["tests"]
7979
extraPaths = ["."]
8080
pythonVersion = "3.13"
8181
venvPath = "."

‎robosystems_client/clients/README.md‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pip install httpx pandas # For SSE and DataFrame support
3232
### Basic Usage
3333

3434
```python
35-
from robosystems_client.extensions import create_production_clients
35+
from robosystems_client.clients import create_production_clients
3636

3737
# Initialize with API key
3838
extensions = create_production_clients("your-api-key-here")
@@ -66,7 +66,7 @@ for transaction in extensions.stream_query("your_graph_id", query, chunk_size=10
6666

6767
```python
6868
import asyncio
69-
from robosystems_client.extensions import AsyncRoboSystemsClients
69+
from robosystems_client.clients import AsyncRoboSystemsClients
7070

7171
async def main():
7272
extensions = AsyncRoboSystemsClients(config)
@@ -89,7 +89,7 @@ asyncio.run(main())
8989
### API Key Authentication (Recommended)
9090

9191
```python
92-
from robosystems_client.extensions import AuthenticatedClients
92+
from robosystems_client.clients import AuthenticatedClients
9393

9494
extensions = AuthenticatedClients(
9595
api_key="your-api-key-here",
@@ -100,7 +100,7 @@ extensions = AuthenticatedClients(
100100
### Cookie Authentication
101101

102102
```python
103-
from robosystems_client.extensions import CookieAuthClients
103+
from robosystems_client.clients import CookieAuthClients
104104

105105
extensions = CookieAuthClients(
106106
cookies={"auth-token": "your-cookie-token"},
@@ -111,7 +111,7 @@ extensions = CookieAuthClients(
111111
### JWT Token Authentication
112112

113113
```python
114-
from robosystems_client.extensions import TokenClients
114+
from robosystems_client.clients import TokenClients
115115

116116
extensions = TokenClients(
117117
token="your-jwt-token",
@@ -122,7 +122,7 @@ extensions = TokenClients(
122122
### Environment-Specific Configurations
123123

124124
```python
125-
from robosystems_client.extensions import create_clients
125+
from robosystems_client.clients import create_clients
126126

127127
# Production
128128
prod_ext = create_clients(
@@ -146,7 +146,7 @@ dev_ext = create_clients(
146146
Build complex Cypher queries programmatically:
147147

148148
```python
149-
from robosystems_client.extensions import QueryBuilder
149+
from robosystems_client.clients import QueryBuilder
150150

151151
builder = QueryBuilder()
152152
query, params = (builder
@@ -169,7 +169,7 @@ print("Parameters:", params)
169169
### Query Validation & Cost Estimation
170170

171171
```python
172-
from robosystems_client.extensions import validate_cypher_query, estimate_query_cost
172+
from robosystems_client.clients import validate_cypher_query, estimate_query_cost
173173

174174
# Validate syntax
175175
validation = validate_cypher_query(query)
@@ -190,7 +190,7 @@ for rec in cost['recommendations']:
190190
Convert results to different formats:
191191

192192
```python
193-
from robosystems_client.extensions import ResultProcessor
193+
from robosystems_client.clients import ResultProcessor
194194

195195
# Convert to JSON
196196
json_output = ResultProcessor.to_json(result, pretty=True)
@@ -211,7 +211,7 @@ except ImportError:
211211
Cache expensive queries automatically:
212212

213213
```python
214-
from robosystems_client.extensions import CacheManager
214+
from robosystems_client.clients import CacheManager
215215

216216
cache = CacheManager(max_size=100, ttl_seconds=300) # 5 minute TTL
217217

@@ -232,7 +232,7 @@ print(cache.stats())
232232
Monitor long-running operations:
233233

234234
```python
235-
from robosystems_client.extensions import ProgressTracker
235+
from robosystems_client.clients import ProgressTracker
236236

237237
def progress_handler(progress):
238238
print(f"Step {progress.current_step}/{progress.total_steps}: {progress.message}")
@@ -249,7 +249,7 @@ print(f"Operation completed: {result.status}")
249249
Direct SSE connection for real-time events:
250250

251251
```python
252-
from robosystems_client.extensions import SSEClient, SSEConfig, EventType
252+
from robosystems_client.clients import SSEClient, SSEConfig, EventType
253253

254254
config = SSEConfig(base_url="https://api.robosystems.ai")
255255
client = SSEClient(config)
@@ -276,7 +276,7 @@ client.close()
276276
### Financial Data Analysis
277277

278278
```python
279-
from robosystems_client.extensions import create_production_clients, QueryBuilder
279+
from robosystems_client.clients import create_production_clients, QueryBuilder
280280

281281
extensions = create_production_clients(api_key)
282282

@@ -303,7 +303,7 @@ for company in result.data:
303303
### Batch Processing with Streaming
304304

305305
```python
306-
from robosystems_client.extensions import DataBatcher, format_duration
306+
from robosystems_client.clients import DataBatcher, format_duration
307307
import time
308308

309309
# Process large transaction dataset in batches
@@ -338,7 +338,7 @@ print(f"Processed {total_processed:,} transactions total")
338338
### Error Handling
339339

340340
```python
341-
from robosystems_client.extensions import QueuedQueryError
341+
from robosystems_client.clients import QueuedQueryError
342342

343343
try:
344344
result = extensions.execute_query("graph_id", "COMPLEX LONG RUNNING QUERY")
@@ -383,7 +383,7 @@ extensions = RoboSystemsClients(config)
383383
Use query analysis tools:
384384

385385
```python
386-
from robosystems_client.extensions import estimate_query_cost, validate_cypher_query
386+
from robosystems_client.clients import estimate_query_cost, validate_cypher_query
387387

388388
# Analyze before execution
389389
query = "MATCH (c:Company) WHERE c.revenue > 1000000 RETURN c"
@@ -434,20 +434,20 @@ Run the test suite:
434434
python run_tests.py
435435

436436
# Or individual test suites
437-
python -c "from robosystems_client.extensions.tests.test_unit import run_unit_tests; run_unit_tests()"
438-
python -c "from robosystems_client.extensions.tests.test_integration import run_integration_tests; run_integration_tests()"
437+
python -c "from robosystems_client.clients.tests.test_unit import run_unit_tests; run_unit_tests()"
438+
python -c "from robosystems_client.clients.tests.test_integration import run_integration_tests; run_integration_tests()"
439439
```
440440

441441
### Writing Tests
442442

443443
```python
444-
from robosystems_client.extensions import AuthenticatedClients
444+
from robosystems_client.clients import AuthenticatedClients
445445
from unittest.mock import Mock, patch
446446

447447
def test_query_execution():
448448
extensions = AuthenticatedClients("test-key")
449449

450-
with patch('robosystems_client.extensions.auth_integration.sync_detailed') as mock_query:
450+
with patch('robosystems_client.clients.auth_integration.sync_detailed') as mock_query:
451451
# Mock successful response
452452
mock_response = Mock()
453453
mock_response.parsed.data = [{"count": 100}]
@@ -476,7 +476,7 @@ export ROBOSYSTEMS_RETRY_DELAY="2000"
476476
### Configuration Object
477477

478478
```python
479-
from robosystems_client.extensions import RoboSystemsClientConfig
479+
from robosystems_client.clients import RoboSystemsClientConfig
480480

481481
config = RoboSystemsClientConfig(
482482
base_url="https://api.robosystems.ai",

‎robosystems_client/clients/__init__.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,34 +211,34 @@
211211
"DataFrameQueryClient",
212212
]
213213

214-
# Create a default extensions instance
215-
extensions = RoboSystemsClients()
214+
# Create a default clients instance
215+
clients = RoboSystemsClients()
216216

217217

218218
# Export convenience functions
219219
def monitor_operation(operation_id: str, on_progress=None):
220-
"""Monitor an operation using the default extensions instance"""
221-
return extensions.monitor_operation(operation_id, on_progress)
220+
"""Monitor an operation using the default clients instance"""
221+
return clients.monitor_operation(operation_id, on_progress)
222222

223223

224224
def execute_query(graph_id: str, query: str, parameters=None):
225-
"""Execute a query using the default extensions instance"""
226-
return extensions.query.query(graph_id, query, parameters)
225+
"""Execute a query using the default clients instance"""
226+
return clients.query.query(graph_id, query, parameters)
227227

228228

229229
def stream_query(graph_id: str, query: str, parameters=None, chunk_size=None):
230-
"""Stream a query using the default extensions instance"""
231-
return extensions.query.stream_query(graph_id, query, parameters, chunk_size)
230+
"""Stream a query using the default clients instance"""
231+
return clients.query.stream_query(graph_id, query, parameters, chunk_size)
232232

233233

234234
def agent_query(graph_id: str, message: str, context=None):
235-
"""Execute an agent query using the default extensions instance"""
236-
return extensions.agent.query(graph_id, message, context)
235+
"""Execute an agent query using the default clients instance"""
236+
return clients.agent.query(graph_id, message, context)
237237

238238

239239
def analyze_financials(graph_id: str, message: str, on_progress=None):
240-
"""Execute financial agent using the default extensions instance"""
241-
return extensions.agent.analyze_financials(graph_id, message, on_progress)
240+
"""Execute financial agent using the default clients instance"""
241+
return clients.agent.analyze_financials(graph_id, message, on_progress)
242242

243243

244244
# DataFrame convenience functions (if pandas is available)

0 commit comments

Comments
 (0)