Skip to main content

Latitude SDK for Python

Project description

Latitude SDK for Python

pip install latitude-sdk

Requires Python 3.9 or higher.

Go to the documentation to learn more.

Usage

from latitude_sdk import Latitude, LatitudeOptions, RunPromptOptions

sdk = Latitude("my-api-key", LatitudeOptions(
    project_id="my-project-id",
    version_uuid="my-version-uuid",
))

await sdk.prompts.run("joke-teller", RunPromptOptions(
    parameters={"topic": "Python"},
    on_event=lambda event: print(event),
    on_finished=lambda event: print(event),
    on_error=lambda error: print(error),
    stream=True,
))

Find more examples.

Development

Requires uv 0.5.10 or higher.

  • Install dependencies: uv venv && uv sync --all-extras --all-groups
  • Add [dev] dependencies: uv add [--dev] <package>
  • Run linter: uv run scripts/lint.py
  • Run formatter: uv run scripts/format.py
  • Run tests: uv run scripts/test.py
  • Build package: uv build
  • Publish package: uv publish

Run only one test

import pytest

@pytest.mark.only
async def my_test(self):
    # ... your code

And then run the tests with the marker only:

uv run scripts/test.py -m only

Other way is all in line:

uv run scripts/test.py <test_path>::<test_case>::<test_name>

License

The SDK is licensed under the LGPL-3.0 License - read the LICENSE file for details.

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

latitude_sdk-2.1.1.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

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

latitude_sdk-2.1.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file latitude_sdk-2.1.1.tar.gz.

File metadata

  • Download URL: latitude_sdk-2.1.1.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for latitude_sdk-2.1.1.tar.gz
Algorithm Hash digest
SHA256 8495aeb39301f2b4cbff2cc73f2cd52c9b7d4914f858373b67b391402ff1aa28
MD5 5c9ed9837c5b9e2671b52e04334bb2b1
BLAKE2b-256 d486ea5344ae1c3bd0de7ab715e90a7bbb5bfe550e90ab7f3e79fb2e935eb87b

See more details on using hashes here.

File details

Details for the file latitude_sdk-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for latitude_sdk-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3b52be64b98eba288a417668519d7e5723cf58166edf0cd9683e708f3d74a82
MD5 1043ad0117b6b323d41db0558709f276
BLAKE2b-256 f1996e7d8c4580236c28c3acedf0e96e649110c71c91084f06824c648c82f9d7

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