Metadata-Version: 2.5
Name: viewport-context
Version: 0.1.0
Summary: Progressive skill and context loading for agents: a skills registry, tools bound only while their skill is loaded, context budgets and cache-friendly prompt assembly.
Project-URL: Homepage, https://getviewport.com
Project-URL: Documentation, https://docs.getviewport.com/context
Project-URL: Repository, https://github.com/viewportai/context
Project-URL: Issues, https://github.com/viewportai/context/issues
Author-email: Viewport <hello@getviewport.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,claude-agent-sdk,context,langgraph,openai-agents,prompt-caching,skills,tokens
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
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: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.7
Requires-Dist: viewport-core>=0.1.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=2.14; extra == 'anthropic'
Provides-Extra: claude-agent-sdk
Requires-Dist: claude-agent-sdk>=0.2.189; extra == 'claude-agent-sdk'
Provides-Extra: gemini
Requires-Dist: google-genai>=3.6; extra == 'gemini'
Provides-Extra: langgraph
Requires-Dist: langchain>=1.5.2; extra == 'langgraph'
Requires-Dist: langgraph>=1.2.24; extra == 'langgraph'
Provides-Extra: openai
Requires-Dist: openai>=3.59; extra == 'openai'
Provides-Extra: openai-agents
Requires-Dist: openai-agents>=0.26; extra == 'openai-agents'
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.27; extra == 'otel'
Provides-Extra: pydantic-ai
Requires-Dist: pydantic-ai-slim>=2.75; extra == 'pydantic-ai'
Provides-Extra: tiktoken
Requires-Dist: tiktoken>=0.14; extra == 'tiktoken'
Description-Content-Type: text/markdown

# viewport-context

Progressive skill loading and per-skill tool binding for agents (Python, import `viewportai.context`). The model starts
with a short catalog and one tool, `load_skill`; each skill's instructions and tools arrive only when it loads, inside a
token budget. The npm package `@viewportai/context` implements the same spec, pinned by shared conformance vectors.

```sh
pip install viewport-context   # or: uv add viewport-context
```

Python 3.11 or newer. To build from source, see https://github.com/viewportai/context#from-source.

```python
import asyncio

from tools import issue_refund, lookup_order, search_docs  # your core tools
from viewportai import context


async def main() -> None:
    skills = context.load_skills("skills", tools=[lookup_order, issue_refund, search_docs], budget=8_000)
    session = skills.session()
    print(session.prompt("My order A-1001 arrived damaged.").tool_names)  # ['load_skill']
    await session.call("load_skill", name="refunds")  # exactly what the model does
    print(session.prompt().tool_names)  # ['load_skill', 'lookup_order', 'issue_refund']


asyncio.run(main())
```

A skill's tools become callable in the next step, once a new prompt is built, so the model reads the instructions
first; a tool called in the same step as its skill's load is refused with a message to call it next step.

Adapters (extras): `viewportai.context.langgraph`, `.openai_agents`, `.claude_agent_sdk` (preview), `.pydantic_ai`,
`.anthropic`,
`.openai`; test helpers in `viewportai.context.testing` and pytest fixtures (`tmp_skills`, `skills`, `skill_events`).

Docs, examples and the design: https://github.com/viewportai/context. License: Apache-2.0.
