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.
Files changed (35) hide show
  1. {goose_py-0.9.10 → goose_py-0.9.12}/PKG-INFO +1 -1
  2. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/task.py +3 -0
  3. {goose_py-0.9.10 → goose_py-0.9.12}/pyproject.toml +1 -1
  4. {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_refining.py +12 -0
  5. {goose_py-0.9.10 → goose_py-0.9.12}/uv.lock +1 -1
  6. {goose_py-0.9.10 → goose_py-0.9.12}/.envrc +0 -0
  7. {goose_py-0.9.10 → goose_py-0.9.12}/.github/workflows/publish.yml +0 -0
  8. {goose_py-0.9.10 → goose_py-0.9.12}/.gitignore +0 -0
  9. {goose_py-0.9.10 → goose_py-0.9.12}/.python-version +0 -0
  10. {goose_py-0.9.10 → goose_py-0.9.12}/.stubs/jsonpath_ng/__init__.pyi +0 -0
  11. {goose_py-0.9.10 → goose_py-0.9.12}/.stubs/litellm/__init__.pyi +0 -0
  12. {goose_py-0.9.10 → goose_py-0.9.12}/Makefile +0 -0
  13. {goose_py-0.9.10 → goose_py-0.9.12}/README.md +0 -0
  14. {goose_py-0.9.10 → goose_py-0.9.12}/goose/__init__.py +0 -0
  15. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/agent.py +0 -0
  16. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/conversation.py +0 -0
  17. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/flow.py +0 -0
  18. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/result.py +0 -0
  19. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/state.py +0 -0
  20. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/store.py +0 -0
  21. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/types/__init__.py +0 -0
  22. {goose_py-0.9.10 → goose_py-0.9.12}/goose/_internal/types/agent.py +0 -0
  23. {goose_py-0.9.10 → goose_py-0.9.12}/goose/agent.py +0 -0
  24. {goose_py-0.9.10 → goose_py-0.9.12}/goose/errors.py +0 -0
  25. {goose_py-0.9.10 → goose_py-0.9.12}/goose/flow.py +0 -0
  26. {goose_py-0.9.10 → goose_py-0.9.12}/goose/py.typed +0 -0
  27. {goose_py-0.9.10 → goose_py-0.9.12}/goose/runs.py +0 -0
  28. {goose_py-0.9.10 → goose_py-0.9.12}/goose/task.py +0 -0
  29. {goose_py-0.9.10 → goose_py-0.9.12}/tests/__init__.py +0 -0
  30. {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_agent.py +0 -0
  31. {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_downstream_task.py +0 -0
  32. {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_hashing.py +0 -0
  33. {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_looping.py +0 -0
  34. {goose_py-0.9.10 → goose_py-0.9.12}/tests/test_regenerate.py +0 -0
  35. {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.10
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)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "goose-py"
3
- version = "0.9.10"
3
+ version = "0.9.12"
4
4
  description = "A tool for AI workflows based on human-computer collaboration and structured output."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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
+ )
@@ -234,7 +234,7 @@ wheels = [
234
234
 
235
235
  [[package]]
236
236
  name = "goose-py"
237
- version = "0.9.10"
237
+ version = "0.9.12"
238
238
  source = { editable = "." }
239
239
  dependencies = [
240
240
  { name = "jsonpath-ng" },
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