From 114786cb81c9e96541872b6f43dde09dbacf9db0 Mon Sep 17 00:00:00 2001 From: Carles Onielfa Date: Thu, 25 Jun 2026 10:52:13 +0200 Subject: [PATCH] Rename driver to source --- agents/google/src/hyperforge_google/driver.py | 4 ++-- agents/mcp/src/hyperforge_mcp/agent.py | 2 +- agents/mcp/src/hyperforge_mcp/http.py | 4 ++-- agents/mcp/src/hyperforge_mcp/multi.py | 2 +- agents/mcp/src/hyperforge_mcp/stdio.py | 6 +++--- agents/nucliadb/src/hyperforge_nucliadb/ask/multi.py | 2 +- agents/nucliadb/src/hyperforge_nucliadb/driver.py | 4 ++-- agents/nucliadb/src/hyperforge_nucliadb/sync/agent.py | 2 +- agents/nucliadb/src/hyperforge_nucliadb/sync/driver.py | 4 ++-- agents/nucliadb/tests/test_sync.py | 2 +- agents/perplexity/src/hyperforge_perplexity/driver.py | 4 ++-- .../perplexity/src/hyperforge_perplexity/perplexity.py | 4 ++-- .../src/hyperforge_perplexity_search/agent.py | 4 ++-- agents/rephrase/src/hyperforge_rephrase/agent.py | 2 +- hyperforge/src/hyperforge/configure.py | 10 +++++----- hyperforge/src/hyperforge/driver.py | 4 ++-- hyperforge/src/hyperforge/standalone/agent.py | 2 +- hyperforge/src/hyperforge/utils/__init__.py | 2 +- 18 files changed, 32 insertions(+), 32 deletions(-) diff --git a/agents/google/src/hyperforge_google/driver.py b/agents/google/src/hyperforge_google/driver.py index 045f027..8bb1307 100644 --- a/agents/google/src/hyperforge_google/driver.py +++ b/agents/google/src/hyperforge_google/driver.py @@ -8,8 +8,8 @@ @driver( id="google", - title="Google Driver", - description="Driver for interacting with the Google API.", + title="Google Source", + description="Source for interacting with the Google API.", config_schema=GoogleDriverConfig, ) class GoogleDriver(Driver): diff --git a/agents/mcp/src/hyperforge_mcp/agent.py b/agents/mcp/src/hyperforge_mcp/agent.py index 4c5f239..248ff0e 100644 --- a/agents/mcp/src/hyperforge_mcp/agent.py +++ b/agents/mcp/src/hyperforge_mcp/agent.py @@ -1139,7 +1139,7 @@ async def _get_question_context( try: await self.initialize(manager, memory) except KeyError: - raise Exception("No MCP driver found") + raise Exception("No MCP source found") context = Context( agent_id=self.agent_id, diff --git a/agents/mcp/src/hyperforge_mcp/http.py b/agents/mcp/src/hyperforge_mcp/http.py index 2fa875b..882d796 100644 --- a/agents/mcp/src/hyperforge_mcp/http.py +++ b/agents/mcp/src/hyperforge_mcp/http.py @@ -719,8 +719,8 @@ async def handle_callback( @driver( id="mcphttp", - title="MCP HTTP Driver", - description="Driver for interacting with the MCP HTTP API.", + title="MCP HTTP Source", + description="Source for interacting with the MCP HTTP API.", config_schema=MCPHTTPDriverConfig, ) class MCPHTTPDriver(Driver): diff --git a/agents/mcp/src/hyperforge_mcp/multi.py b/agents/mcp/src/hyperforge_mcp/multi.py index 05171fc..6ab450c 100644 --- a/agents/mcp/src/hyperforge_mcp/multi.py +++ b/agents/mcp/src/hyperforge_mcp/multi.py @@ -284,7 +284,7 @@ async def get_question_context( try: await agent.initialize(manager, memory) except KeyError: - raise Exception("No MCP driver found") + raise Exception("No MCP source found") response, input_tokens, output_tokens = await self.summarize_tools( manager, agent.tools, diff --git a/agents/mcp/src/hyperforge_mcp/stdio.py b/agents/mcp/src/hyperforge_mcp/stdio.py index ca1a5f5..0842490 100644 --- a/agents/mcp/src/hyperforge_mcp/stdio.py +++ b/agents/mcp/src/hyperforge_mcp/stdio.py @@ -130,8 +130,8 @@ class MCPStdioFullDriverConfig(MCPStdioInnerConfig): @driver( id="mcpstdio", - title="MCP Stdio Driver", - description="Driver for interacting with the MCP Stdio API.", + title="MCP Stdio Source", + description="Source for interacting with the MCP Stdio API.", config_schema=MCPStdioDriverConfig, ) class MCPStdioDriver(Driver): @@ -163,7 +163,7 @@ async def init(cls, driver: MCPStdioDriverConfig) -> Self: for env in validated_config.env: if driver.config.env is None or env not in driver.config.env: raise KeyError( - f"No environmental variable on MCP driver {driver.config.server}: {env}" + f"No environmental variable on MCP source {driver.config.server}: {env}" ) combined_envs = {} diff --git a/agents/nucliadb/src/hyperforge_nucliadb/ask/multi.py b/agents/nucliadb/src/hyperforge_nucliadb/ask/multi.py index 08ff3ec..4549ead 100644 --- a/agents/nucliadb/src/hyperforge_nucliadb/ask/multi.py +++ b/agents/nucliadb/src/hyperforge_nucliadb/ask/multi.py @@ -122,7 +122,7 @@ async def choose_source( async def load_source_information(source: str, manager: Manager) -> Source: driver = manager.drivers.get(source) if not isinstance(driver, NucliaDBDriver) and not isinstance(driver, SyncDriver): - raise ValueError("Source is not a NucliaDB driver") + raise ValueError("Source is not a KnowledgeBox source") ( description, labels, diff --git a/agents/nucliadb/src/hyperforge_nucliadb/driver.py b/agents/nucliadb/src/hyperforge_nucliadb/driver.py index f3bda2b..c170035 100644 --- a/agents/nucliadb/src/hyperforge_nucliadb/driver.py +++ b/agents/nucliadb/src/hyperforge_nucliadb/driver.py @@ -81,8 +81,8 @@ async def manager_connect(conn: NucliaDBConnection): @driver( id="nucliadb", - title="NucliaDB Driver", - description="Driver for interacting with the NucliaDB API.", + title="KnowledgeBox Source", + description="Source for interacting with the KnowledgeBox API.", config_schema=NucliaDBConfig, ) class NucliaDBDriver(Driver): diff --git a/agents/nucliadb/src/hyperforge_nucliadb/sync/agent.py b/agents/nucliadb/src/hyperforge_nucliadb/sync/agent.py index e2952e9..5491070 100644 --- a/agents/nucliadb/src/hyperforge_nucliadb/sync/agent.py +++ b/agents/nucliadb/src/hyperforge_nucliadb/sync/agent.py @@ -157,7 +157,7 @@ async def post_filter_resources_by_connection( or len(driver.sync_configs[sync_config_id]) == 0 ): raise Exception( - f"Connection ID {sync_config_id} not found in driver sync configs" + f"Connection ID {sync_config_id} not found in source sync configs" ) inner_connection_id = driver.sync_configs[sync_config_id][0] creds_providers[sync_config_id] = driver.information[ diff --git a/agents/nucliadb/src/hyperforge_nucliadb/sync/driver.py b/agents/nucliadb/src/hyperforge_nucliadb/sync/driver.py index 662b85b..d8e04ff 100644 --- a/agents/nucliadb/src/hyperforge_nucliadb/sync/driver.py +++ b/agents/nucliadb/src/hyperforge_nucliadb/sync/driver.py @@ -52,8 +52,8 @@ class ExternalConnectionOutput(BaseModel): @driver( id="sync", - title="Sync Driver", - description="Driver for interacting with the Sync API.", + title="Sync Source", + description="Source for interacting with the Sync API.", config_schema=SyncDriverConfig, ) class SyncDriver(NucliaDBDriver): diff --git a/agents/nucliadb/tests/test_sync.py b/agents/nucliadb/tests/test_sync.py index 68007e9..904c2ea 100644 --- a/agents/nucliadb/tests/test_sync.py +++ b/agents/nucliadb/tests/test_sync.py @@ -36,7 +36,7 @@ "kbid": "e103caf3-f8cb-4161-a57c-aad1192d0666", "key": KB_E103CAF3_F8CB_4161_A57C_AAD1192D0666, "filters": [], - "description": "Nuclia Sync driver for testing", + "description": "Nuclia Sync source for testing", "connection_ids": ["019cade7-c177-77c5-99c2-c8771f85cf91"], }, }, diff --git a/agents/perplexity/src/hyperforge_perplexity/driver.py b/agents/perplexity/src/hyperforge_perplexity/driver.py index d647df4..52a6492 100644 --- a/agents/perplexity/src/hyperforge_perplexity/driver.py +++ b/agents/perplexity/src/hyperforge_perplexity/driver.py @@ -7,8 +7,8 @@ @driver( id="perplexity", - title="Perplexity Driver", - description="Driver for interacting with the Perplexity API.", + title="Perplexity Source", + description="Source for interacting with the Perplexity API.", config_schema=PerplexityDriverConfig, ) class PerplexityDriver(Driver): diff --git a/agents/perplexity/src/hyperforge_perplexity/perplexity.py b/agents/perplexity/src/hyperforge_perplexity/perplexity.py index f8b3fe3..fbede5a 100644 --- a/agents/perplexity/src/hyperforge_perplexity/perplexity.py +++ b/agents/perplexity/src/hyperforge_perplexity/perplexity.py @@ -69,7 +69,7 @@ async def internet_search( Optional[PerplexityDriver], manager.drivers.get(self.config.source) ) if self.driver is None: - raise Exception("Perplexity driver does not exist") + raise Exception("Perplexity source does not exist") web_search_options = WebSearchOptions( search_context_size=self.config.search_context_size, @@ -178,7 +178,7 @@ async def _get_question_context( ) if self.driver is None: - raise Exception("Perplexity driver does not exist") + raise Exception("Perplexity source does not exist") context = await self.internet_search( question, diff --git a/agents/perplexity_search/src/hyperforge_perplexity_search/agent.py b/agents/perplexity_search/src/hyperforge_perplexity_search/agent.py index 736fc8d..c5ee24f 100644 --- a/agents/perplexity_search/src/hyperforge_perplexity_search/agent.py +++ b/agents/perplexity_search/src/hyperforge_perplexity_search/agent.py @@ -51,7 +51,7 @@ async def search( Optional[PerplexityDriver], manager.drivers.get(self.config.source) ) if self.driver is None: - raise Exception("Perplexity driver does not exist") + raise Exception("Perplexity source does not exist") response = await self.driver.client.search.create( query=question, @@ -121,7 +121,7 @@ async def _get_question_context( ) if self.driver is None: - raise Exception("Perplexity driver does not exist") + raise Exception("Perplexity source does not exist") context = await self.search( question, diff --git a/agents/rephrase/src/hyperforge_rephrase/agent.py b/agents/rephrase/src/hyperforge_rephrase/agent.py index 5868adb..efb3e52 100644 --- a/agents/rephrase/src/hyperforge_rephrase/agent.py +++ b/agents/rephrase/src/hyperforge_rephrase/agent.py @@ -281,7 +281,7 @@ async def inner_rephrase( NucliaDBDriver, manager.drivers.get(self.config.kb) ) if nucliadb_driver is None: - raise Exception(f"No NucliaDB Driver {self.config.kb} found") + raise Exception(f"No KnowledgeBox source {self.config.kb} found") if self.config.synonyms: question = await nucliadb_driver.synonyms(question) diff --git a/hyperforge/src/hyperforge/configure.py b/hyperforge/src/hyperforge/configure.py index ab2548e..ea5e530 100644 --- a/hyperforge/src/hyperforge/configure.py +++ b/hyperforge/src/hyperforge/configure.py @@ -251,7 +251,7 @@ def load_driver( driver_id = registration.id registration.klass = resolve_dotted_name(klass) if driver_id is None: - raise Exception("Driver configuration must have an 'id' field") + raise Exception("Source configuration must have an 'id' field") if driver_id in _context.drivers: # Already registered return @@ -340,15 +340,15 @@ def get_agent_klass(module: str, _context: Registry = GLOBAL_REGISTRY) -> Type[" def validate_driver(item: Any, _context: Registry = GLOBAL_REGISTRY): if not isinstance(item, dict): - raise ValueError("Driver configuration must be a dictionary") + raise ValueError("Source configuration must be a dictionary") provider = item.get("provider") if provider is None: - raise ValueError("Driver configuration must have a 'provider' field") + raise ValueError("Source configuration must have a 'provider' field") if provider not in _context.drivers: raise ValueError( - f"Driver module '{provider}' is not registered in the drivers registry" + f"Source module '{provider}' is not registered in the drivers registry" ) return _context.drivers[provider].config_schema.model_validate(item) @@ -358,7 +358,7 @@ def get_driver_config_klass( ) -> Type["DriverConfig"]: driver = _context.drivers.get(provider) if driver is None: - raise Exception(f"Driver module '{provider}' is not registered") + raise Exception(f"Source module '{provider}' is not registered") return driver.config_schema diff --git a/hyperforge/src/hyperforge/driver.py b/hyperforge/src/hyperforge/driver.py index 54f4aa4..509f04a 100644 --- a/hyperforge/src/hyperforge/driver.py +++ b/hyperforge/src/hyperforge/driver.py @@ -15,9 +15,9 @@ class DriverConfig(BaseModel, Generic[T]): identifier: str name: str provider: Any = Field( - ..., description="The type of driver, e.g., 'google', 'marklogic', etc." + ..., description="The type of source, e.g., 'google', 'marklogic', etc." ) - config: T = Field(..., description="The configuration specific to the driver.") + config: T = Field(..., description="The configuration specific to the source.") class Driver(BaseModel): diff --git a/hyperforge/src/hyperforge/standalone/agent.py b/hyperforge/src/hyperforge/standalone/agent.py index d908296..5481c94 100644 --- a/hyperforge/src/hyperforge/standalone/agent.py +++ b/hyperforge/src/hyperforge/standalone/agent.py @@ -87,7 +87,7 @@ async def get_driver(self, account: str, agent_id: str, driver: str) -> Any: if drv.identifier == driver: return drv raise exceptions.NotFoundError( - f"Driver '{driver}' not found in agent '{agent_id}'" + f"Source '{driver}' not found in agent '{agent_id}'" ) async def get_drivers(self, account: str, agent_id: str) -> List[Any]: diff --git a/hyperforge/src/hyperforge/utils/__init__.py b/hyperforge/src/hyperforge/utils/__init__.py index 76a52e3..58a5eb9 100644 --- a/hyperforge/src/hyperforge/utils/__init__.py +++ b/hyperforge/src/hyperforge/utils/__init__.py @@ -77,7 +77,7 @@ class WidgetType(str, Enum): # Driver and source selection widgets DRIVER_SELECT = "driver_select" - """Selector for data source drivers (databases, APIs, etc.)""" + """Selector for data sources (databases, APIs, etc.)""" FILTERED_SOURCE_SELECT = "filtered_source_select" """Source selector with filtering capabilities based on transport type"""