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
{{ message }}
Repository navigation
Commit ef7df4d
Browse filesBrowse the repository at this point in the historyBrowse files
Rust, Python and TypeScript clients gain with_reason / withReason, a derived client that sends the percent-encoded Everruns-Change-Reason header so the server records the reason in entity change history. Blank reasons send no header; the original client is unchanged.
Record why a change was made. `with_reason` derives a client that sends the
125
+
reason with every request it makes; the server stores it in the changed
126
+
entity's history. The derived client shares the original's connection, and the
127
+
original stays unchanged:
128
+
129
+
```python
130
+
await client.with_reason("retire the unused agent").agents.delete("agent_123")
131
+
132
+
scoped = client.with_reason("rotate prompts for the Q3 launch")
133
+
await scoped.agents.apply(agent_id, "assistant", "You are concise.")
134
+
```
135
+
136
+
The reason travels in the `Everruns-Change-Reason` header, UTF-8
137
+
percent-encoded. A blank reason sends no header. The server trims the reason and rejects it with HTTP 400 (`invalid_change_reason`) when it is longer than 1000 characters, contains control characters other than newline and tab, or looks like it contains a credential. Closing a derived
Copy file name to clipboardExpand all lines: rust/README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,27 @@ let client = Everruns::builder()
191
191
.build()?;
192
192
```
193
193
194
+
## Change Reasons
195
+
196
+
Record why a change was made. `with_reason` derives a client that sends the
197
+
reason with every request it makes; the server stores it in the changed
198
+
entity's history. The derived client shares the original's connection pool, and
199
+
the original stays unchanged:
200
+
201
+
```rust
202
+
client
203
+
.with_reason("retire the unused agent")
204
+
.agents()
205
+
.delete("agent_123")
206
+
.await?;
207
+
208
+
letscoped=client.with_reason("rotate prompts for the Q3 launch");
209
+
scoped.agents().apply(&id, "assistant", "You are concise.").await?;
210
+
```
211
+
212
+
The reason travels in the `Everruns-Change-Reason` header, UTF-8
213
+
percent-encoded. A blank reason sends no header. The server trims the reason and rejects it with HTTP 400 (`invalid_change_reason`) when it is longer than 1000 characters, contains control characters other than newline and tab, or looks like it contains a credential.
214
+
194
215
## Streaming Events
195
216
196
217
The SDK supports SSE streaming with automatic reconnection:
0 commit comments