cellenium 0.3.2__tar.gz → 0.3.3__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.
- {cellenium-0.3.2 → cellenium-0.3.3}/PKG-INFO +1 -1
- {cellenium-0.3.2 → cellenium-0.3.3}/pyproject.toml +1 -1
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/crew.py +15 -2
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/api/vision.py +5 -3
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/e2e/test_google_search.py +4 -2
- cellenium-0.3.3/tests/test_vision_agent.py +37 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/test_vision_api.py +1 -1
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/bin/checklist.js +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/artifact.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/checklist/before-startup.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/checklist/cruising.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/checklist/fordec.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/checklist/landing.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/evaluator.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/executor.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/locator-writer.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/prd-reader.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/test-spec.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/web.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/commands/cellenium/writer.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/artifact/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/before-startup/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/cruising/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/emergency/fordec/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/evaluator/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/executor/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/landing/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/locator-writer/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/prd-reader/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/test-spec/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/web/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/cellenium/writer/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/checklist/before-startup/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/checklist/cruising/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/checklist/emergency/fordec/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/skills/checklist/landing/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.claude/test/install.test.js +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.env.example +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/.gitignore +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/LICENSE +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/README.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/config/agents.yaml +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/config/tasks.yaml +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/schemas.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/skills/evaluator/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/skills/vision/SKILL.md +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/tools/vision.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/config.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/tools/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/tools/image_encoder.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/api/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/cli.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/engine/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/engine/manager.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/engine/page_engine.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/functions/__init__.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/functions/locators.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/functions/logger.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/functions/sheets.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/settings.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/templates/env.template +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/e2e/conftest.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/test_cli.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/test_google_sheet_locators.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/test_page_engine.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/tests/test_settings.py +0 -0
- {cellenium-0.3.2 → cellenium-0.3.3}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: cellenium
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Playwright browser automation with a Google Sheets Page Object Model and CrewAI vision analysis
|
|
5
5
|
Project-URL: Homepage, https://github.com/MedviJenka/cellenium-playwright
|
|
6
6
|
License-File: LICENSE
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from asyncio import get_running_loop
|
|
2
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
1
3
|
from pathlib import Path
|
|
2
4
|
from cellenium.ai.config import AgentConfig
|
|
3
5
|
from crewai import Agent, Crew, Task
|
|
@@ -25,8 +27,19 @@ class Vision(AgentConfig):
|
|
|
25
27
|
return Crew(agents=self.agents, tasks=self.tasks, verbose=True)
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
def run_vision_agent(image: list[str], prompt: str) ->
|
|
29
|
-
|
|
30
|
+
def run_vision_agent(image: list[str], prompt: str) -> dict:
|
|
31
|
+
inputs = {'image': image, 'prompt': prompt}
|
|
32
|
+
|
|
33
|
+
def kickoff() -> dict:
|
|
34
|
+
return Vision().crew().kickoff(inputs).pydantic.model_dump()
|
|
35
|
+
|
|
36
|
+
try:
|
|
37
|
+
get_running_loop()
|
|
38
|
+
except RuntimeError:
|
|
39
|
+
return kickoff()
|
|
40
|
+
|
|
41
|
+
with ThreadPoolExecutor(max_workers=1) as executor:
|
|
42
|
+
return executor.submit(kickoff).result()
|
|
30
43
|
|
|
31
44
|
|
|
32
45
|
if __name__ == '__main__':
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from asyncio import to_thread
|
|
1
2
|
from fastapi import FastAPI, APIRouter, UploadFile, File
|
|
2
3
|
from fastapi.responses import JSONResponse
|
|
3
4
|
from contextlib import asynccontextmanager
|
|
@@ -6,13 +7,14 @@ from tempfile import NamedTemporaryFile
|
|
|
6
7
|
from typing import AsyncGenerator
|
|
7
8
|
from cellenium.ai.agents.vision.crew import run_vision_agent
|
|
8
9
|
from cellenium.functions.logger import Logger
|
|
9
|
-
from
|
|
10
|
+
from cellenium.settings import get_config
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
log = Logger(name='vision-service')
|
|
13
14
|
|
|
14
15
|
Config = get_config()
|
|
15
16
|
|
|
17
|
+
|
|
16
18
|
@asynccontextmanager
|
|
17
19
|
async def lifespan(_: FastAPI) -> AsyncGenerator:
|
|
18
20
|
log.fire(f'{log.name} service started')
|
|
@@ -31,7 +33,7 @@ async def vision(prompt: str, image: UploadFile = File(...)) -> JSONResponse:
|
|
|
31
33
|
temp_file.write(await image.read())
|
|
32
34
|
|
|
33
35
|
try:
|
|
34
|
-
response = run_vision_agent
|
|
36
|
+
response = await to_thread(run_vision_agent, prompt=prompt, image=[str(image_path)])
|
|
35
37
|
finally:
|
|
36
38
|
image_path.unlink(missing_ok=True)
|
|
37
39
|
|
|
@@ -64,4 +66,4 @@ def docs() -> JSONResponse:
|
|
|
64
66
|
|
|
65
67
|
if __name__ == '__main__':
|
|
66
68
|
import uvicorn
|
|
67
|
-
uvicorn.run(app=app, host='0.0.0.0', port=
|
|
69
|
+
uvicorn.run(app=app, host='0.0.0.0', port=8888, use_colors=True)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
from cellenium.ai.agents.vision.crew import run_vision_agent
|
|
2
3
|
from cellenium.engine.page_engine import PageEngine
|
|
3
4
|
from cellenium.functions.logger import Logger
|
|
4
5
|
|
|
@@ -13,5 +14,6 @@ class TestGoogleSearch:
|
|
|
13
14
|
engine.get_web("https://www.google.com")
|
|
14
15
|
engine.get_element("search").fill("cats")
|
|
15
16
|
engine.get_element("button").click()
|
|
16
|
-
engine.get_screenshot()
|
|
17
|
-
|
|
17
|
+
sc = engine.get_screenshot()
|
|
18
|
+
response = run_vision_agent(prompt='what is displayed?', image=[sc])
|
|
19
|
+
print(response)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from types import SimpleNamespace
|
|
3
|
+
|
|
4
|
+
from cellenium.ai.agents.vision import crew as vision_crew
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_run_vision_agent_moves_sync_kickoff_outside_active_event_loop(monkeypatch):
|
|
8
|
+
inputs = {"image": ["screenshot.png"], "prompt": "what is displayed?"}
|
|
9
|
+
expected = {"description": "search results"}
|
|
10
|
+
calls = []
|
|
11
|
+
|
|
12
|
+
class FakeCrew:
|
|
13
|
+
def kickoff(self, received_inputs: dict):
|
|
14
|
+
try:
|
|
15
|
+
asyncio.get_running_loop()
|
|
16
|
+
except RuntimeError:
|
|
17
|
+
calls.append(received_inputs)
|
|
18
|
+
return SimpleNamespace(
|
|
19
|
+
pydantic=SimpleNamespace(model_dump=lambda: expected)
|
|
20
|
+
)
|
|
21
|
+
raise RuntimeError(
|
|
22
|
+
"Agent execution was invoked synchronously from within a running event loop."
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
class FakeVision:
|
|
26
|
+
def crew(self):
|
|
27
|
+
return FakeCrew()
|
|
28
|
+
|
|
29
|
+
monkeypatch.setattr(vision_crew, "Vision", FakeVision)
|
|
30
|
+
|
|
31
|
+
async def invoke_from_running_loop():
|
|
32
|
+
return vision_crew.run_vision_agent(**inputs)
|
|
33
|
+
|
|
34
|
+
response = asyncio.run(invoke_from_running_loop())
|
|
35
|
+
|
|
36
|
+
assert response == expected
|
|
37
|
+
assert calls == [inputs]
|
|
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
|
|
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
|
{cellenium-0.3.2 → cellenium-0.3.3}/src/cellenium/ai/agents/vision/skills/evaluator/SKILL.md
RENAMED
|
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
|