mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-31 18:08:05 -05:00
refactor: rename to get_store_listed_graphs
Clearer name indicating these are store-listed public graphs that don't require permission checks.
This commit is contained in:
@@ -14,7 +14,7 @@ from backend.data.graph import (
|
||||
create_graph,
|
||||
get_graph,
|
||||
get_graph_all_versions,
|
||||
get_graphs_by_ids,
|
||||
get_store_listed_graphs,
|
||||
)
|
||||
from backend.util.exceptions import DatabaseError, NotFoundError
|
||||
|
||||
@@ -295,7 +295,7 @@ async def search_marketplace_agents_for_generation(
|
||||
return []
|
||||
|
||||
graph_ids = [agent.agent_graph_id for agent in agents_with_graphs]
|
||||
graphs = await get_graphs_by_ids(*graph_ids)
|
||||
graphs = await get_store_listed_graphs(*graph_ids)
|
||||
|
||||
results: list[LibraryAgentSummary] = []
|
||||
for agent in agents_with_graphs:
|
||||
|
||||
@@ -1028,18 +1028,17 @@ async def get_graph(
|
||||
return GraphModel.from_db(graph, for_export)
|
||||
|
||||
|
||||
async def get_graphs_by_ids(*graph_ids: str) -> dict[str, GraphModel]:
|
||||
"""Batch-fetch multiple public/marketplace graphs by their IDs.
|
||||
async def get_store_listed_graphs(*graph_ids: str) -> dict[str, GraphModel]:
|
||||
"""Batch-fetch multiple store-listed graphs by their IDs.
|
||||
|
||||
This fetches graphs that are publicly available via approved store listings.
|
||||
Used for marketplace agent schema lookups where we need multiple graphs
|
||||
in a single query.
|
||||
Only returns graphs that have approved store listings (publicly available).
|
||||
Does not require permission checks since store-listed graphs are public.
|
||||
|
||||
Args:
|
||||
*graph_ids: Variable number of graph IDs to fetch
|
||||
|
||||
Returns:
|
||||
Dict mapping graph_id to GraphModel for successfully fetched graphs
|
||||
Dict mapping graph_id to GraphModel for graphs with approved store listings
|
||||
"""
|
||||
if not graph_ids:
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user