Skip to content

Commit

Permalink
token count correction according to AntonOsika#645 (AntonOsika#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
ATheorell authored and 70ziko committed Oct 25, 2023
1 parent d0f9caf commit 754f922
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gpt_engineer/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,12 @@ def next(

callsbacks = [StreamingStdOutCallbackHandler()]
response = self.llm(messages, callbacks=callsbacks) # type: ignore
messages.append(response)

logger.debug(f"Chat completion finished: {messages}")

self.update_token_usage_log(
messages=messages, answer=response.content, step_name=step_name
)
messages.append(response)
logger.debug(f"Chat completion finished: {messages}")

return messages

Expand Down

0 comments on commit 754f922

Please sign in to comment.