goose-py 0.9.10__tar.gz → 0.9.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {goose_py-0.9.10 → goose_py-0.9.12}/PKG-INFO +1 -1
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/task.py +3 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/pyproject.toml +1 -1
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_refining.py +12 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/uv.lock +1 -1
- {goose_py-0.9.10 → goose_py-0.9.12}/.envrc +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/.github/workflows/publish.yml +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/.gitignore +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/.python-version +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/.stubs/jsonpath_ng/__init__.pyi +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/.stubs/litellm/__init__.pyi +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/Makefile +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/README.md +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/__init__.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/agent.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/conversation.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/flow.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/result.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/state.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/store.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/types/__init__.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/types/agent.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/agent.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/errors.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/flow.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/py.typed +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/runs.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/goose/task.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/__init__.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_agent.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_downstream_task.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_hashing.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_looping.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_regenerate.py +0 -0
- {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_state.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: goose-py
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.12
|
4
4
|
Summary: A tool for AI workflows based on human-computer collaboration and structured output.
|
5
5
|
Author-email: Nash Taylor <nash@chelle.ai>, Joshua Cook <joshua@chelle.ai>, Michael Sankur <michael@chelle.ai>
|
6
6
|
Requires-Python: >=3.12
|
@@ -56,6 +56,9 @@ class Task[**P, R: Result]:
|
|
56
56
|
flow_run = self.__get_current_flow_run()
|
57
57
|
node_state = flow_run.get(task=self, index=index)
|
58
58
|
|
59
|
+
if len(node_state.conversation.result_messages) == 0:
|
60
|
+
raise Honk("Cannot refine a task that has not been initially generated")
|
61
|
+
|
59
62
|
if context is not None:
|
60
63
|
node_state.set_context(context=context)
|
61
64
|
node_state.add_user_message(message=user_message)
|
@@ -7,6 +7,7 @@ from pytest_mock import MockerFixture
|
|
7
7
|
|
8
8
|
from goose import Agent, FlowArguments, Result, flow, task
|
9
9
|
from goose.agent import SystemMessage, TextMessagePart, UserMessage
|
10
|
+
from goose.errors import Honk
|
10
11
|
|
11
12
|
|
12
13
|
class MyFlowArguments(FlowArguments):
|
@@ -67,3 +68,14 @@ async def test_refining() -> None:
|
|
67
68
|
assert random_words[0].result.word == "__ADAPTED__" # adapted
|
68
69
|
assert random_words[1].result.word != "__ADAPTED__" # not adapted
|
69
70
|
assert random_words[2].result.word != "__ADAPTED__" # not adapted
|
71
|
+
|
72
|
+
|
73
|
+
@pytest.mark.asyncio
|
74
|
+
@pytest.mark.usefixtures("generate_random_word_adapter")
|
75
|
+
async def test_refining_before_generate_fails() -> None:
|
76
|
+
with pytest.raises(Honk):
|
77
|
+
async with sentence.start_run(run_id="2"):
|
78
|
+
await generate_random_word.refine(
|
79
|
+
user_message=UserMessage(parts=[TextMessagePart(text="Change it")]),
|
80
|
+
context=SystemMessage(parts=[TextMessagePart(text="Extra info")]),
|
81
|
+
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|