Metadata-Version: 2.4
Name: valmar
Version: 0.1.0
Summary: Python SDK for the Valmar platform
Project-URL: Homepage, https://docs.getvalmar.com
Project-URL: Documentation, https://docs.getvalmar.com
Project-URL: Source, https://github.com/TheValmarAI/valmar-python
Author: Valmar
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agents,enterprise-context,knowledge,sdk,valmar
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Provides-Extra: ai
Requires-Dist: pydantic-ai>=0.1; extra == 'ai'
Description-Content-Type: text/markdown

# valmar

Python SDK for the Valmar platform.

Documentation: https://docs.getvalmar.com

Source: https://github.com/TheValmarAI/valmar-python

License: Apache-2.0

## Installation

```bash
uv add valmar
```

## Quick start

```python
from valmar import Valmar

client = Valmar(
    api_key="valmr_proj_sk_...",
    base_url="https://your-valmar-deployment.example.com",
    organization_id="your-org-id",
    project_id="your-project-id",
)
```

`base_url` is required because Valmar is deployed per customer. Use the base URL for your own Valmar deployment.

## Search knowledge

Find relevant saved knowledge across the configured project.

```python
results = client.knowledge.search("deployment process")

for item in results.items:
    print(f"{item.title} ({item.confidence})")
    print(item.content_md)
```

## Create a knowledge request

Create a knowledge request that gets routed to the right people in your organization.

```python
handle = client.knowledge_requests.create(
    "How do we handle database migrations in production?",
    background_context="Planning a schema change for the orders table",
)

print(f"Request created: {handle.knowledge_request_id}")
print(f"Status: {handle.status}")

request = client.knowledge_requests.get(handle.knowledge_request_id)
if request.status == "completed":
    print(request.result_summary)
```

## List and import people

```python
from valmar import CreatePersonInput

people = client.people.list()

result = client.people.import_bulk(
    [
        CreatePersonInput(
            email="ada@example.com",
            display_name="Ada Lovelace",
            timezone="UTC",
            title="Principal Engineer",
        )
    ]
)
```

## Context manager

```python
with Valmar(
    api_key="valmr_proj_sk_...",
    base_url="https://your-valmar-deployment.example.com",
    organization_id="your-org-id",
    project_id="your-project-id",
) as client:
    results = client.knowledge.search("onboarding process")
```

## Error handling

The SDK raises `httpx.HTTPStatusError` for non-2xx responses.

```python
import httpx

try:
    client.knowledge.search("test")
except httpx.HTTPStatusError as e:
    print(f"API error {e.response.status_code}: {e.response.text}")
```
