Skip to content

Commit

Permalink
Merge branch 'main' into lalvoeiro/fix-resuming-sessions
Browse files Browse the repository at this point in the history
* main:
  feat: upgrade `ai-exchange` to version `0.8.3` and fix tests (#34)
  • Loading branch information
lukealvoeiro committed Sep 3, 2024
2 parents 35b3a4a + 3c930e1 commit a9f7bcf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[project]
name = "goose-ai"
description = "a programming agent that runs on your machine"
version = "0.8.3"
version = "0.8.4"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"attrs>=23.2.0",
"rich>=13.7.1",
"ruamel-yaml>=0.18.6",
"ai-exchange>=0.8.2",
"ai-exchange>=0.8.3",
"click>=8.1.7",
"prompt-toolkit>=3.0.47",
]
Expand Down
6 changes: 3 additions & 3 deletions src/goose/utils/ask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from exchange import Exchange, Message
from exchange import Exchange, Message, CheckpointData


def ask_an_ai(input: str, exchange: Exchange, prompt: str = "", no_history: bool = True) -> Message:
Expand Down Expand Up @@ -61,9 +61,9 @@ def clear_exchange(exchange: Exchange, clear_tools: bool = False) -> Exchange:
"""
if clear_tools:
new_exchange = exchange.replace(messages=[], checkpoints=[], tools=())
new_exchange = exchange.replace(messages=[], checkpoint_data=CheckpointData(), tools=())
else:
new_exchange = exchange.replace(messages=[], checkpoints=[])
new_exchange = exchange.replace(messages=[], checkpoint_data=CheckpointData())
return new_exchange


Expand Down
6 changes: 3 additions & 3 deletions tests/utils/test_ask.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from unittest.mock import MagicMock, patch

import pytest
from exchange import Exchange
from exchange import Exchange, CheckpointData
from goose.utils.ask import ask_an_ai, clear_exchange, replace_prompt


Expand Down Expand Up @@ -76,7 +76,7 @@ def test_clear_exchange_without_tools():
new_exchange = clear_exchange(exchange, clear_tools=False)

# Assert
exchange.replace.assert_called_once_with(messages=[], checkpoints=[])
exchange.replace.assert_called_once_with(messages=[], checkpoint_data=CheckpointData())
assert new_exchange == exchange.replace.return_value, "Should return the modified exchange"


Expand All @@ -89,7 +89,7 @@ def test_clear_exchange_with_tools():
new_exchange = clear_exchange(exchange, clear_tools=True)

# Assert
exchange.replace.assert_called_once_with(messages=[], checkpoints=[], tools=())
exchange.replace.assert_called_once_with(messages=[], checkpoint_data=CheckpointData(), tools=())
assert new_exchange == exchange.replace.return_value, "Should return the modified exchange with tools cleared"


Expand Down

0 comments on commit a9f7bcf

Please sign in to comment.