Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various. Fixes BT-12926,BT-10647,BT-12585 #1284

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
40 changes: 21 additions & 19 deletions docs/chains/doc_gen/API-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,32 +148,34 @@ Options to customize RPCs to dependency chainlets.

### `truss_chains.mark_entrypoint`


Decorator to mark a chainlet as the entrypoint of a chain.

This decorator can be applied to *one* chainlet in a source file and then the
CLI push command simplifies because only the file, but not the chainlet class
in the file, needs to be specified.
CLI push command simplifies: only the file, not the class within must be specified.

Optionally a display name for the Chain (not the Chainlet) can be set (effectively
giving a custom default value for the –name arg of the CLI push command).

Example usage:

```python
import truss_chains as chains


@chains.mark_entrypoint
class MyChainlet(ChainletBase):
...
```

**Parameters:**

| Name | Type | Description |
|-------|----------------------------------------------------------|---------------------|
| `cls` | *Type[[ChainletBase](#class-truss-chains-chainletbase)]* | The chainlet class. |
# OR with custom Chain name.
@chains.mark_entrypoint("My Chain Name")
class MyChainlet(ChainletBase):
...
```

* **Return type:**
*Type*[*ChainletBase*]


# Remote Configuration

These data structures specify for each chainlet how it gets deployed remotely, e.g. dependencies and compute resources.
Expand Down Expand Up @@ -609,19 +611,19 @@ Factory method, convenient to be used in chainlet’s `__init__`-method.
| `context` | *[DeploymentContext](#class-truss-chains-deploymentcontext)* | Deployment context object, obtained in the chainlet’s `__init__`. |
| `options` | *[RPCOptions](#class-truss-chains-rpcoptions)* | RPC options, e.g. retries. |

#### *async* predict_async(inputs: PydanticModel, output_model: Type[PydanticModel]) → PydanticModel

#### *async* predict_async(inputs: JSON, output_model: Type[PydanticModel]) → PydanticModel

#### *async* predict_async(inputs: JSON) → JSON

#### *async* predict_async_stream(inputs: PydanticModel | JSON) -> AsyncIterator[bytes]
#### Invocation Methods

#### predict_sync(inputs: PydanticModel, output_model: Type[PydanticModel]) → PydanticModel
* `async predict_async(inputs: PydanticModel, output_model: Type[PydanticModel]) → PydanticModel`
* `async predict_async(inputs: JSON, output_model: Type[PydanticModel]) →
PydanticModel`
* `async predict_async(inputs: JSON) → JSON`
* `async predict_async_stream(inputs: PydanticModel | JSON) -> AsyncIterator[bytes]`

#### predict_sync(inputs: JSON, output_model: Type[PydanticModel]) → PydanticModel
Deprecated synchronous methods:

#### predict_sync(inputs: JSON) → JSON
* `predict_sync(inputs: PydanticModel, output_model: Type[PydanticModel]) → PydanticModel`
* `predict_sync(inputs: JSON, output_model: Type[PydanticModel]) → PydanticModel`
* `predict_sync(inputs: JSON) → JSON`


### *class* `truss_chains.RemoteErrorDetail`
Expand Down
18 changes: 11 additions & 7 deletions docs/chains/doc_gen/generated-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,15 @@ Options to customize RPCs to dependency chainlets.

### `truss_chains.mark_entrypoint`

### `truss_chains.mark_entrypoint`

Decorator to mark a chainlet as the entrypoint of a chain.

This decorator can be applied to *one* chainlet in a source file and then the
CLI push command simplifies because only the file, but not the chainlet class
in the file, needs to be specified.
CLI push command simplifies: only the file, not the class within must be specified.

Optionally a display name for the Chain (not the Chainlet) can be set (effectively
giving a custom default value for the –name arg of the CLI push command).

Example usage:

Expand All @@ -178,12 +182,12 @@ import truss_chains as chains
@chains.mark_entrypoint
class MyChainlet(ChainletBase):
...
```

* **Parameters:**
**cls** (*Type* *[**ChainletT* *]*)
* **Return type:**
*Type*[*ChainletT*]
# OR with custom Chain name.
@chains.mark_entrypoint("My Chain Name")
class MyChainlet(ChainletBase):
...
```

# Remote Configuration

Expand Down
Loading