Skip to content

Commit

Permalink
Fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-baseten committed Dec 12, 2024
1 parent f72461d commit 886d0b9
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 121 deletions.
12 changes: 6 additions & 6 deletions docs/chains/doc_gen/API-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ an access token for downloading model weights).

**Parameters:**

| Name | Type | Description |
|-----------------------|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `data_dir` | *Path\|None* | The directory where the chainlet can store and access data, e.g. for downloading model weights. |
| `chainlet_to_service` | *Mapping[str,[DeployedServiceDescriptor](#class-truss-chains-deployedservicedescriptor)]]* | A mapping from chainlet names to service descriptors. This is used create RPCs sessions to dependency chainlets. It contains only the chainlet services that are dependencies of the current chainlet. |
| `secrets` | *Mapping[str,str]* | A mapping from secret names to secret values. It contains only the secrets that are listed in `remote_config.assets.secret_keys` of the current chainlet. |
| `environment` | *[Environment](#class-truss-chains-definitions-environment)\|None* | The environment that the chainlet is deployed in. None if the chainlet is not associated with an environment. |
| Name | Type | Description |
|-----------------------|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `data_dir` | *Path\|None* | The directory where the chainlet can store and access data, e.g. for downloading model weights. |
| `chainlet_to_service` | *Mapping[str,[DeployedServiceDescriptor](#class-truss-chains-deployedservicedescriptor)]]* | A mapping from chainlet names to service descriptors. This is used to create RPC sessions to dependency chainlets. It contains only the chainlet services that are dependencies of the current chainlet. |
| `secrets` | *Mapping[str,str]* | A mapping from secret names to secret values. It contains only the secrets that are listed in `remote_config.assets.secret_keys` of the current chainlet. |
| `environment` | *[Environment](#class-truss-chains-definitions-environment)\|None* | The environment that the chainlet is deployed in. None if the chainlet is not associated with an environment. |

#### get_baseten_api_key()

Expand Down
19 changes: 17 additions & 2 deletions docs/chains/doc_gen/generated-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ https://github.com/basetenlabs/truss/tree/main/docs/chains/doc_gen

APIs for creating user-defined Chainlets.


### *class* `truss_chains.ChainletBase`

Base class for all chainlets.
Expand Down Expand Up @@ -70,6 +71,7 @@ context instance is provided.
* **Return type:**
[*DeploymentContext*](#truss_chains.DeploymentContext)


### *class* `truss_chains.DeploymentContext`

Bases: `pydantic.BaseModel`
Expand All @@ -86,7 +88,7 @@ an access token for downloading model weights).
| Name | Type | Description |
|------|------|-------------|
| `data_dir` | *Path\|None* | The directory where the chainlet can store and access data, e.g. for downloading model weights. |
| `chainlet_to_service` | *Mapping[str,[DeployedServiceDescriptor](#truss_chains.DeployedServiceDescriptor* | A mapping from chainlet names to service descriptors. This is used create RPCs sessions to dependency chainlets. It contains only the chainlet services that are dependencies of the current chainlet. |
| `chainlet_to_service` | *Mapping[str,[DeployedServiceDescriptor](#truss_chains.DeployedServiceDescriptor* | A mapping from chainlet names to service descriptors. This is used to create RPC sessions to dependency chainlets. It contains only the chainlet services that are dependencies of the current chainlet. |
| `secrets` | *MappingNoIter[str,str]* | A mapping from secret names to secret values. It contains only the secrets that are listed in `remote_config.assets.secret_keys` of the current chainlet. |
| `environment` | *[Environment](#truss_chains.definitions.Environment* | The environment that the chainlet is deployed in. None if the chainlet is not associated with an environment. |

Expand All @@ -110,6 +112,7 @@ an access token for downloading model weights).

#### secrets *: MappingNoIter[str, str]*


### *class* `truss_chains.definitions.Environment`

Bases: `pydantic.BaseModel`
Expand All @@ -120,6 +123,7 @@ The environment the chainlet is deployed in.
**name** (*str*) – The name of the environment.
#### name *: str*


### *class* `truss_chains.ChainletOptions`

Bases: `pydantic.BaseModel`
Expand All @@ -136,6 +140,7 @@ Bases: `pydantic.BaseModel`

#### env_variables *: Mapping[str, str]*


### *class* `truss_chains.RPCOptions`

Bases: `pydantic.BaseModel`
Expand Down Expand Up @@ -184,6 +189,7 @@ class MyChainlet(ChainletBase):

These data structures specify for each chainlet how it gets deployed remotely, e.g. dependencies and compute resources.


### *class* `truss_chains.RemoteConfig`

Bases: `pydantic.BaseModel`
Expand Down Expand Up @@ -237,6 +243,7 @@ class MyChainlet(chains.ChainletBase):

#### options *: [ChainletOptions](#truss_chains.ChainletOptions)*


### *class* `truss_chains.DockerImage`

Bases: `pydantic.BaseModel`
Expand Down Expand Up @@ -275,6 +282,7 @@ modules and keep their requirement files right next their python source files.

#### pip_requirements_file *: AbsPath | None*


### *class* `truss_chains.BasetenImage`

Bases: `Enum`
Expand All @@ -288,6 +296,7 @@ uses GPUs, drivers will be included in the image.

#### PY39 *= 'py39'*


### *class* `truss_chains.CustomImage`

Bases: `pydantic.BaseModel`
Expand All @@ -309,6 +318,7 @@ Configures the usage of a custom image hosted on dockerhub.

#### python_executable_path *: str | None*


### *class* `truss_chains.Compute`

Specifies which compute resources a chainlet has in the *remote* deployment.
Expand Down Expand Up @@ -347,6 +357,7 @@ two ways:
* **Return type:**
*ComputeSpec*


### *class* `truss_chains.Assets`

Specifies which assets a chainlet can access in the remote deployment.
Expand Down Expand Up @@ -416,6 +427,7 @@ Deploys a chain remotely (with all dependent chainlets).
* **Return type:**
*BasetenChainService*


### *class* `truss_chains.deployment.deployment_client.ChainService`

Bases: `ABC`
Expand Down Expand Up @@ -578,6 +590,7 @@ if __name__ == "__main__":
Refer to the [local debugging guide](https://docs.baseten.co/chains/guide#test-a-chain-locally)
for more details.


### *class* `truss_chains.DeployedServiceDescriptor`

Bases: `ServiceDescriptor`
Expand All @@ -594,6 +607,7 @@ Bases: `ServiceDescriptor`

#### predict_url *: str*


### *class* `truss_chains.StubBase`

Bases: `BasetenSession`, `ABC`
Expand All @@ -611,12 +625,12 @@ flexibly supports JSON and pydantic inputs and output. Example usage:
import pydantic
import truss_chains as chains
class WhisperOutput(pydantic.BaseModel):
...
class DeployedWhisper(chains.StubBase):
# Input JSON, output JSON.
async def run_remote(self, audio_b64: str) -> Any:
return await self.predict_async(
Expand Down Expand Up @@ -685,6 +699,7 @@ Factory method, convenient to be used in chainlet’s `__init__`-method.

#### predict_sync(inputs: InputT, output_model: None = None) → Any


### *class* `truss_chains.RemoteErrorDetail`

Bases: `pydantic.BaseModel`
Expand Down
Loading

0 comments on commit 886d0b9

Please sign in to comment.