Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion autogen/logger/file_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@
) -> None:
"""Log a chat completion."""
thread_id = threading.get_ident()
source_name = source if isinstance(source, str) else source.name
source_name = (

Check warning on line 97 in autogen/logger/file_logger.py

View check run for this annotation

Codecov / codecov/patch

autogen/logger/file_logger.py#L97

Added line #L97 was not covered by tests
source
if isinstance(source, str)
else source.name
if hasattr(source, "name") and source.name is not None
else ""
)
try:
log_data = json.dumps(
{
Expand Down
8 changes: 7 additions & 1 deletion autogen/logger/sqlite_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,13 @@
else:
response_messages = json.dumps(to_dict(response), indent=4)

source_name = source if isinstance(source, str) else source.name
source_name = (

Check warning on line 278 in autogen/logger/sqlite_logger.py

View check run for this annotation

Codecov / codecov/patch

autogen/logger/sqlite_logger.py#L278

Added line #L278 was not covered by tests
source
if isinstance(source, str)
else source.name
if hasattr(source, "name") and source.name is not None
else ""
)

query = """
INSERT INTO chat_completions (
Expand Down
Loading