Skip to main content

Python package for forrasdk

Project description

Forra SDK Package

Helper python package to interact with the Forra platform.

Installation

pip install forrasdk

Usage

from forrasdk import ForraAPI

forra = ForraAPI(base_url="your_forra_base_url", api_access_token="you_api_access_token")

Retry Logic

The SDK automatically retries failed API requests with exponential backoff to handle transient failures. This improves reliability when dealing with network issues or temporary server problems.

Default Behavior

  • Max attempts: 3 (initial request + 2 retries)
  • Wait time: Exponential backoff with multiplier=1, min=4s, max=10s
  • Retry on:
    • Rate limiting (429)
    • Server errors (500, 502, 503, 504)
    • Network errors (ConnectionError, Timeout)
  • Does NOT retry on:
    • Client errors (400, 401, 403, 404, etc.)
    • Successful responses

How It Works

All HTTP methods (GET, POST, PUT, DELETE, PATCH) in the SDK automatically retry on transient failures:

from forrasdk import ForraAPI

forra = ForraAPI(base_url="your_url", api_access_token="your_token")

# This request will automatically retry up to 3 times on 5xx errors
response = forra.chat.completion(messages="Hello!")

The retry logic is transparent - you don't need to change your code. If a request fails with a retryable error, the SDK will:

  1. Wait with exponential backoff (4s, then 8s, then 10s max)
  2. Retry the request
  3. Return the result if successful, or raise the exception after exhausting retries

Project details


Download files

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

Source Distribution

forrasdk-0.3.9.tar.gz (416.4 kB view details)

Uploaded Source

Built Distribution

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

forrasdk-0.3.9-py3-none-any.whl (492.7 kB view details)

Uploaded Python 3

File details

Details for the file forrasdk-0.3.9.tar.gz.

File metadata

  • Download URL: forrasdk-0.3.9.tar.gz
  • Upload date:
  • Size: 416.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for forrasdk-0.3.9.tar.gz
Algorithm Hash digest
SHA256 fee3fc225fc946966035608c5c23b1caedf20c78f4cb2bdc574bee1894e6fa67
MD5 2d23d0f6422bbf918192da7821e88ede
BLAKE2b-256 7ffd4c56ab1bc4b19ca28e760b7af5534ea65956ae64bdd2f675a4a5476350ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for forrasdk-0.3.9.tar.gz:

Publisher: publish-forrasdk.yml on mirego/mirego-scout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file forrasdk-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: forrasdk-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 492.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for forrasdk-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 684ed9b4f0885ed45e81ef7612955c7cf4626612a1d1bf2920a6d3c9b6abd582
MD5 edfc1101422dbcfcda91486ba4cd46c1
BLAKE2b-256 2afa47392c24c664dddead91372ba6f482669d7697e3c8f22be7ab8f6ef91123

See more details on using hashes here.

Provenance

The following attestation bundles were made for forrasdk-0.3.9-py3-none-any.whl:

Publisher: publish-forrasdk.yml on mirego/mirego-scout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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