You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-20Lines changed: 19 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ client.prompts.log(
45
45
),
46
46
provider_latency=6.5931549072265625,
47
47
output_message={
48
-
"content": "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it’s a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They’re unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it’s something big, very very big. Tremendous, in fact.",
48
+
"content": "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.",
49
49
"role": "assistant",
50
50
},
51
51
prompt_tokens=100,
@@ -92,7 +92,7 @@ async def main() -> None:
92
92
),
93
93
provider_latency=6.5931549072265625,
94
94
output_message={
95
-
"content": "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it’s a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They’re unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it’s something big, very very big. Tremendous, in fact.",
95
+
"content": "Well, you know, there is so much secrecy involved in government, folks, it's unbelievable. They don't want to tell you everything. They don't tell me everything! But about Roswell, it's a very popular question. I know, I just know, that something very, very peculiar happened there. Was it a weather balloon? Maybe. Was it something extraterrestrial? Could be. I'd love to go down and open up all the classified documents, believe me, I would. But they don't let that happen. The Deep State, folks, the Deep State. They're unbelievable. They want to keep everything a secret. But whatever the truth is, I can tell you this: it's something big, very very big. Tremendous, in fact.",
96
96
"role": "assistant",
97
97
},
98
98
prompt_tokens=100,
@@ -187,29 +187,26 @@ for chunk in response:
187
187
yield chunk
188
188
```
189
189
190
-
## Local File Development
190
+
## Store Humanloop Files in Code
191
191
192
-
Humanloop allows you to clone files from your Humanloop workspace to your local filesystem and use them in your code.
192
+
Humanloop allows you to maintain Prompts and Agents in your local filesystem and version control, while still leveraging Humanloop's prompt management capabilities.
humanloop pull # Pull all files to 'humanloop/' directory
199
+
humanloop pull --path="examples/chat"# Pull specific directory
200
+
humanloop pull --environment="production"# Pull from specific environment
201
+
humanloop pull --local-files-directory="ai"# Specify local destination (default: "humanloop")
202
+
203
+
# View available options
204
+
humanloop pull --help
208
205
```
209
206
210
207
### Using Local Files in the SDK
211
208
212
-
To use local files in your code:
209
+
To use local Files in your code:
213
210
214
211
```python
215
212
# Enable local file support
@@ -218,16 +215,18 @@ client = Humanloop(
218
215
use_local_files=True
219
216
)
220
217
221
-
#Use a local prompt file
218
+
#Call a local Prompt file
222
219
response = client.prompts.call(
223
-
path="examples/chat/basic",
220
+
path="examples/chat/basic",# Looks for humanloop/examples/chat/basic.prompt
224
221
inputs={"query": "Hello world"}
225
222
)
223
+
224
+
# The same path-based approach works with prompts.log(), agents.call(), and agents.log()
226
225
```
227
226
228
-
For detailed instructions on syncing, see our [Guide to Syncing and Using Local Files](https://humanloop.com/docs/v5/guides/prompts/store-prompts-in-code).
227
+
For detailed instructions, see our [Guide on Storing Files in Code](https://humanloop.com/docs/v5/guides/prompts/store-prompts-in-code).
229
228
230
-
For information about the `.prompt` and `.agent`file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/serialized-files).
229
+
For information about file formats, see our [File Format Reference](https://humanloop.com/docs/v5/reference/serialized-files).
0 commit comments