界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

api-client-settings

api-client-settings

【效率与协作】Use Prefect Python clients, settings, profiles, schemas, and the prefect-client package split safely.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: api-client-settings description: "Use Prefect Python clients, settings, profiles, schemas, and the prefect-client package split safely." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Prefect API Client and Settings

Use this sub-skill when a task needs direct Python access to Prefect orchestration or Cloud APIs, settings/profile diagnosis, schema-model construction, or the lightweight prefect-client package boundary.

Start Here

  1. Choose the client style in references/api-reference.md: async with get_client() for async code, with get_client(sync_client=True) for synchronous code.
  2. Confirm configuration in references/settings-and-profiles.md: PREFECT_API_URL, PREFECT_API_KEY, active profile, and source precedence.
  3. If the environment uses prefect-client instead of the full prefect package, read references/prefect-client-package.md before importing CLI/server modules.
  4. For failures, use references/troubleshooting.md and the bundled scripts/inspect_prefect_settings.py helper.

Use For

  • get_client, PrefectClient, SyncPrefectClient, and direct REST API method calls.
  • Pydantic schema objects under prefect.client.schemas.* for filters, sorts, actions, objects, and responses.
  • get_current_settings, temporary_settings, settings accessors, environment variables, .env, prefect.toml, pyproject.toml, and profiles TOML.
  • prefect-client package behavior and custom generated deployment SDK usage patterns.

Route Elsewhere

  • Server implementation internals, generated schema maintenance, and repo test selection: ../repo-development/SKILL.md.
  • CLI command operations, server startup, Cloud login commands, and profile/config command usage: ../cli-server-operations/SKILL.md.
  • Flow/task decorators, execution semantics, states, futures, and task runners: ../flow-task-authoring/SKILL.md.
  • Deployment creation, work pools, workers, and deployment YAML: ../deployments-workers/SKILL.md.

Safe Validation

  • Inspect effective settings without network calls:
python scripts/inspect_prefect_settings.py --schema-summary
  • Validate a profiles TOML file before relying on it:
python scripts/inspect_prefect_settings.py --validate-profiles --profiles-path ~/.prefect/profiles.toml
  • For client code, prefer tiny hello() or read-only list/filter calls against a known API URL; do not start long-lived services from this sub-skill.
我的收藏