Skip to content

Commit 7066be0

Browse files
committed
docs: add compression field documentation to README
- Add example showing how to access compression data in responses - Add compression info to features list
1 parent 774142f commit 7066be0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ response = edgee.send(
4242
print(response.text) # Text content
4343
print(response.finish_reason) # Finish reason
4444
print(response.tool_calls) # Tool calls (if any)
45+
46+
# Access usage and compression info
47+
if response.usage:
48+
print(f"Tokens used: {response.usage.total_tokens}")
49+
50+
if response.compression:
51+
print(f"Input tokens: {response.compression.input_tokens}")
52+
print(f"Saved tokens: {response.compression.saved_tokens}")
53+
print(f"Compression rate: {response.compression.rate}")
4554
```
4655

4756
## Stream Method
@@ -64,6 +73,7 @@ for chunk in edgee.stream("gpt-4o", "Tell me a story"):
6473
-**Streaming** - Real-time response streaming with generators
6574
-**Tool calling** - Full support for function calling
6675
-**Flexible input** - Accept strings, dicts, or InputObject
76+
-**Compression info** - Access token compression metrics in responses
6777
-**Zero dependencies** - Uses only Python standard library
6878

6979
## Documentation

0 commit comments

Comments
 (0)