oagi-core 0.9.0__tar.gz → 0.9.2__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 (109) hide show
  1. {oagi_core-0.9.0 → oagi_core-0.9.2}/Makefile +13 -8
  2. {oagi_core-0.9.0 → oagi_core-0.9.2}/PKG-INFO +4 -29
  3. {oagi_core-0.9.0 → oagi_core-0.9.2}/README.md +1 -28
  4. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/execute_task_manual.py +12 -12
  5. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/screenshot_with_config.py +3 -27
  6. {oagi_core-0.9.0 → oagi_core-0.9.2}/metapackage/pyproject.toml +2 -2
  7. oagi_core-0.9.2/metapackage/uv.lock +1471 -0
  8. {oagi_core-0.9.0 → oagi_core-0.9.2}/pyproject.toml +3 -1
  9. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/__init__.py +13 -16
  10. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/default.py +26 -10
  11. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/factories.py +5 -0
  12. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/tasker/planner.py +11 -2
  13. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/tasker/taskee_agent.py +45 -20
  14. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/tasker/tasker_agent.py +11 -7
  15. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/cli/agent.py +39 -21
  16. oagi_core-0.9.2/src/oagi/cli/display.py +56 -0
  17. oagi_core-0.9.2/src/oagi/cli/tracking.py +45 -0
  18. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/cli/utils.py +11 -4
  19. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/client/base.py +3 -7
  20. oagi_core-0.9.2/src/oagi/handler/__init__.py +24 -0
  21. oagi_core-0.9.2/src/oagi/handler/_macos.py +55 -0
  22. {oagi_core-0.9.0/src/oagi → oagi_core-0.9.2/src/oagi/handler}/async_pyautogui_action_handler.py +1 -1
  23. {oagi_core-0.9.0/src/oagi → oagi_core-0.9.2/src/oagi/handler}/async_screenshot_maker.py +1 -1
  24. {oagi_core-0.9.0/src/oagi → oagi_core-0.9.2/src/oagi/handler}/pil_image.py +2 -2
  25. {oagi_core-0.9.0/src/oagi → oagi_core-0.9.2/src/oagi/handler}/pyautogui_action_handler.py +14 -4
  26. {oagi_core-0.9.0/src/oagi → oagi_core-0.9.2/src/oagi/handler}/screenshot_maker.py +2 -2
  27. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/logging.py +8 -0
  28. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/config.py +3 -3
  29. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/models.py +1 -1
  30. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/socketio_server.py +1 -1
  31. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/task/__init__.py +10 -3
  32. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/task/async_.py +27 -2
  33. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/task/async_short.py +16 -4
  34. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/task/base.py +2 -0
  35. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/task/short.py +16 -4
  36. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/task/sync.py +27 -2
  37. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/__init__.py +2 -0
  38. oagi_core-0.9.2/src/oagi/types/step_observer.py +34 -0
  39. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/conftest.py +3 -3
  40. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_agent/test_default_agent.py +54 -13
  41. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_async_client.py +3 -2
  42. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_async_handlers.py +3 -3
  43. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_async_task.py +47 -45
  44. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_cli.py +4 -2
  45. oagi_core-0.9.2/tests/test_mac_double_click.py +105 -0
  46. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_pil_image.py +3 -3
  47. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_pyautogui_action_handler.py +18 -10
  48. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_short_task.py +1 -1
  49. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_sync_client.py +14 -6
  50. oagi_core-0.9.2/tests/test_task.py +427 -0
  51. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_taskee_agent.py +18 -16
  52. {oagi_core-0.9.0 → oagi_core-0.9.2}/uv.lock +6 -2
  53. oagi_core-0.9.0/examples/single_step.py +0 -19
  54. oagi_core-0.9.0/src/oagi/async_single_step.py +0 -85
  55. oagi_core-0.9.0/src/oagi/single_step.py +0 -87
  56. oagi_core-0.9.0/tests/test_single_step.py +0 -216
  57. oagi_core-0.9.0/tests/test_task.py +0 -423
  58. {oagi_core-0.9.0 → oagi_core-0.9.2}/.github/workflows/ci.yml +0 -0
  59. {oagi_core-0.9.0 → oagi_core-0.9.2}/.github/workflows/release.yml +0 -0
  60. {oagi_core-0.9.0 → oagi_core-0.9.2}/.gitignore +0 -0
  61. {oagi_core-0.9.0 → oagi_core-0.9.2}/.python-version +0 -0
  62. {oagi_core-0.9.0 → oagi_core-0.9.2}/CONTRIBUTING.md +0 -0
  63. {oagi_core-0.9.0 → oagi_core-0.9.2}/LICENSE +0 -0
  64. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/async_google_weather.py +0 -0
  65. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/continued_session.py +0 -0
  66. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/execute_task_auto.py +0 -0
  67. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/google_weather.py +0 -0
  68. {oagi_core-0.9.0 → oagi_core-0.9.2}/examples/hotel_booking.py +0 -0
  69. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/__init__.py +0 -0
  70. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/protocol.py +0 -0
  71. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/registry.py +0 -0
  72. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/tasker/__init__.py +0 -0
  73. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/tasker/memory.py +0 -0
  74. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/agent/tasker/models.py +0 -0
  75. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/cli/__init__.py +0 -0
  76. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/cli/main.py +0 -0
  77. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/cli/server.py +0 -0
  78. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/client/__init__.py +0 -0
  79. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/client/async_.py +0 -0
  80. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/client/sync.py +0 -0
  81. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/exceptions.py +0 -0
  82. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/__init__.py +0 -0
  83. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/agent_wrappers.py +0 -0
  84. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/main.py +0 -0
  85. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/server/session_store.py +0 -0
  86. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/action_handler.py +0 -0
  87. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/async_action_handler.py +0 -0
  88. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/async_image_provider.py +0 -0
  89. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/image.py +0 -0
  90. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/image_provider.py +0 -0
  91. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/models/__init__.py +0 -0
  92. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/models/action.py +0 -0
  93. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/models/client.py +0 -0
  94. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/models/image_config.py +0 -0
  95. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/models/step.py +0 -0
  96. {oagi_core-0.9.0 → oagi_core-0.9.2}/src/oagi/types/url_image.py +0 -0
  97. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/__init__.py +0 -0
  98. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_agent/test_agent_wrappers.py +0 -0
  99. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_agent_registry.py +0 -0
  100. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_logging.py +0 -0
  101. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_planner.py +0 -0
  102. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_planner_memory.py +0 -0
  103. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_screenshot_maker.py +0 -0
  104. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_server/__init__.py +0 -0
  105. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_server/test_config.py +0 -0
  106. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_server/test_session_store.py +0 -0
  107. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_server/test_socketio_integration.py +0 -0
  108. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_tasker_agent.py +0 -0
  109. {oagi_core-0.9.0 → oagi_core-0.9.2}/tests/test_url_image.py +0 -0
