Skip to main content

Shared utilities for chat-py platform adapters

Project description

chat-adapter-shared

Shared helpers used by every chat-adapter-* package in chat-py. Python port of upstream packages/adapter-shared.

You only depend on this package directly if you're implementing a new adapter. Normal users pull it in transitively through chat-adapter-slack, chat-adapter-teams, etc.

Install

uv add chat-py-adapter-shared

What it ships

  • adapter_utilsextract_card, extract_files (pull card / file payloads out of a message).
  • buffer_utilsto_buffer, to_buffer_sync, buffer_to_data_uri for fetching and normalizing file inputs (bytes, paths, URLs, data URIs).
  • card_utilscard_to_fallback_text (plain-text rendering of a card), map_button_style, render_gfm_table, create_emoji_converter.
  • errors — shared error hierarchy: AdapterError, AdapterRateLimitError, AuthenticationError, NetworkError, PermissionError, ResourceNotFoundError, ValidationError.

Parity notes

  • 1:1 port of upstream helpers; function names and semantics match.

Test

uv run pytest packages/chat-adapter-shared

Upstream

https://github.com/vercel/chat/tree/main/packages/adapter-shared

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chat_py_adapter_shared-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file chat_py_adapter_shared-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chat_py_adapter_shared-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chat_py_adapter_shared-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a7ba303f34d3d1c4aa67b81a6b794b0fe1be8d7e0ce12fc5094d4151e2ffbc7
MD5 9ab8e58061b5ee33e498b11ef2192d46
BLAKE2b-256 ea0699f70e5effb558ccdc8df6737cff2117ef3a0c20052284f5622654927fa0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page