From 62703157186d14fed8661276f93faa916e426f5f Mon Sep 17 00:00:00 2001 From: Ale Pouroullis Date: Thu, 15 May 2025 14:30:07 +0100 Subject: [PATCH 1/3] docs: add file synchronization section to README --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 97779deb..5ee74256 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,44 @@ for chunk in response: yield chunk ``` +## File Synchronization + +Humanloop allows you to clone files from your Humanloop workspace to your local filesystem using the CLI. + +```bash +# Pull all files +humanloop pull + +# Pull from a directory +humanloop pull --path="examples/chat" + +# Pull a specific file +humanloop pull --path="examples/chat/basic.prompt" + +# Pull versions deployed to specific environment +humanloop pull --environment="production" +``` + +To use local files in your code: + +```python +# Enable local file support +client = Humanloop( + api_key="YOUR_API_KEY", + use_local_files=True +) + +# Use a local prompt file +response = client.prompts.call( + path="examples/chat/basic", # No file extension needed + inputs={"query": "Hello world"} +) +``` + +For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/propmts/syncing-local-files). + +For information about the `.prompt` and `.agent` file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/prompt-and-agent-files). + ## Pagination Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object. From 302b4f33a59c11c2894169f15c99f544fcba9cf0 Mon Sep 17 00:00:00 2001 From: Ale Pouroullis Date: Fri, 16 May 2025 15:48:45 +0100 Subject: [PATCH 2/3] docs: fix typo in URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ee74256..0cf4294a 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ response = client.prompts.call( ) ``` -For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/propmts/syncing-local-files). +For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/prompts/syncing-local-files). For information about the `.prompt` and `.agent` file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/prompt-and-agent-files). From 231a1ae95545bb79b8c77b06c754d93ff1c8495d Mon Sep 17 00:00:00 2001 From: Ale Pouroullis Date: Fri, 16 May 2025 15:59:22 +0100 Subject: [PATCH 3/3] docs: Improve structure of local file syncing section --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0cf4294a..bd504daa 100644 --- a/README.md +++ b/README.md @@ -187,9 +187,11 @@ for chunk in response: yield chunk ``` -## File Synchronization +## Local File Development -Humanloop allows you to clone files from your Humanloop workspace to your local filesystem using the CLI. +Humanloop allows you to clone files from your Humanloop workspace to your local filesystem and use them in your code. + +### Syncing Files with the CLI ```bash # Pull all files @@ -205,6 +207,8 @@ humanloop pull --path="examples/chat/basic.prompt" humanloop pull --environment="production" ``` +### Using Local Files in the SDK + To use local files in your code: ```python @@ -216,14 +220,14 @@ client = Humanloop( # Use a local prompt file response = client.prompts.call( - path="examples/chat/basic", # No file extension needed + path="examples/chat/basic", inputs={"query": "Hello world"} ) ``` -For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/prompts/syncing-local-files). +For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/prompts/syncing-files). -For information about the `.prompt` and `.agent` file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/prompt-and-agent-files). +For information about the `.prompt` and `.agent` file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/prompt-and-agent-files). ## Pagination @@ -291,6 +295,7 @@ client.prompts.log(..., request_options={ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies and transports. + ```python import httpx from humanloop import Humanloop