Skip to content

Commit 41bb70f

Browse files
committed
add more imports to lint and fix the documentation
1 parent 3e1eaf8 commit 41bb70f

File tree

8 files changed

+67
-23
lines changed

8 files changed

+67
-23
lines changed

docs/playbooks/emr-agent/part-1-getting-started.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Three components power this agent:
159159
|-----------|--------|---------|
160160
| `FileWatcherMixin` | `from gaia.utils import FileWatcherMixin` | Auto-detect new files in a directory |
161161
| `DatabaseMixin` | `from gaia.database import DatabaseMixin` | SQLite storage with `query()`, `insert()`, `update()` |
162-
| `VLMClient` | `from gaia.llm.vlm_client import VLMClient` | Extract structured data from images |
162+
| `VLMClient` | `from gaia.llm import VLMClient` | Extract structured data from images |
163163

164164
```python
165165
# FileWatcherMixin - monitors directory, calls callback on new files
@@ -273,7 +273,7 @@ Add VLM to extract patient data from images.
273273
from gaia.agents.base import Agent
274274
from gaia.agents.base.tools import tool
275275
from gaia.database import DatabaseMixin
276-
from gaia.llm.vlm_client import VLMClient
276+
from gaia.llm import VLMClient
277277

278278
EXTRACTION_PROMPT = """Extract patient data from this intake form.
279279
Return ONLY valid JSON: {"first_name": "", "last_name": "", "date_of_birth": "YYYY-MM-DD", "phone": ""}"""
@@ -369,7 +369,7 @@ Make the agent fully automatic—process forms as soon as they arrive.
369369
from gaia.agents.base.tools import tool
370370
from gaia.database import DatabaseMixin
371371
from gaia.utils import FileWatcherMixin
372-
from gaia.llm.vlm_client import VLMClient
372+
from gaia.llm import VLMClient
373373
from pathlib import Path
374374
import json
375375

@@ -563,7 +563,7 @@ def __init__(self, watch_dir: str, **kwargs):
563563
def _get_vlm(self):
564564
"""Lazy initialization - only create when needed."""
565565
if self._vlm is None:
566-
from gaia.llm.vlm_client import VLMClient
566+
from gaia.llm import VLMClient
567567
self._vlm = VLMClient()
568568
return self._vlm
569569
```

docs/sdk/api-reference.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
| `ChatSDK` | `gaia.chat.sdk` | Chat with memory |
3131
| `ChatConfig` | `gaia.chat.sdk` | Chat configuration |
3232
| `quick_chat` | `gaia.chat.sdk` | One-off chat function |
33-
| `LLMClient` | `gaia.llm.llm_client` | LLM client (local/cloud) |
34-
| `VLMClient` | `gaia.llm.vlm_client` | Vision-language model |
33+
| `LLMClient` | `gaia.llm` | LLM client (local/cloud) |
34+
| `VLMClient` | `gaia.llm` | Vision-language model |
3535

3636
---
3737

docs/sdk/examples.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ result = agent.process_query("What are the installation requirements?")
160160
```python
161161
from gaia.agents.base.agent import Agent
162162
from gaia.agents.base.tools import tool
163-
from gaia.llm.vlm_client import VLMClient
163+
from gaia.llm import VLMClient
164164
from pathlib import Path
165165
import sqlite3
166166
import json

docs/sdk/sdks/llm.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "LLM Integration"
77
</Info>
88

99
<Note>
10-
**Import:** `from gaia.llm.llm_client import LLMClient`
10+
**Import:** `from gaia.llm import LLMClient`
1111
</Note>
1212
---
1313

@@ -20,7 +20,7 @@ title: "LLM Integration"
2020
## LLM Client
2121

2222
```python
23-
from gaia.llm.llm_client import LLMClient
23+
from gaia.llm import LLMClient
2424

