Recompile Conversation
Manually trigger system prompt recompilation for a conversation.
ParametersExpand Collapse
conversation_id: str
The conversation identifier. Can be a conversation ID (‘conv-
agent_id: Optional[str]
Agent ID for agent-direct mode with ‘default’ conversation. Use with conversation_id=‘default’ in the URL path.
Configuration for conversation compaction / summarization.
Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle.
clip_chars: Optional[int]
The maximum length of the summary in characters. If none, no clipping is performed.
model: Optional[str]
Model handle to use for sliding_window/all summarization (format: provider/model-name). If None, uses lightweight provider-specific defaults.
model_settings: Optional[CompactionSettingsModelSettings]
Optional model settings used to override defaults for the summarizer model.
class OpenAIModelSettings: …
response_format: Optional[ResponseFormat]
class CompactionSettingsModelSettingsSgLangModelSettings: …
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
response_format: Optional[CompactionSettingsModelSettingsSgLangModelSettingsResponseFormat]
class AnthropicModelSettings: …
response_format: Optional[ResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GoogleAIModelSettings: …
class GoogleVertexModelSettings: …
class AzureModelSettings: …
class XaiModelSettings: …
class CompactionSettingsModelSettingsMoonshotModelSettings: …
Moonshot/Kimi model configuration (OpenAI-compatible).
response_format: Optional[CompactionSettingsModelSettingsMoonshotModelSettingsResponseFormat]
class CompactionSettingsModelSettingsZaiModelSettings: …
Z.ai (ZhipuAI) model configuration (OpenAI-compatible).
class CompactionSettingsModelSettingsMoonshotCodingModelSettings: …
Kimi Code model configuration (Anthropic-compatible).
response_format: Optional[CompactionSettingsModelSettingsMoonshotCodingModelSettingsResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GroqModelSettings: …
class DeepseekModelSettings: …
class TogetherModelSettings: …
class BedrockModelSettings: …
class CompactionSettingsModelSettingsBasetenModelSettings: …
Baseten model configuration (OpenAI-compatible).
class CompactionSettingsModelSettingsOpenRouterModelSettings: …
Recompile Conversation
import os
from letta_client import Letta
client = Letta(
api_key=os.environ.get("LETTA_API_KEY"), # This is the default and can be omitted
)
response = client.conversations.recompile(
conversation_id="default",
)
print(response)"string"Returns Examples
"string"
Skip to content