goose-py 0.11.10__tar.gz → 0.11.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 (34) hide show
  1. {goose_py-0.11.10 → goose_py-0.11.12}/PKG-INFO +2 -2
  2. {goose_py-0.11.10 → goose_py-0.11.12}/pyproject.toml +2 -2
  3. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_refining.py +25 -1
  4. {goose_py-0.11.10 → goose_py-0.11.12}/uv.lock +5 -5
  5. {goose_py-0.11.10 → goose_py-0.11.12}/.envrc +0 -0
  6. {goose_py-0.11.10 → goose_py-0.11.12}/.github/workflows/publish.yml +0 -0
  7. {goose_py-0.11.10 → goose_py-0.11.12}/.gitignore +0 -0
  8. {goose_py-0.11.10 → goose_py-0.11.12}/.python-version +0 -0
  9. {goose_py-0.11.10 → goose_py-0.11.12}/.stubs/jsonpath_ng/__init__.pyi +0 -0
  10. {goose_py-0.11.10 → goose_py-0.11.12}/Makefile +0 -0
  11. {goose_py-0.11.10 → goose_py-0.11.12}/README.md +0 -0
  12. {goose_py-0.11.10 → goose_py-0.11.12}/goose/__init__.py +0 -0
  13. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/agent.py +0 -0
  14. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/conversation.py +0 -0
  15. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/flow.py +0 -0
  16. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/result.py +0 -0
  17. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/state.py +0 -0
  18. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/store.py +0 -0
  19. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/task.py +0 -0
  20. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/types/__init__.py +0 -0
  21. {goose_py-0.11.10 → goose_py-0.11.12}/goose/_internal/types/telemetry.py +0 -0
  22. {goose_py-0.11.10 → goose_py-0.11.12}/goose/errors.py +0 -0
  23. {goose_py-0.11.10 → goose_py-0.11.12}/goose/flow.py +0 -0
  24. {goose_py-0.11.10 → goose_py-0.11.12}/goose/py.typed +0 -0
  25. {goose_py-0.11.10 → goose_py-0.11.12}/goose/runs.py +0 -0
  26. {goose_py-0.11.10 → goose_py-0.11.12}/goose/task.py +0 -0
  27. {goose_py-0.11.10 → goose_py-0.11.12}/tests/__init__.py +0 -0
  28. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_agent.py +0 -0
  29. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_ask.py +0 -0
  30. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_downstream_task.py +0 -0
  31. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_hashing.py +0 -0
  32. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_looping.py +0 -0
  33. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_regenerate.py +0 -0
  34. {goose_py-0.11.10 → goose_py-0.11.12}/tests/test_state.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: goose-py
3
- Version: 0.11.10
3
+ Version: 0.11.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
7
- Requires-Dist: aikernel==0.1.30
7
+ Requires-Dist: aikernel==0.1.32
8
8
  Requires-Dist: jsonpath-ng>=1.7.0
9
9
  Requires-Dist: pydantic>=2.8.2