2525
# Local LLM (Lemonade server)
2626
llm = LLMClient(
@@ -65,7 +65,7 @@ for model in models:
6565
## Cloud Providers
6666

6767
```python
68-
from gaia.llm.llm_client import LLMClient
68+
from gaia.llm import LLMClient
6969

7070
# Claude API
7171
llm_claude = LLMClient(

docs/sdk/sdks/vlm.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: "Vision-Language Models"
77
</Info>
88

99
<Note>
10-
**Import:** `from gaia.llm.vlm_client import VLMClient`
10+
**Import:** `from gaia.llm import VLMClient`
1111
</Note>
1212
---
1313

@@ -24,7 +24,7 @@ title: "Vision-Language Models"
2424
## Basic VLM Usage
2525

2626
```python
27-
from gaia.llm.vlm_client import VLMClient
27+
from gaia.llm import VLMClient
2828
from pathlib import Path
2929

3030
# Initialize VLM
@@ -49,7 +49,7 @@ if vlm.check_availability():
4949
## Structured Extraction
5050

5151
```python
52-
from gaia.llm.vlm_client import VLMClient
52+
from gaia.llm import VLMClient
5353
from pathlib import Path
5454
import json
5555

@@ -93,7 +93,7 @@ except json.JSONDecodeError:
9393
```python
9494
from gaia.agents.base.agent import Agent
9595
from gaia.agents.base.tools import tool
96-
from gaia.llm.vlm_client import VLMClient
96+
from gaia.llm import VLMClient
9797
from pathlib import Path
9898

9999
class FormProcessingAgent(Agent):

docs/spec/file-change-handler.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def test_callback_error_handling():
404404

405405
```python
406406
from gaia import Agent, FileChangeHandler
407-
from gaia.llm.vlm_client import VLMClient
407+
from gaia.llm import VLMClient
408408
from watchdog.observers import Observer
409409
from pathlib import Path
410410

src/gaia/llm/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
from .base_client import LLMClient
66
from .exceptions import NotSupportedError
77
from .factory import create_client
8+
from .vlm_client import VLMClient
89

9-
__all__ = ["create_client", "LLMClient", "NotSupportedError"]
10+
__all__ = ["create_client", "LLMClient", "VLMClient", "NotSupportedError"]

util/lint.ps1

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,63 @@ function Invoke-ImportTests {
238238
Write-Host "----------------------------------------"
239239

240240
$imports = @(
241+
# Core CLI
241242
@{Module="gaia.cli"; Desc="CLI module"},
242-
@{Module="gaia.chat.sdk"; Desc="Chat SDK"},
243-
@{Module="gaia.llm"; Desc="LLM client"},
244-
@{Module="gaia.agents.base.agent"; Desc="Base agent"}
243+
244+
# LLM Clients (test module and key exports)
245+
@{Module="gaia.llm"; Desc="LLM package"},
246+
@{Import="from gaia.llm import LLMClient"; Desc="LLM client class"},
247+
@{Import="from gaia.llm import VLMClient"; Desc="Vision LLM client"},
248+
@{Import="from gaia.llm import create_client"; Desc="LLM factory"},
249+
250+
# Chat SDK
251+
@{Module="gaia.chat.sdk"; Desc="Chat SDK module"},
252+
@{Import="from gaia.chat.sdk import ChatSDK"; Desc="Chat SDK class"},
253+
@{Import="from gaia.chat.sdk import ChatConfig"; Desc="Chat configuration"},
254+
@{Import="from gaia.chat.sdk import quick_chat"; Desc="Quick chat function"},
255+
256+
# RAG SDK
257+
@{Module="gaia.rag.sdk"; Desc="RAG SDK module"},
258+
@{Import="from gaia.rag.sdk import RAGSDK"; Desc="RAG SDK class"},
259+
260+
# Base Agent System
261+
@{Module="gaia.agents.base.agent"; Desc="Base agent module"},
262+
@{Import="from gaia.agents.base.agent import Agent"; Desc="Base Agent class"},
263+
@{Import="from gaia.agents.base import MCPAgent"; Desc="MCP agent mixin"},
264+
@{Import="from gaia.agents.base import tool"; Desc="Tool decorator"},
265+
266+
# Specialized Agents
267+
@{Import="from gaia.agents.chat import ChatAgent"; Desc="Chat agent"},
268+
@{Import="from gaia.agents.code import CodeAgent"; Desc="Code agent"},
269+
@{Import="from gaia.agents.jira import JiraAgent"; Desc="Jira agent"},
270+
@{Import="from gaia.agents.docker import DockerAgent"; Desc="Docker agent"},
271+
272+
# Database
273+
@{Import="from gaia.database import DatabaseAgent"; Desc="Database agent"},
274+
@{Import="from gaia.database import DatabaseMixin"; Desc="Database mixin"},
275+
276+
# Utilities
277+
@{Import="from gaia.utils import FileWatcher"; Desc="File watcher"}
245278
)
246279

247280
$failed = $false
248281
$script:ImportsIssues = 0
249282
foreach ($import in $imports) {
250-
$cmd = "$PYTHON_PATH -c `"import $($import.Module); print('OK: $($import.Desc) imports')`""
251-
Write-Host "[CMD] $cmd" -ForegroundColor DarkGray
252-
& $PYTHON_PATH -c "import $($import.Module); print('OK: $($import.Desc) imports')" 2>&1 | Out-String -Width 4096
283+
# Handle both "Module" (import x) and "Import" (from x import y) syntax
284+
if ($import.Module) {
285+
$cmd = "import $($import.Module); print('OK: $($import.Desc) imports')"
286+
$displayCmd = "python -c `"import $($import.Module); print('OK: $($import.Desc) imports')`""
287+
$failedImport = $import.Module
288+
} elseif ($import.Import) {
289+
$cmd = "$($import.Import); print('OK: $($import.Desc) imports')"
290+
$displayCmd = "python -c `"$($import.Import); print('OK: $($import.Desc) imports')`""
291+
$failedImport = $import.Import
292+
}
293+
294+
Write-Host "[CMD] $displayCmd" -ForegroundColor DarkGray
295+
& $PYTHON_PATH -c $cmd 2>&1 | Out-String -Width 4096
253296
if ($LASTEXITCODE -ne 0) {
254-
Write-Host "[!] Failed to import $($import.Module)" -ForegroundColor Red
297+
Write-Host "[!] Failed: $failedImport" -ForegroundColor Red
255298
$failed = $true
256299
$script:ImportsIssues++
257300
}

0 commit comments

Comments
 (0)