Skip to content

Commit 3532162

Browse files
Luke Alvoeirolukealvoeiro
Luke Alvoeiro
authored andcommitted
feat: upgrade ai-exchange to version 0.8.3 and fix tests (#34)
1 parent 8af8d76 commit 3532162

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[project]
22
name = "goose-ai"
33
description = "a programming agent that runs on your machine"
4-
version = "0.8.3"
4+
version = "0.8.4"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
88
"attrs>=23.2.0",
99
"rich>=13.7.1",
1010
"ruamel-yaml>=0.18.6",
11-
"ai-exchange>=0.8.2",
11+
"ai-exchange>=0.8.3",
1212
"click>=8.1.7",
1313
"prompt-toolkit>=3.0.47",
1414
]

src/goose/utils/ask.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from exchange import Exchange, Message
1+
from exchange import Exchange, Message, CheckpointData
22

33

44
def ask_an_ai(input: str, exchange: Exchange, prompt: str = "", no_history: bool = True) -> Message:
@@ -61,9 +61,9 @@ def clear_exchange(exchange: Exchange, clear_tools: bool = False) -> Exchange:
6161
6262
"""
6363
if clear_tools:
64-
new_exchange = exchange.replace(messages=[], checkpoints=[], tools=())
64+
new_exchange = exchange.replace(messages=[], checkpoint_data=CheckpointData(), tools=())
6565
else:
66-
new_exchange = exchange.replace(messages=[], checkpoints=[])
66+
new_exchange = exchange.replace(messages=[], checkpoint_data=CheckpointData())
6767
return new_exchange
6868

6969

tests/utils/test_ask.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from unittest.mock import MagicMock, patch
22

33
import pytest
4-
from exchange import Exchange
4+
from exchange import Exchange, CheckpointData
55
from goose.utils.ask import ask_an_ai, clear_exchange, replace_prompt
66

77

@@ -76,7 +76,7 @@ def test_clear_exchange_without_tools():
7676
new_exchange = clear_exchange(exchange, clear_tools=False)
7777

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

8282

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

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

9595

0 commit comments

Comments
 (0)