Skip to content

Commit

Permalink
Update DirectClient docs for 0.0.55
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinb committed Nov 23, 2024
1 parent 707da55 commit 359effd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions docs/source/distributions/importing_as_library.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ print("\nChat completion response:")
print(response)
```

If you've created a [custom distribution](https://llama-stack.readthedocs.io/en/latest/distributions/building_distro.html), you can also import it with the `from_config` constructor:
If you've created a [custom distribution](https://llama-stack.readthedocs.io/en/latest/distributions/building_distro.html), you can also use the run.yaml configuration file directly:

```python
import yaml

with open(config_path, "r") as f:
config_dict = yaml.safe_load(f)

run_config = parse_and_maybe_upgrade_config(config_dict)

client = await LlamaStackDirectClient.from_config(run_config)
client = await LlamaStackDirectClient.from_config(config_path)
await client.initialize()
```

0 comments on commit 359effd

Please sign in to comment.