airbyte.agents.skills

Airbyte Agents skills: reusable documentation served by the Agents API.

⚠️ Experimental Interface

The Airbyte Agents Python interfaces are experimental. Class names, method signatures, and result models may change or be removed without notice between minor versions of PyAirbyte. Pin an exact PyAirbyte version if you depend on them.

  1# Copyright (c) 2026 Airbyte, Inc., all rights reserved.
  2"""Airbyte Agents skills: reusable documentation served by the Agents API.
  3
  4> ## ⚠️ Experimental Interface
  5>
  6> **The Airbyte Agents Python interfaces are experimental.** Class names, method signatures,
  7> and result models may change or be removed without notice between minor versions of
  8> PyAirbyte. Pin an exact PyAirbyte version if you depend on them.
  9"""
 10
 11from __future__ import annotations
 12
 13from typing import TYPE_CHECKING
 14
 15from airbyte._direct_connectors import api_util as _api_util
 16from airbyte._direct_connectors import skills as _skills
 17from airbyte._direct_connectors.models import AgentSkillDocs, AgentSkillInfo, AgentSkillList
 18
 19
 20if TYPE_CHECKING:
 21    from collections.abc import Callable, Iterator
 22
 23    from airbyte.cloud._credentials import _AirbyteCredentials
 24
 25
 26class AgentSkill:
 27    """A skill on the Airbyte Agents platform.
 28
 29    Get one from `AgentWorkspace.get_skill()` or `AgentWorkspace.list_skills()` rather than
 30    constructing it directly.
 31    """
 32
 33    def __init__(
 34        self,
 35        skill_id: str,
 36        *,
 37        credentials: _AirbyteCredentials,
 38        workspace_id: str | None = None,
 39        info: AgentSkillInfo | None = None,
 40    ) -> None:
 41        """Initialize an `AgentSkill`. Prefer `AgentWorkspace.get_skill()`."""
 42        self.skill_id = skill_id
 43        """The skill ID."""
 44
 45        self._credentials = credentials
 46        self._workspace_id = workspace_id
 47        self._info = info
 48
 49    @property
 50    def info(self) -> AgentSkillInfo:
 51        """The skill's metadata, fetched from the Agents API if not already known."""
 52        if self._info is None:
 53            self._info = self.read_docs().metadata
 54        return self._info
 55
 56    @property
 57    def title(self) -> str | None:
 58        """The human-readable skill title."""
 59        return self.info.title
 60
 61    @property
 62    def kind(self) -> str | None:
 63        """The skill category, for example `static` or `connector_source`."""
 64        return self.info.kind
 65
 66    def read_docs(self, *, section: str | None = None) -> AgentSkillDocs:
 67        """Read this skill's docs, optionally scoped to a single section.
 68
 69        Omit `section` for metadata, guidance, and the outline of available sections, or
 70        pass an exact section `id` from the outline to read that section.
 71        """
 72        docs = AgentSkillDocs.model_validate(
 73            _api_util.read_agent_skill_docs(
 74                skill_id=self.skill_id,
 75                credentials=self._credentials,
 76                organization_id=self._credentials.organization_id,
 77                workspace_id=self._workspace_id,
 78                section=section,
 79            )
 80        )
 81        if self._info is None:
 82            self._info = docs.metadata
 83        return docs
 84
 85
 86def list_skills(
 87    *,
 88    credentials: _AirbyteCredentials,
 89    workspace_id: str | None = None,
 90    limit: int | None = None,
 91    cursor: str | None = None,
 92) -> AgentSkillList:
 93    """List the skills available to a workspace or organization.
 94
 95    Pass `limit` to cap the page size and the `next_cursor` of a previous result as
 96    `cursor` to fetch the next page.
 97    """
 98    return AgentSkillList.model_validate(
 99        _api_util.list_agent_skills(
100            credentials=credentials,
101            organization_id=credentials.organization_id,
102            workspace_id=workspace_id,
103            limit=limit,
104            cursor=cursor,
105        )
106    )
107
108
109def _iter_skill_pages(
110    fetch_page: Callable[[str | None], AgentSkillList],
111) -> Iterator[AgentSkillInfo]:
112    """Yield skills across pages, following `next_cursor` until it is `None`.
113
114    Stops early if the server returns a blank cursor or one already seen, rather than
115    requesting the same page forever.
116    """
117    return _skills.iter_skill_pages(fetch_page)
118
119
120def iter_skills(
121    *,
122    credentials: _AirbyteCredentials,
123    workspace_id: str | None = None,
124) -> Iterator[AgentSkillInfo]:
125    """Yield all available skills, following the API's pagination cursor.
126
127    This is the pagination-free way to list skills: each page is fetched lazily as the
128    caller iterates, so no cursor bookkeeping is needed.
129    """
130    return _skills.iter_skill_infos(
131        credentials=credentials,
132        workspace_id=workspace_id,
133    )
class AgentSkill:
27class AgentSkill:
28    """A skill on the Airbyte Agents platform.
29
30    Get one from `AgentWorkspace.get_skill()` or `AgentWorkspace.list_skills()` rather than
31    constructing it directly.
32    """
33
34    def __init__(
35        self,
36        skill_id: str,
37        *,
38        credentials: _AirbyteCredentials,
39        workspace_id: str | None = None,
40        info: AgentSkillInfo | None = None,
41    ) -> None:
42        """Initialize an `AgentSkill`. Prefer `AgentWorkspace.get_skill()`."""
43        self.skill_id = skill_id
44        """The skill ID."""
45
46        self._credentials = credentials
47        self._workspace_id = workspace_id
48        self._info = info
49
50    @property
51    def info(self) -> AgentSkillInfo:
52        """The skill's metadata, fetched from the Agents API if not already known."""
53        if self._info is None:
54            self._info = self.read_docs().metadata
55        return self._info
56
57    @property
58    def title(self) -> str | None:
59        """The human-readable skill title."""
60        return self.info.title
61
62    @property
63    def kind(self) -> str | None:
64        """The skill category, for example `static` or `connector_source`."""
65        return self.info.kind
66
67    def read_docs(self, *, section: str | None = None) -> AgentSkillDocs:
68        """Read this skill's docs, optionally scoped to a single section.
69
70        Omit `section` for metadata, guidance, and the outline of available sections, or
71        pass an exact section `id` from the outline to read that section.
72        """
73        docs = AgentSkillDocs.model_validate(
74            _api_util.read_agent_skill_docs(
75                skill_id=self.skill_id,
76                credentials=self._credentials,
77                organization_id=self._credentials.organization_id,
78                workspace_id=self._workspace_id,
79                section=section,
80            )
81        )
82        if self._info is None:
83            self._info = docs.metadata
84        return docs