@@ -46,12 +46,17 @@ test-verbose: .uv install-dev
46
46
 
47
47
  .PHONY: version
48
48
  version:
49
- @if [ -z "$(VERSION)" ]; then \
50
- echo "Usage: make version VERSION=x.y.z"; \
51
- echo "Current version: $$(grep '^version = ' pyproject.toml | head -1 | cut -d'"' -f2)"; \
49
+ @if [ -n "$(filter-out $@,$(MAKECMDGOALS))" ]; then \
50
+ VERSION=$(filter-out $@,$(MAKECMDGOALS)); \
51
+ else \
52
+ echo "Usage: make version <version>"; \
52
53
  exit 1; \
53
- fi
54
- @echo "Updating version to $(VERSION) in all files..."
55
- @sed -i '' 's/^version = ".*"/version = "$(VERSION)"/' pyproject.toml
56
- @sed -i '' 's/^version = ".*"/version = "$(VERSION)"/' metapackage/pyproject.toml
57
- @sed -i '' 's/oagi-core\[desktop,server\]==.*/oagi-core[desktop,server]==$(VERSION)",/' metapackage/pyproject.toml
54
+ fi; \
55
+ echo "Updating version to $$VERSION..."; \
56
+ uv version $$VERSION; \
57
+ (cd metapackage && uv version $$VERSION); \
58
+ sed -i '' 's/oagi-core\[desktop,server\]==.*/oagi-core[desktop,server]=='$$VERSION'",/' metapackage/pyproject.toml; \
59
+ make build-all
60
+
61
+ %:
62
+ @:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: oagi-core
3
- Version: 0.9.0
3
+ Version: 0.9.2
4
4
  Summary: Official API of OpenAGI Foundation
5
5
  Project-URL: Homepage, https://github.com/agiopen-org/oagi
6
6
  Author-email: OpenAGI Foundation <contact@agiopen.org>
@@ -28,9 +28,11 @@ License: MIT License
28
28
  Requires-Python: >=3.10
29
29
  Requires-Dist: httpx>=0.28.0
30
30
  Requires-Dist: pydantic>=2.0.0
31
+ Requires-Dist: rich>=13.0.0
31
32
  Provides-Extra: desktop
32
33
  Requires-Dist: pillow>=11.3.0; extra == 'desktop'
33
34
  Requires-Dist: pyautogui>=0.9.54; extra == 'desktop'
35
+ Requires-Dist: pyobjc-framework-quartz>=9.0; (sys_platform == 'darwin') and extra == 'desktop'
34
36
  Provides-Extra: server
35
37
  Requires-Dist: fastapi[standard]>=0.115.0; extra == 'server'
