Home / Function/ alist_keys() — langchain Function Reference

alist_keys() — langchain Function Reference

Architecture documentation for the alist_keys() function in _sql_record_manager.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a9a98c6e_44f0_63bb_4849_7c2cc001e1aa["alist_keys()"]
  9d7938c1_1c25_4cae_be80_9fc00a5ed077["SQLRecordManager"]
  a9a98c6e_44f0_63bb_4849_7c2cc001e1aa -->|defined in| 9d7938c1_1c25_4cae_be80_9fc00a5ed077
  d75b3a18_aeb2_cb98_8ca3_1eab11972c74["_amake_session()"]
  a9a98c6e_44f0_63bb_4849_7c2cc001e1aa -->|calls| d75b3a18_aeb2_cb98_8ca3_1eab11972c74
  style a9a98c6e_44f0_63bb_4849_7c2cc001e1aa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/indexes/_sql_record_manager.py lines 478–504

    async def alist_keys(
        self,
        *,
        before: float | None = None,
        after: float | None = None,
        group_ids: Sequence[str] | None = None,
        limit: int | None = None,
    ) -> list[str]:
        """List records in the SQLite database based on the provided date range."""
        session: AsyncSession
        async with self._amake_session() as session:
            query: Query = select(UpsertionRecord.key).filter(  # type: ignore[assignment]
                UpsertionRecord.namespace == self.namespace,
            )

            # mypy does not recognize .all() or .filter()
            if after:
                query = query.filter(UpsertionRecord.updated_at > after)
            if before:
                query = query.filter(UpsertionRecord.updated_at < before)
            if group_ids:
                query = query.filter(UpsertionRecord.group_id.in_(group_ids))

            if limit:
                query = query.limit(limit)
            records = (await session.execute(query)).scalars().all()
        return list(records)

Domain

Subdomains

Frequently Asked Questions

What does alist_keys() do?
alist_keys() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/indexes/_sql_record_manager.py.
Where is alist_keys() defined?
alist_keys() is defined in libs/langchain/langchain_classic/indexes/_sql_record_manager.py at line 478.
What does alist_keys() call?
alist_keys() calls 1 function(s): _amake_session.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free