10
10
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "goose-py"
3
- version = "0.11.10"
3
+ version = "0.11.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 = [
@@ -11,7 +11,7 @@ authors = [
11
11
  requires-python = ">=3.12"
12
12
  dependencies = [
13
13
  "jsonpath-ng>=1.7.0",
14
- "aikernel==0.1.30",
14
+ "aikernel==0.1.32",
15
15
  "pydantic>=2.8.2",
16
16
  ]
17
17
 
@@ -1,10 +1,13 @@
1
1
  import random
2
2
  import string
3
+ from unittest.mock import Mock
3
4
 
4
5
  import pytest
5
6
  from aikernel import LLMMessagePart, LLMSystemMessage, LLMUserMessage
7
+ from pytest_mock import MockerFixture
6
8
 
7
9
  from goose import Agent, FlowArguments, Result, flow, task
10
+ from goose._internal.result import FindReplaceResponse, Replacement
8
11
  from goose.errors import Honk
9
12
 
10
13
 
@@ -36,11 +39,32 @@ async def sentence(*, flow_arguments: MyFlowArguments, agent: Agent) -> None:
36
39
  await make_sentence(words=words)
37
40
 
38
41
 
42
+ @pytest.fixture
43
+ def mock_llm_structured(mocker: MockerFixture) -> Mock:
44
+ return mocker.patch(
45
+ "goose._internal.agent.llm_structured",
46
+ return_value=Mock(
47
+ structured_response=FindReplaceResponse(
48
+ replacements=[Replacement(find="a", replace="b")],
49
+ ),
50
+ usage=Mock(input_tokens=10, output_tokens=10),
51
+ ),
52
+ )
53
+
54
+
39
55
  @pytest.mark.asyncio
56
+ @pytest.mark.usefixtures("mock_llm_structured")
40
57
  async def test_refining() -> None:
41
- async with sentence.start_run(run_id="1") as first_run:
58
+ async with sentence.start_run(run_id="1"):
42
59
  await sentence.generate(MyFlowArguments())
43
60
 
61
+ async with sentence.start_run(run_id="1") as first_run:
62
+ await generate_random_word.refine(
63
+ index=0,
64
+ user_message=LLMUserMessage(parts=[LLMMessagePart(content="Change it")]),
65
+ context=LLMSystemMessage(parts=[LLMMessagePart(content="Extra info")]),
66
+ )
67
+
44
68
  initial_random_words = first_run.get_all_results(task=generate_random_word)
45
69
  assert len(initial_random_words) == 3
46
70
 
@@ -3,16 +3,16 @@ requires-python = ">=3.12"
3
3
 
4
4
  [[package]]
5
5
  name = "aikernel"
6
- version = "0.1.30"
6
+ version = "0.1.32"
7
7
  source = { registry = "https://pypi.org/simple" }
8
8
  dependencies = [
9
9
  { name = "litellm" },
10
10
  { name = "openai" },
11
11
  { name = "pydantic" },
12
12
  ]
13
- sdist = { url = "https://files.pythonhosted.org/packages/63/37/4588449d03f71080da26d83d82be2732165a26d03560754ba1b5d112be4b/aikernel-0.1.30.tar.gz", hash = "sha256:560d2c55d2a800ed6cec108e213f4f59373eddcb0b92c134c006a18cfcd6b090", size = 71528 }
13
+ sdist = { url = "https://files.pythonhosted.org/packages/7f/8a/f372bb5457ea3b19b8e84f49fa15288abdf56ca30af57ba15de7b0678a97/aikernel-0.1.32.tar.gz", hash = "sha256:8581034882ade6d18d1a78237101c8a3972004feb08ca2f212623ce63f6ebc86", size = 71876 }
14
14
  wheels = [
15
- { url = "https://files.pythonhosted.org/packages/7a/3a/e4811df7cef5f9e94afd1065c45152815d80621eb2c9b64a6f5239275a7e/aikernel-0.1.30-py3-none-any.whl", hash = "sha256:1c62b2af6725ec996345def23bce87fba884250d91f958051374cc6b78451a50", size = 8812 },
15
+ { url = "https://files.pythonhosted.org/packages/d1/90/3ef733ae865525a14d6bf12747d16312628edbf800b01e8944eb6b52084a/aikernel-0.1.32-py3-none-any.whl", hash = "sha256:6bdc9983602613aeb73e08f68180e857cc3df92d60029fb2f3c86fd2ae8f1206", size = 9262 },
16
16
  ]
17
17
 
18
18
  [[package]]
@@ -346,7 +346,7 @@ wheels = [
346
346
 
347
347
  [[package]]
348
348
  name = "goose-py"
349
- version = "0.11.10"
349
+ version = "0.11.12"
350
350
  source = { editable = "." }
351
351
  dependencies = [
352
352
  { name = "aikernel" },
@@ -366,7 +366,7 @@ dev = [
366
366
 
367
367
  [package.metadata]
368
368
  requires-dist = [
369
- { name = "aikernel", specifier = "==0.1.30" },
369
+ { name = "aikernel", specifier = "==0.1.32" },
370
370
  { name = "jsonpath-ng", specifier = ">=1.7.0" },
371
371
  { name = "pydantic", specifier = ">=2.8.2" },
372
372
  ]
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