Changelogs » Skill-sdk

PyUp Safety actively tracks 304,723 Python packages for vulnerabilities and notifies you when to upgrade.



  - [47](
  Scaffold project files added to both binary and source distribution.
  - [45](
  New "response_hook" parameter when constructing `requests.Client/AsyncClient`.
  Allows plugging in observability metrics when calling partner services.
  For example, to count partner service requests with response codes:
  from skill_sdk.requests import AsyncClient
  from skill_sdk.middleware.prometheus import count_partner_calls
  async with AsyncClient(
  ) as client:
  response = await client.get("https://partner-service-api")
  - [43](
  Source code documentation has been reviewed.
  - [42](
  Asyncio event loops can be nested when calling `utils.run_until_complete`.
  Usable when mixing sync and async handlers.


Major changes
  Explicit concurrency model:
  Skill SDK for Python supports asynchronous coroutines (`async def` intent handlers):
  async def handler() -> Response:
  return await long_running_async_function()
  Synchronous handlers are also supported and executed in [ThreadPoolExecutor](
  Breaking changes
  1. No more text services.
  This is a major step towards completely phasing out the text services. Only local translations
  (both gettext `.po/.mo` and YAML formats) are supported. The translations will not be reloaded from cloud service.
  2. Global invocation `context` object is replaced with `request` [context variable](
  The variable is accessible to intent handlers and is a copy of currently running invoke request: [InvokeSkillRequestDto](
  3. Localization became _internationalization_.
  `skill_sdk.l10n` is renamed to `skill_sdk.i18n` and [python-babel]( is used as translation module.
  4. Tracing and Prometheus middleware has become optional.
  To make use of tracings/metrics, skill SDK must be installed with **all** extra: `python -m pip install skill-sdk[all]`.
  With this extra installed, tracing helpers are importable from `skill_sdk.middleware.tracing`,
  and Prometheus helpers - from `skill_sdk.middleware.prometheus`.
  5. Responses are immutable:
  You can create a response (or any related object like Card, Kit, Task, Command) in a constructor.
  After constructing the object, the only way to mutate it is by using the factory methods.
  Minor and non-breaking changes
  1. Skill configuration changes.
  Skill configuration is available as attributes of `skill_sdk.config.settings` object.
  For backward compatibility, `skill.conf` file in [ConfigParser]( format is still supported.
  Section names are joined with config keys and converted to upper-case, so that a value `url` in `[service]` section
  is available as `settings.SERVICE_URL`
  from skill_sdk.config import settings
  settings.SKILL_NAME      skill name - corresponds to **name** attribute in **[skill]** section
  settings.VALUE_FOR_TESTING = "test"   config values are mutable
  It is suggested migrating the skill config to [BaseSetting]( format.
  2. Test helpers have been moved to `skill_sdk.util` module.
  3. Python [requests]( are replaced with [HTTPX]( client.
  [requests_mock]( doesn't work any more and is replaced with [respx]( module.
  4. `requests.CircuitBreakerSession` is deprecated.
  There are now two similar adapters in `skill_sdk.requests`.
  One is `skill_sdk.requests.Client` - an HTTPX synchronous client (`requests.CircuitBreakerSession` is simply an alias for this adapter).
  The other is `skill_sdk.requests.AsyncClient` - an asynchronous client compatible with `await`/`async with` statements.
  `good_codes/bad_codes` are replaced with `exclude` parameter.  _Good_ codes are the HTTP status codes between 200 and 399.
  To suppress an exception if HTTP 404 is returned as status code, use `exclude`:
  from skill_sdk.requests import AsyncClient, codes
  with AsyncClient() as client:
  r = await client.request("GET", "my_url", exclude=(codes.NOT_FOUND,))