MCPcopy
hub / github.com/Agenta-AI/agenta / fetch_app_variant_by_base_id

Function fetch_app_variant_by_base_id

api/oss/src/services/db_manager.py:162–179  ·  view source on GitHub ↗

Fetches an app variant by its base ID and config name. Args: base_id (str): The ID of the variant base to fetch Returns: AppVariantDB: The fetched app variant, or None if no app variant was found.

(base_id: str)

Source from the content-addressed store, hash-verified

160
161
162async def fetch_app_variant_by_base_id(base_id: str) -> Optional[AppVariantDB]:
163 """
164 Fetches an app variant by its base ID and config name.
165
166 Args:
167 base_id (str): The ID of the variant base to fetch
168
169 Returns:
170 AppVariantDB: The fetched app variant, or None if no app variant was found.
171 """
172
173 assert base_id is not None, "base_id cannot be None"
174 async with engine.core_session() as session:
175 result = await session.execute(
176 select(AppVariantDB).filter_by(base_id=uuid.UUID(base_id))
177 )
178 app_variant = result.scalars().first()
179 return app_variant
180
181
182async def fetch_app_variant_by_base_id_and_config_name(

Callers

nothing calls this directly

Calls 1

core_sessionMethod · 0.80

Tested by

no test coverage detected