-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove frustrating / distracting logs
- Loading branch information
1 parent
9b451ec
commit e363ec4
Showing
10 changed files
with
306 additions
and
27 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,6 +1,3 @@ | ||
# sdk | ||
Python sdk for Synth | ||
# Synth Python SDK | ||
|
||
python -m build | ||
twine check dist/* | ||
twine upload dist/* | ||
Python SDK for Synth |
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,6 +1,6 @@ | ||
[project] | ||
name = "synth-sdk" | ||
version = "0.2.74" | ||
version = "0.2.75" | ||
description = "" | ||
authors = [{name = "Synth AI", email = "[email protected]"}] | ||
license = {text = "MIT"} | ||
|
@@ -20,6 +20,7 @@ dependencies = [ | |
"python-dotenv>=1.0.1", | ||
"langfuse>=2.53.9", | ||
"pytest>=8.3.3", | ||
"pydantic-openapi-schema>=1.5.1", | ||
] | ||
classifiers = [] | ||
|
||
|
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,30 @@ | ||
import logging | ||
|
||
class ExcludeLangfuseMessagesFilter(logging.Filter): | ||
def filter(self, record): | ||
# Return False to exclude the record, True to include it | ||
message = record.getMessage() | ||
excluded_messages = [ | ||
"No observation found in the current context", | ||
"No trace found in the current context", | ||
"Adding event to partition", | ||
] | ||
return not any(msg in message for msg in excluded_messages) | ||
|
||
|
||
# Configure root logger | ||
root_logger = logging.getLogger() | ||
root_logger.addFilter(ExcludeLangfuseMessagesFilter()) | ||
root_logger.setLevel(logging.ERROR) | ||
|
||
# Configure langfuse logger | ||
langfuse_logger = logging.getLogger("langfuse") | ||
langfuse_logger.addFilter(ExcludeLangfuseMessagesFilter()) | ||
langfuse_logger.setLevel(logging.CRITICAL) | ||
langfuse_logger.propagate = False | ||
|
||
# Also configure the synth_sdk logger | ||
synth_logger = logging.getLogger("synth_sdk") | ||
synth_logger.addFilter(ExcludeLangfuseMessagesFilter()) | ||
synth_logger.setLevel(logging.ERROR) | ||
synth_logger.propagate = False |
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
Oops, something went wrong.