Skip to content

Commit

Permalink
Extra newline after token usage in llm logs -u
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Nov 20, 2024
1 parent 5dd618b commit 8de7bf2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion llm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ def logs_list(
json.loads(row["token_details"]) if row["token_details"] else None,
)
if token_usage:
click.echo("## Token usage:\n\n{}".format(token_usage))
click.echo("## Token usage:\n\n{}\n".format(token_usage))


@cli.group(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ def test_logs_text(log_path, usage):
"system\n\n"
"## Response:\n\n"
"response\n\n"
) + ("## Token usage:\n\n2 input, 5 output\n" if usage else "") + (
) + ("## Token usage:\n\n2 input, 5 output\n\n" if usage else "") + (
"# YYYY-MM-DDTHH:MM:SS conversation: abc123\n\n"
"Model: **davinci**\n\n"
"## Prompt:\n\n"
"prompt\n\n"
"## Response:\n\n"
"response\n\n"
) + (
"## Token usage:\n\n2 input, 5 output\n" if usage else ""
"## Token usage:\n\n2 input, 5 output\n\n" if usage else ""
) + (
"# YYYY-MM-DDTHH:MM:SS conversation: abc123\n\n"
"Model: **davinci**\n\n"
Expand All @@ -86,7 +86,7 @@ def test_logs_text(log_path, usage):
"## Response:\n\n"
"response\n\n"
) + (
"## Token usage:\n\n2 input, 5 output\n" if usage else ""
"## Token usage:\n\n2 input, 5 output\n\n" if usage else ""
)


Expand Down

0 comments on commit 8de7bf2

Please sign in to comment.