File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ response = edgee.send(
4242print (response.text) # Text content
4343print (response.finish_reason) # Finish reason
4444print (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
You can’t perform that action at this time.
0 commit comments