36
38
  Requires-Dist: pydantic-settings>=2.0.0; extra == 'server'
@@ -75,22 +77,6 @@ export OAGI_API_KEY="your-api-key"
75
77
  export OAGI_BASE_URL="https://api.oagi.com" # or your server URL
76
78
  ```
77
79
 
78
- ### Single-Step Analysis
79
-
80
- Analyze a screenshot and get recommended actions:
81
-
82
- ```python
83
- from oagi import single_step
84
-
85
- step = single_step(
86
- task_description="Click the submit button",
87
- screenshot="screenshot.png" # or bytes, or Image object
88
- )
89
-
90
- print(f"Actions: {step.actions}")
91
- print(f"Complete: {step.is_complete}")
92
- ```
93
-
94
80
  ### Automated Task Execution
95
81
 
96
82
  Run tasks automatically with screenshot capture and action execution:
@@ -142,9 +128,6 @@ config = ImageConfig(
142
128
  height=700
143
129
  )
144
130
  compressed = image.transform(config)
145
-
146
- # Use with single_step
147
- step = single_step("Click button", screenshot=compressed)
148
131
  ```
149
132
 
150
133
  ### Async Support
@@ -153,16 +136,9 @@ Use async client for non-blocking operations and better concurrency:
153
136
 
154
137
  ```python
155
138
  import asyncio
156
- from oagi import async_single_step, AsyncShortTask
139
+ from oagi import AsyncShortTask
157
140
 
158
141
  async def main():
159
- # Single-step async analysis
160
- step = await async_single_step(
161
- "Find the search bar",
162
- screenshot="screenshot.png"
163
- )
164
- print(f"Found {len(step.actions)} actions")
165
-
166
142
  # Async task automation
167
143
  task = AsyncShortTask()
168
144
  async with task:
@@ -176,7 +152,6 @@ asyncio.run(main())
176
152
 
177
153
  See the [`examples/`](examples/) directory for more usage patterns:
178
154
  - `google_weather.py` - Basic task execution with `ShortTask`
179
- - `single_step.py` - Basic single-step inference
180
155
  - `screenshot_with_config.py` - Image compression and optimization
181
156
  - `execute_task_auto.py` - Automated task execution
182
157
  - `socketio_server_basic.py` - Socket.IO server example
@@ -35,22 +35,6 @@ export OAGI_API_KEY="your-api-key"
35
35
  export OAGI_BASE_URL="https://api.oagi.com" # or your server URL
36
36
  ```
37
37
 
38
- ### Single-Step Analysis
39
-
40
- Analyze a screenshot and get recommended actions:
41
-
42
- ```python
43
- from oagi import single_step
44
-
45
- step = single_step(
46
- task_description="Click the submit button",
47
- screenshot="screenshot.png" # or bytes, or Image object
48
- )
49
-
50
- print(f"Actions: {step.actions}")
51
- print(f"Complete: {step.is_complete}")
52
- ```
53
-
54
38
  ### Automated Task Execution
55
39
 
56
40
  Run tasks automatically with screenshot capture and action execution:
@@ -102,9 +86,6 @@ config = ImageConfig(
102
86
  height=700
103
87
  )
104
88
  compressed = image.transform(config)
105
-
106
- # Use with single_step
107
- step = single_step("Click button", screenshot=compressed)
108
89
  ```
109
90
 
110
91
  ### Async Support
@@ -113,16 +94,9 @@ Use async client for non-blocking operations and better concurrency:
113
94
 
114
95
  ```python
115
96
  import asyncio
116
- from oagi import async_single_step, AsyncShortTask
97
+ from oagi import AsyncShortTask
117
98
 
118
99
  async def main():
119
- # Single-step async analysis
120
- step = await async_single_step(
121
- "Find the search bar",
122
- screenshot="screenshot.png"
123
- )
124
- print(f"Found {len(step.actions)} actions")
125
-
126
100
  # Async task automation
127
101
  task = AsyncShortTask()
128
102
  async with task:
@@ -136,7 +110,6 @@ asyncio.run(main())
136
110
 
137
111
  See the [`examples/`](examples/) directory for more usage patterns:
138
112
  - `google_weather.py` - Basic task execution with `ShortTask`
139
- - `single_step.py` - Basic single-step inference
140
113
  - `screenshot_with_config.py` - Image compression and optimization
141
114
  - `execute_task_auto.py` - Automated task execution
142
115
  - `socketio_server_basic.py` - Socket.IO server example
@@ -7,20 +7,20 @@
7
7
  # -----------------------------------------------------------------------------
8
8
 
9
9
  from oagi import (
10
+ Actor,
11
+ AsyncActor,
10
12
  AsyncPyautoguiActionHandler,
11
13
  AsyncScreenshotMaker,
12
- AsyncTask,
13
14
  PyautoguiActionHandler,
14
15
  ScreenshotMaker,
15
- Task,
16
16
  )
