Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
PCSwingle committed Apr 11, 2024
1 parent 08f172d commit eb6420e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mentat/command/commands/talk.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ async def apply(self, *args: str) -> None:
response = await ctx.llm_api_handler.call_whisper_api(recorder.file)
ctx.stream.send(response.text, channel="default_prompt")
if response.cost:
ctx.stream.send(f"Whisper audio length and cost: {response.input_length}s, ${response.cost / 100:.2f}")
ctx.stream.send(
f"Whisper audio length and cost: {response.input_length:.2f}s, ${response.cost / 100:.2f}",
style="info",
)

@override
@classmethod
Expand Down
2 changes: 1 addition & 1 deletion mentat/llm_api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def display_cost_stats(self, response: SpiceResponse):

display = f"Speed: {response.characters_per_second:.2f} char/s"
if response.cost is not None:
display = f" | Cost: ${response.cost / 100:.2f}"
display += f" | Cost: ${response.cost / 100:.2f}"

costs_logger = logging.getLogger("costs")
costs_logger.info(display)
Expand Down

0 comments on commit eb6420e

Please sign in to comment.