Skip to content

Commit

Permalink
pr cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoMcCabe committed Oct 26, 2023
1 parent ba3e6df commit 59b68a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gpt_engineer/core/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, model_name="gpt-4", temperature=0.1, azure_endpoint=""):
self.llm = self._create_chat_model()
self.token_usage_log = TokenUsageLog(model_name)

logger.debug(f"Using model {self.model_name} with llm {self.llm}")
logger.debug(f"Using model {self.model_name}")

def start(self, system: str, user: str, step_name: str) -> List[Message]:
"""
Expand Down
5 changes: 4 additions & 1 deletion tests/test_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def test_token_logging(monkeypatch):

# act
response_messages = ai.start("system prompt", "user prompt", "step name")
usageCostAfterStart = ai.token_usage_log.usage_cost()
ai.next(response_messages, "next user prompt", step_name="step name")
usageCostAfterNext = ai.token_usage_log.usage_cost()

# assert
assert ai.token_usage_log.usage_cost() > 0
assert usageCostAfterStart > 0
assert usageCostAfterNext > usageCostAfterStart

0 comments on commit 59b68a2

Please sign in to comment.