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

Running only a specific test

Mark the test with an only marker:

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

Another way is to specify the test in line:

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

License

The SDK is licensed under the MIT 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-4.0.0b1.tar.gz (46.7 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-4.0.0b1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file latitude_sdk-4.0.0b1.tar.gz.

File metadata

  • Download URL: latitude_sdk-4.0.0b1.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.10

File hashes

Hashes for latitude_sdk-4.0.0b1.tar.gz
Algorithm Hash digest
SHA256 3b99e0575ba018cd1891bb7d54672e939250919baf80fa948d059c4d06cd2707
MD5 dec8f1b04cab7f13ce8d25d4968c4607
BLAKE2b-256 38125aefd034ff163586072f93e8210fb2a1c14202c4fecba19537d854a9945b

See more details on using hashes here.

File details

Details for the file latitude_sdk-4.0.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for latitude_sdk-4.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb51d0d429ff2918d8dd04d2031148a72c7fe8f681742ba5656fcb9aca8de15e
MD5 7c953438af0488b6058898a177eabffe
BLAKE2b-256 8dbc26b3badc1a354de205c92561060760d619725525a564e52c50605338c7d4

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