Skip to content

Commit

Permalink
[CM-8933] introduce empty flush method for the llm sdk (#98)
Browse files Browse the repository at this point in the history
* Add flush method

* Fix lint errors
  • Loading branch information
alexkuzmik authored Nov 21, 2023
1 parent 69dbd7c commit 77d2ba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/comet_llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if config.comet_disabled():
from .dummy_api import Span, end_chain, log_prompt, start_chain # type: ignore
else:
from .api import log_user_feedback
from .api import flush, log_user_feedback
from .chains.api import end_chain, start_chain
from .chains.span import Span
from .prompts.api import log_prompt
Expand All @@ -32,6 +32,7 @@
"init",
"is_ready",
"log_user_feedback",
"flush",
]

logging.setup()
Expand Down
5 changes: 5 additions & 0 deletions src/comet_llm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ def log_user_feedback(id: str, score: float, api_key: Optional[str] = None) -> N
)

experiment_api.log_metric("user_feedback", score)


def flush() -> None:
"""Flush all data to Comet platform."""
pass

0 comments on commit 77d2ba9

Please sign in to comment.