A skill on the Airbyte Agents platform.

Get one from AgentWorkspace.get_skill() or AgentWorkspace.list_skills() rather than constructing it directly.

AgentSkill( skill_id: str, *, credentials: airbyte.cloud._credentials._AirbyteCredentials, workspace_id: str | None = None, info: airbyte._direct_connectors.models.AgentSkillInfo | None = None)
34    def __init__(
35        self,
36        skill_id: str,
37        *,
38        credentials: _AirbyteCredentials,
39        workspace_id: str | None = None,
40        info: AgentSkillInfo | None = None,
41    ) -> None:
42        """Initialize an `AgentSkill`. Prefer `AgentWorkspace.get_skill()`."""
43        self.skill_id = skill_id
44        """The skill ID."""
45
46        self._credentials = credentials
47        self._workspace_id = workspace_id
48        self._info = info

Initialize an AgentSkill. Prefer AgentWorkspace.get_skill().

skill_id

The skill ID.

info: airbyte._direct_connectors.models.AgentSkillInfo
50    @property
51    def info(self) -> AgentSkillInfo:
52        """The skill's metadata, fetched from the Agents API if not already known."""
53        if self._info is None:
54            self._info = self.read_docs().metadata
55        return self._info

The skill's metadata, fetched from the Agents API if not already known.

title: str | None
57    @property
58    def title(self) -> str | None:
59        """The human-readable skill title."""
60        return self.info.title

The human-readable skill title.

kind: str | None
62    @property
63    def kind(self) -> str | None:
64        """The skill category, for example `static` or `connector_source`."""
65        return self.info.kind

The skill category, for example static or connector_source.

def read_docs( self, *, section: str | None = None) -> airbyte._direct_connectors.models.AgentSkillDocs:
67    def read_docs(self, *, section: str | None = None) -> AgentSkillDocs:
68        """Read this skill's docs, optionally scoped to a single section.
69
70        Omit `section` for metadata, guidance, and the outline of available sections, or
71        pass an exact section `id` from the outline to read that section.
72        """
73        docs = AgentSkillDocs.model_validate(
74            _api_util.read_agent_skill_docs(
75                skill_id=self.skill_id,
76                credentials=self._credentials,
77                organization_id=self._credentials.organization_id,
78                workspace_id=self._workspace_id,
79                section=section,
80            )
81        )
82        if self._info is None:
83            self._info = docs.metadata
84        return docs

Read this skill's docs, optionally scoped to a single section.

Omit section for metadata, guidance, and the outline of available sections, or pass an exact section id from the outline to read that section.

def list_skills( *, credentials: airbyte.cloud._credentials._AirbyteCredentials, workspace_id: str | None = None, limit: int | None = None, cursor: str | None = None) -> airbyte._direct_connectors.models.AgentSkillList:
 87def list_skills(
 88    *,
 89    credentials: _AirbyteCredentials,
 90    workspace_id: str | None = None,
 91    limit: int | None = None,
 92    cursor: str | None = None,
 93) -> AgentSkillList:
 94    """List the skills available to a workspace or organization.
 95
 96    Pass `limit` to cap the page size and the `next_cursor` of a previous result as
 97    `cursor` to fetch the next page.
 98    """
 99    return AgentSkillList.model_validate(
100        _api_util.list_agent_skills(
101            credentials=credentials,
102            organization_id=credentials.organization_id,
103            workspace_id=workspace_id,
104            limit=limit,
105            cursor=cursor,
106        )
107    )

List the skills available to a workspace or organization.

Pass limit to cap the page size and the next_cursor of a previous result as cursor to fetch the next page.

def iter_skills( *, credentials: airbyte.cloud._credentials._AirbyteCredentials, workspace_id: str | None = None) -> Iterator[airbyte._direct_connectors.models.AgentSkillInfo]:
121def iter_skills(
122    *,
123    credentials: _AirbyteCredentials,
124    workspace_id: str | None = None,
125) -> Iterator[AgentSkillInfo]:
126    """Yield all available skills, following the API's pagination cursor.
127
128    This is the pagination-free way to list skills: each page is fetched lazily as the
129    caller iterates, so no cursor bookkeeping is needed.
130    """
131    return _skills.iter_skill_infos(
132        credentials=credentials,
133        workspace_id=workspace_id,
134    )

Yield all available skills, following the API's pagination cursor.

This is the pagination-free way to list skills: each page is fetched lazily as the caller iterates, so no cursor bookkeeping is needed.