Code Monkey home page Code Monkey logo

langfuse-python's Introduction

Langfuse Python SDK

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

Installation

Important

The SDK was rewritten in v2 and released on December 17, 2023. Refer to the v2 migration guide for instructions on updating your code.

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. Execute the linter by running poetry run ruff format .
  3. 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

langfuse-python's People

Contributors

maxdeichmann avatar marcklingen avatar dependabot[bot] avatar dev-khant avatar hubert-springbok avatar brandonkzw avatar kobrinartem avatar hassiebp avatar hugomichard avatar richardkruemmel avatar rubms avatar yigitbey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.