-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds decorator implementation (#425)
* feat: adds decorator implementation * fix tests * adds async and generation support * adds trycatch around wrapper operations * adds langfuse singleton * adds get_current_observation_id" * removes unused imports * refactor: exception handling * docs: make pep compliant * chore: v2.20.0a0 * fix: missing output if result is None * chore: renames methods to private * rename update methods * renames to observe and langfuse_context * adds scoring to decorators * adds public option to trace params * chore: v2.20.0a1 * chore: v2.20.0a2 * chore: v2.20.0a3 * add LangfuseDecorator to init to add it to docs * fix: make llama-index optional in decorators implementation * chore: v2.20.0a4 * fix: handle function args that are circular refs * feat: adds capture_io param * fix: remove wrong comments * chore: v2.20.0a5 * fix: handle tuples in serialization * chore: add pytest vscode support * remove self argument of instance methods from logging * split capture_io * adds support for returned generators * chore: update precommit hook to use ruff lint * adds public option to llamaindex trace params * refactor: async gen handling * adds decorator support for nested openai integration * add reset method to langfuse singleton * remove print statements * remove log_warning argument * chore: v2.20.2a3 * fixes resetting of observation params on multiple update calls * fix: allow observation scoring on trace level * fixes score test * feat: create wrapper trace if top level is generation --------- Co-authored-by: Max Deichmann <[email protected]>
- Loading branch information
1 parent
3880103
commit e92f305
Showing
17 changed files
with
2,040 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.2 | ||
hooks: | ||
- id: black | ||
# Run the linter and fix | ||
- id: ruff | ||
types_or: [ python, pyi, jupyter ] | ||
args: [ --fix, --config=ci.ruff.toml ] | ||
|
||
# Run the formatter. | ||
- id: ruff-format | ||
types_or: [ python, pyi, jupyter ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .langfuse_decorator import langfuse_context, observe, LangfuseDecorator | ||
|
||
__all__ = ["langfuse_context", "observe", "LangfuseDecorator"] |
Oops, something went wrong.