Skip to content

Commit 21a06c2

Browse files
committed
added documentation
1 parent 3b099d5 commit 21a06c2

4 files changed

Lines changed: 3396 additions & 2681 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `LiteLLM Compaction`
2+
3+
::: agents.extensions.sandbox.litellm_compaction
4+
options:
5+
members:
6+
- LiteLLMCompaction

docs/sandbox/guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ Built-in capabilities include:
202202

203203
By default, `SandboxAgent.capabilities` uses `Capabilities.default()`, which includes `Filesystem()`, `Shell()`, and `Compaction()`. If you pass `capabilities=[...]`, that list replaces the default, so include any default capabilities you still want.
204204

205+
`Compaction` sizes its dynamic policy from a built-in OpenAI-only context-window registry. If you route requests through litellm to a non-OpenAI model (Anthropic, Bedrock, Vertex, custom proxy aliases, ...), the lookup misses and the policy falls back to a static 240k threshold regardless of the model's real input window. For those deployments use [`LiteLLMCompaction`][agents.extensions.sandbox.litellm_compaction.LiteLLMCompaction] instead — it resolves the cap through `litellm.get_model_info()` and exposes `LiteLLMCompaction.for_model(...)` and `LiteLLMCompaction.for_context_window(...)` factories. Requires the `openai-agents[litellm]` extra.
206+
205207
For skills, choose the source based on how you want them materialized:
206208

207209
- `Skills(lazy_from=LocalDirLazySkillSource(...))` is a good default for larger local skill directories because the model can discover the index first and load only what it needs.

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ plugins:
186186
- Any-LLM provider: ref/extensions/models/any_llm_provider.md
187187
- LiteLLM model: ref/extensions/models/litellm_model.md
188188
- LiteLLM provider: ref/extensions/models/litellm_provider.md
189+
- Sandbox capabilities:
190+
- LiteLLM compaction: ref/extensions/sandbox/litellm_compaction.md
189191
- Tool output trimmer: ref/extensions/tool_output_trimmer.md
190192
- SQLAlchemySession: ref/extensions/memory/sqlalchemy_session.md
191193
- Async SQLite session: ref/extensions/memory/async_sqlite_session.md

0 commit comments

Comments
 (0)