Skip to main content

A client library for accessing langfuse

Project description

Langfuse Python SDK

MIT License CI test status PyPI Version GitHub Repo stars Discord YC W23

pip install langfuse

Full documentation: https://docs.langfuse.com/sdk/python

Langchain documentation: https://docs.langfuse.com/langchain

Development

Add Poetry plugins

poetry self add poetry-dotenv-plugin
poetry self add poetry-bumpversion

Install dependencies

poetry install --all-extras

Add Pre-commit

poetry run pre-commit install

Tests

Setup

  • Add .env based on .env.example

Run

  • Run all
    poetry run pytest -s -v --log-cli-level=INFO
    
  • Run a specific test
    poetry run pytest -s -v --log-cli-level=INFO tests/test_sdk.py::test_flush
    
  • E2E tests involving OpenAI and Serp API are usually skipped, remove skip decorators in tests/test_langchain.py to run them.

Update openapi spec

  1. Generate Fern Python SDK in langfuse and copy the files generated in generated/python into the langfuse/api folder in this repo.
  2. Rebuild and deploy the package to PyPi.

Publish release

  1. poetry version patch
    • poetry version prepatch for pre-release versions
  2. poetry install
  3. poetry build
  4. git commit -am "chore: release v{version}"
  5. git push
  6. git tag v{version}
  7. git push --tags
  8. poetry publish
  9. Create a release on GitHub with the changelog

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

langfuse-1.13.2.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

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

langfuse-1.13.2-py3-none-any.whl (77.7 kB view details)

Uploaded Python 3

File details

Details for the file langfuse-1.13.2.tar.gz.

File metadata

  • Download URL: langfuse-1.13.2.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.0 Darwin/23.1.0

File hashes

Hashes for langfuse-1.13.2.tar.gz
Algorithm Hash digest
SHA256 3ada040076f2df2fda33ca696fbfa532ea486ff85e27e5eebeb71aba760a5770
MD5 37c9169d2edd84e3b72f8f615f5e97f4
BLAKE2b-256 aefe7fb323b2f4e0be45c08cdbc2049a70acfe045798c314ff0c4e1a5d717043

See more details on using hashes here.

File details

Details for the file langfuse-1.13.2-py3-none-any.whl.

File metadata

  • Download URL: langfuse-1.13.2-py3-none-any.whl
  • Upload date:
  • Size: 77.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.0 Darwin/23.1.0

File hashes

Hashes for langfuse-1.13.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f64b857f8985ab7f43519b55ad5fe11d57d0224bc18de4cdbfc9aa981600268d
MD5 017375e851d96a2ea7312a7f9109f529
BLAKE2b-256 4b0fb6f539e8b6e81cd3f3686c3548a8d9d444b2d940a7d6ad1587f802b9502e

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