Skip to content

Commit e61d4f7

Browse files
docs: add file synchronization section to README (#74)
* docs: add file synchronization section to README * docs: fix typo in URL * docs: Improve structure of local file syncing section
1 parent 21f3e2f commit e61d4f7

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,48 @@ for chunk in response:
187187
yield chunk
188188
```
189189

190+
## Local File Development
191+
192+
Humanloop allows you to clone files from your Humanloop workspace to your local filesystem and use them in your code.
193+
194+
### Syncing Files with the CLI
195+
196+
```bash
197+
# Pull all files
198+
humanloop pull
199+
200+
# Pull from a directory
201+
humanloop pull --path="examples/chat"
202+
203+
# Pull a specific file
204+
humanloop pull --path="examples/chat/basic.prompt"
205+
206+
# Pull versions deployed to specific environment
207+
humanloop pull --environment="production"
208+
```
209+
210+
### Using Local Files in the SDK
211+
212+
To use local files in your code:
213+
214+
```python
215+
# Enable local file support
216+
client = Humanloop(
217+
api_key="YOUR_API_KEY",
218+
use_local_files=True
219+
)
220+
221+
# Use a local prompt file
222+
response = client.prompts.call(
223+
path="examples/chat/basic",
224+
inputs={"query": "Hello world"}
225+
)
226+
```
227+
228+
For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/prompts/syncing-files).
229+
230+
For information about the `.prompt` and `.agent` file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/prompt-and-agent-files).
231+
190232
## Pagination
191233

192234
Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
@@ -253,6 +295,7 @@ client.prompts.log(..., request_options={
253295

254296
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
255297
and transports.
298+
256299
```python
257300
import httpx
258301
from humanloop import Humanloop

0 commit comments

Comments
 (0)