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: 27 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `tws-py`
# `tws-sdk`

Python client for [TWS](https://www.tuneni.ai).

Expand All @@ -18,48 +18,46 @@ and returns the result.
### Synchronous Usage

```python
from tws import create_client
from tws import Client as TWSClient

# Create a client instance
client = create_client(
# Use the client with a context manager
with TWSClient(
public_key="your_public_key",
secret_key="your_secret_key",
api_url="your_api_url"
)

# Run a workflow and wait for completion
result = client.run_workflow(
workflow_definition_id="your_workflow_id",
workflow_args={
"param1": "value1",
"param2": "value2"
},
)
) as tws_client:
# Run a workflow and wait for completion
result = tws_client.run_workflow(
workflow_definition_id="your_workflow_id",
workflow_args={
"param1": "value1",
"param2": "value2"
},
)
```

### Asynchronous Usage

The signatures are exactly the same for async usage, but the client is created using `create_async_client` and client
The signatures are exactly the same for async usage, but the client class is `TWSAsyncClient` and client
methods are awaited.

```python
from tws import create_async_client
from tws import AsyncClient as TWSAsyncClient


async def main():
# Create an async client instance
client = await create_async_client(
# Use the async client with a context manager
async with TWSAsyncClient(
public_key="your_public_key",
secret_key="your_secret_key",
api_url="your_api_url"
)

# Run a workflow and wait for completion
result = await client.run_workflow(
workflow_definition_id="your_workflow_id",
workflow_args={
"param1": "value1",
"param2": "value2"
},
)
```
) as tws_client:
# Run a workflow and wait for completion
result = await tws_client.run_workflow(
workflow_definition_id="your_workflow_id",
workflow_args={
"param1": "value1",
"param2": "value2"
},
)
```
960 changes: 12 additions & 948 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages = [

[tool.poetry.dependencies]
python = "^3.9"
supabase = "^2.10.0"
httpx = {extras = ["http2"], version = ">=0.26,<0.29"}

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.4"
Expand Down
Loading
Loading