Metadata-Version: 2.5
Name: goshikq-ai
Version: 1.0.1
Summary: Python SDK for Goshikq, the outcome-driven AI agent framework
Project-URL: Homepage, https://github.com/goshikavs/goshikq-agent-framework
Project-URL: Repository, https://github.com/goshikavs/goshikq-agent-framework
Project-URL: Documentation, https://goshikavs.github.io/goshikq-agent-framework/
Author: Venkatesh Goshika
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,llm,observability,verification
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.7
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.34; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: openai
Requires-Dist: openai>=1.40; extra == 'openai'
Description-Content-Type: text/markdown

# goshikq-ai (Python SDK)

Python SDK for [Goshikq](https://github.com/goshikavs/goshikq-agent-framework), the outcome-driven,
model-independent AI agent framework. The SDK declares agents, goals, and tool contracts; the
Goshikq Rust runtime owns execution, policy enforcement, persistence, and verification.

Status: package `1.0.1` is prepared in this branch and is **not on PyPI**. The published stable runtime remains GitHub Release `v1.0.0`. `v1.0.0-rc.1` is superseded due to its older JWT dependency. `v1.0.0-rc.2` remains published. Do not run `pip install goshikq-ai` until an owner publishes the package.

## Install

```bash
pip install -e ".[dev]"            # from sdk/python in the repo
pip install -e ".[openai]"         # optional provider adapters
pip install -e ".[anthropic]"
```

Requires a running Goshikq runtime (default `http://127.0.0.1:7400`, override with `GOSHIKQ_RUNTIME_URL`).

## Minimal example

```python
from goshikq_ai import Agent, Goal, Runtime, StateSnapshot, tool
from goshikq_ai.models import MockModel, ModelTurn

@tool(effect="read_only")
def lookup_order(order_id: str) -> dict:
    return {"order_id": order_id, "status": "paid"}

def order_was_looked_up(state: StateSnapshot) -> bool:
    return state.get("lookups") == 1

agent = Agent(
    name="hello-agent",
    model=MockModel(script=[ModelTurn(tool_calls=[("lookup_order", {"order_id": "A-1"})]), ModelTurn(content="done")]),
    tools=[lookup_order],
)
result = Runtime(agent, state_provider=...).run_sync(Goal(description="Look up order A-1", success=order_was_looked_up))
print(result.status, result.verification_status)
```

`result.verified` is `True` only when the runtime completed the run **and** the goal predicate held
against a fresh `StateSnapshot`. Without a state provider the run ends `UNVERIFIED`.

## Concepts

| Type | Purpose |
| --- | --- |
| `@tool(effect=..., risk=..., requires_approval=..., verifier=...)` | Action contract. `effect` drives retry safety in the runtime. |
| `Goal(description, success=, invariants=)` | Predicates evaluated by the runtime against authoritative state, never model claims. |
| `StateProvider` | Returns a `StateSnapshot` of the real system (DB, API) on request. |
| `Agent(name, model, tools)` | `model` is `"provider/model"` or a `ModelAdapter` (e.g. `MockModel`). |
| `Runtime(agent, state_provider=)` | Submits the run and serves worker requests until the run is terminal. |

## Development

```bash
pytest
ruff check src tests
mypy
```