17
17
 
18
18
 
19
19
  def execute_task_manual(task_desc, max_steps=5):
20
20
  # set OAGI_API_KEY and OAGI_BASE_URL
21
- # or ShortTask(api_key="your_api_key", base_url="your_base_url")
22
- task = Task()
23
- task.init_task(task_desc, max_steps=max_steps)
21
+ # or Actor(api_key="your_api_key", base_url="your_base_url")
22
+ actor = Actor()
23
+ actor.init_task(task_desc, max_steps=max_steps)
24
24
  executor = (
25
25
  PyautoguiActionHandler()
26
26
  ) # executor = lambda actions: print(actions) for debugging
@@ -36,8 +36,8 @@ def execute_task_manual(task_desc, max_steps=5):
36
36
  image = image_provider()
37
37
 
38
38
  # For additional instructions
39
- # step = task.step(image, instruction="some instruction")
40
- step = task.step(image)
39
+ # step = actor.step(image, instruction="some instruction")
40
+ step = actor.step(image)
41
41
 
42
42
  # do something with step, maybe print to debug
43
43
  print(f"Step {i}: {step.reason=}")
@@ -60,9 +60,9 @@ def execute_task_manual(task_desc, max_steps=5):
60
60
 
61
61
  async def async_execute_task_manual(task_desc, max_steps=5):
62
62
  # set OAGI_API_KEY and OAGI_BASE_URL
63
- # or ShortTask(api_key="your_api_key", base_url="your_base_url")
64
- async with AsyncTask() as task:
65
- await task.init_task(task_desc, max_steps=max_steps)
63
+ # or AsyncActor(api_key="your_api_key", base_url="your_base_url")
64
+ async with AsyncActor() as actor:
65
+ await actor.init_task(task_desc, max_steps=max_steps)
66
66
  executor = AsyncPyautoguiActionHandler()
67
67
 
68
68
  # by default, screenshot will be resized to 1260 * 700 and jpeg with quality 85
@@ -76,8 +76,8 @@ async def async_execute_task_manual(task_desc, max_steps=5):
76
76
  image = await image_provider()
77
77
 
78
78
  # For additional instructions
79
- # step = task.step(image, instruction="some instruction")
80
- step = await task.step(image)
79
+ # step = actor.step(image, instruction="some instruction")
80
+ step = await actor.step(image)
81
81
 
82
82
  # do something with step, maybe print to debug
83
83
  print(f"Step {i}: {step.reason=}")
@@ -6,7 +6,7 @@
6
6
  # Licensed under the MIT License.
7
7
  # -----------------------------------------------------------------------------
8
8
 
9
- from oagi import ImageConfig, PILImage, ScreenshotMaker, single_step
9
+ from oagi import ImageConfig, PILImage, ScreenshotMaker
10
10
 
11
11
 
12
12
  def example_full_png_screenshot():
@@ -53,33 +53,9 @@ def example_load_and_compress(file_name):
53
53
  return compressed_image
54
54
 
55
55
 
56
- def example_with_single_step(file_name):
57
- """Example 3: Use compressed image with single_step."""
58
- print("\nExample 3: Use with single_step")
59
-
60
- # Load and compress image
61
- image = PILImage.from_file(file_name)
62
- print(f"Original image dimensions: {image.image.size}")
63
-
64
- config = ImageConfig(format="JPEG", quality=85, width=1260, height=700)
65
- compressed = image.transform(config)
66
- print(f"Compressed image dimensions: {compressed.image.size}")
67
-
68
- # Use with single_step
69
- step = single_step(
70
- task_description="Click the submit button",
71
- screenshot=compressed,
72
- api_key="your-api-key-here",
73
- base_url="http://127.0.0.1:8000",
74
- )
75
-
76
- print(f"Task complete: {step.is_complete}")
77
- return step
78
-
79
-
80
56
  def example_default_config():
81
- """Example 4: Default configuration (1260x700 JPEG with 85 quality)."""
82
- print("\nExample 4: Default configuration")
57
+ """Example 3: Default configuration (1260x700 JPEG with 85 quality)."""
58
+ print("\nExample 3: Default configuration")
83
59
 
84
60
  default_maker = ScreenshotMaker() # Uses default ImageConfig
85
61
  default_screenshot = default_maker()
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "oagi"
7
- version = "0.9.0"
7
+ version = "0.9.2"
8
8
  description = "Official API of OpenAGI Foundation (metapackage with all features)"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -16,7 +16,7 @@ authors = [
16
16
  requires-python = ">= 3.10"
17
17
 
18
18
  dependencies = [
19
- "oagi-core[desktop,server]==0.9.0",
19
+ "oagi-core[desktop,server]==0.9.2",
20
20
  ]
21
21
 
22
22
  [project.urls]