Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,65 @@ jobs:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
body: |
Release v${{ steps.version.outputs.version }} of predicate-sdk
Release v${{ steps.version.outputs.version }} of predicate-runtime

## Installation
```bash
pip install predicate-sdk==${{ steps.version.outputs.version }}
pip install predicate-runtime==${{ steps.version.outputs.version }}
```
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-compat-shim:
runs-on: ubuntu-latest
needs: build-and-publish

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Extract version from tag or input
id: version
run: |
if [ "${{ github.event_name }}" == "release" ]; then
VERSION=${GITHUB_REF#refs/tags/v}
VERSION=${VERSION#refs/tags/}
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Sync shim version and runtime dependency
run: |
VERSION="${{ steps.version.outputs.version }}"
SHIM_PYPROJECT="compat/predicate-sdk-shim/pyproject.toml"
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" "$SHIM_PYPROJECT"
sed -i "s/^ \"predicate-runtime==.*\",/ \"predicate-runtime==$VERSION\",/" "$SHIM_PYPROJECT"

- name: Build compatibility shim package
run: |
python -m build compat/predicate-sdk-shim -o dist-compat

- name: Check compatibility shim package
run: |
twine check dist-compat/*

- name: Publish compatibility shim to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist-compat/*
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
shell: bash
run: |
pip cache purge || true
pip uninstall -y predicate-sdk predicatelabs || true
pip uninstall -y predicate-runtime predicate-sdk predicatelabs || true
# Aggressively clean any bytecode cache (cross-platform Python approach)
python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]" || true
python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]" || true
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ The core loop is:
## Install

```bash
pip install predicate-sdk
pip install predicate-runtime
playwright install chromium
```

Legacy install compatibility remains available through the shim package:

```bash
pip install predicate-sdk
```

If you’re developing from source (this repo), install the local checkout instead:

```bash
Expand Down
10 changes: 10 additions & 0 deletions compat/predicate-sdk-shim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# predicate-sdk compatibility shim

This package exists to preserve install compatibility for users who still run:

```bash
pip install predicate-sdk
```

It depends on `predicate-runtime` and does not provide a separate runtime surface.
Use canonical imports from `predicate` in your code.
5 changes: 5 additions & 0 deletions compat/predicate-sdk-shim/predicate_sdk_shim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Compatibility marker package for predicate-sdk -> predicate-runtime."""

__all__ = ["__shim_target__"]

__shim_target__ = "predicate-runtime"
34 changes: 34 additions & 0 deletions compat/predicate-sdk-shim/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "predicate-sdk"
version = "1.1.0"
description = "Compatibility shim for predicate-runtime"
readme = "README.md"
requires-python = ">=3.11"
license = {text = "MIT OR Apache-2.0"}
authors = [
{name = "Sentience Team"}
]
dependencies = [
"predicate-runtime==1.1.0",
]
keywords = ["predicate", "runtime", "compatibility", "shim"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]

[project.urls]
Homepage = "https://github.com/Predicate-Labs/sdk-python"
Repository = "https://github.com/Predicate-Labs/sdk-python"
Issues = "https://github.com/Predicate-Labs/sdk-python/issues"

[tool.setuptools]
py-modules = ["predicate_sdk_shim"]
4 changes: 2 additions & 2 deletions examples/browser-use/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ This directory contains examples for integrating [Sentience](https://github.com/
Install both packages together using the optional dependency:

```bash
pip install "predicate-sdk[browser-use]"
pip install "predicate-runtime[browser-use]"
```

Or install separately:

```bash
pip install predicate-sdk browser-use
pip install predicate-runtime browser-use
```

## Quick Start
Expand Down
6 changes: 3 additions & 3 deletions examples/browser-use/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using Sentience's snapshot-based grounding instead of coordinate estimation.

Requirements:
pip install "predicate-sdk[browser-use]" python-dotenv
pip install "predicate-runtime[browser-use]" python-dotenv

Or install separately:
pip install predicate-sdk browser-use python-dotenv
pip install predicate-runtime browser-use python-dotenv

Usage:
python examples/browser-use/integration.py
Expand Down Expand Up @@ -240,7 +240,7 @@ async def example_with_sentience_context() -> None:
print("Extension path:", get_extension_dir())
print()
print("To run with a real browser:")
print(' 1. pip install "predicate-sdk[browser-use]" python-dotenv')
print(' 1. pip install "predicate-runtime[browser-use]" python-dotenv')
print(" 2. Uncomment the browser-use imports and code sections")
print(" 3. Run: python examples/browser-use/integration.py")

Expand Down
2 changes: 1 addition & 1 deletion examples/lang-chain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These examples show how to use Sentience as a **tool layer** inside LangChain an
Install:

```bash
pip install predicate-sdk[langchain]
pip install predicate-runtime[langchain]
```

Examples:
Expand Down
2 changes: 1 addition & 1 deletion examples/lang-chain/langchain_tools_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Example: Build Sentience LangChain tools (async-only).

Install:
pip install predicate-sdk[langchain]
pip install predicate-runtime[langchain]

Run:
python examples/lang-chain/langchain_tools_demo.py
Expand Down
2 changes: 1 addition & 1 deletion examples/lang-chain/langgraph_self_correcting_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
LangGraph reference example: Sentience observe → act → verify → branch (self-correcting).

Install:
pip install predicate-sdk[langchain]
pip install predicate-runtime[langchain]

Run:
python examples/lang-chain/langgraph_self_correcting_graph.py
Expand Down
2 changes: 1 addition & 1 deletion examples/langgraph/sentience_self_correcting_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
LangGraph reference example: Sentience observe → act → verify → branch (self-correcting).

Install:
pip install predicate-sdk[langchain]
pip install predicate-runtime[langchain]

Run:
python examples/langgraph/sentience_self_correcting_graph.py
Expand Down
2 changes: 1 addition & 1 deletion examples/pydantic_ai/pydantic_ai_self_correcting_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Example: PydanticAI + Sentience self-correcting action loop using URL guards.

Run:
pip install predicate-sdk[pydanticai]
pip install predicate-runtime[pydanticai]
python examples/pydantic_ai/pydantic_ai_self_correcting_click.py
"""

Expand Down
2 changes: 1 addition & 1 deletion examples/pydantic_ai/pydantic_ai_typed_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Example: PydanticAI + Sentience typed extraction (Phase 1 integration).

Run:
pip install predicate-sdk[pydanticai]
pip install predicate-runtime[pydanticai]
python examples/pydantic_ai/pydantic_ai_typed_extraction.py
"""

Expand Down
2 changes: 1 addition & 1 deletion predicate/integrations/browser_use/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def register_tools(self, tools: Any) -> None:
raise ImportError("browser_use.ActionResult/BrowserSession not available")
except Exception as e: # pragma: no cover
raise ImportError(
"browser-use is required to register tools. Install with `predicate-sdk[browser-use]`."
"browser-use is required to register tools. Install with `predicate-runtime[browser-use]`."
) from e

if tools is None:
Expand Down
2 changes: 1 addition & 1 deletion predicate/integrations/pydanticai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This module does NOT import `pydantic_ai` at import time so the base SDK can be
installed without the optional dependency. Users should install:

pip install predicate-sdk[pydanticai]
pip install predicate-runtime[pydanticai]

and then use `register_sentience_tools(...)` with a PydanticAI `Agent`.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "predicate-sdk"
name = "predicate-runtime"
version = "1.1.0"
description = "Python SDK for Sentience AI Agent Browser Automation"
readme = "README.md"
Expand Down
Loading