Configuration
Client Configuration — methods for getting and setting system configuration.
Configuration Management
get_configmethodGet the current system configuration.
config = client.get_config()Returns: ConfigResponse — the persisted shared Config fields plus deployment-specific response overlays. Every shared nested type is linked in Configuration Models.
ConfigResponse also carries the response-only offline_tuner_config overlay. Its complete shape is { "enabled": false }. The current release exposes this overlay only as disabled availability status. Attempts to set enabled: true are unavailable: managed deployments reject the request with tuner_not_composed or config_reset_incomplete, and self-hosted deployments return deployment_unsupported. No public offline-tuner generator, optimizer, automatic application, or publication workflow is reachable.Example
config = client.get_config()print(config.profile_extractor_config.extraction_definition_prompt)print(config.user_playbook_extractor_config.extraction_definition_prompt)set_configmethodSet the system configuration with replacement semantics. The Python client accepts a Config instance or a dict that validates as the shared Config model. It strips deployment-specific response overlays from Config model instances, including objects returned by get_config. Dictionary inputs are validated strictly and reject response overlays. A raw HTTP request is normalized by the active server configurator, so Enterprise accepts its normalized response overlays in a full replacement payload. Unknown fields are rejected. Omitted fields that have model defaults are reset to those defaults, so use update_config for partial changes.
set_config or update_config return 409. Use the retrieval experiment methods instead.response = client.set_config(config)| Prop | Type |
|---|---|
configrequired | Config | dict |
Returns: dict with success and message keys.
The Python client's set_config method strips response-only deployment overlays from Config model instances. A dictionary containing those overlays is rejected by strict shared-Config validation. Treat offline_tuner_config as read-only disabled availability status in the current release; attempts to enable it are unavailable. See the Config Schema for every shared field, including the nested ProfileExtractorConfig, UserPlaybookExtractorConfig, PlaybookAggregatorConfig, DeduplicationConfig, AgentSuccessConfig, APIKeyConfig, and LLMConfig shapes.
Partial changes: use update_config for targeted edits such as applying a preset.
response = client.update_config({ "extraction_preset": "long_form", # auto-sets window_size=25, stride_size=10})Example — full configuration
config = client.get_config() # Configure profile extractionconfig.profile_extractor_config = { "extraction_definition_prompt": "Extract user preferences and interests", "context_prompt": "Analyzing customer conversations",} # Add playbook configuration with aggregation and deduplicationconfig.user_playbook_extractor_config = { "extraction_definition_prompt": "Extract playbook entries about response quality", "aggregation_config": { "min_cluster_size": 3, "clustering_similarity": 0.6, }, "deduplication_config": { "search_threshold": 0.4, "search_top_k": 5, },} response = client.set_config(config)print(f"Config updated: {response['success']}")update_configmethodApply a partial (PATCH-style) update to the org config. Unlike set_config, this does not round-trip the payload through Config(**...) client-side, so partial updates succeed without re-sending required fields like storage_config. The server fetches the existing config and shallow-merges atomically — there is no client-side read-modify-write race.
Nested objects (e.g. storage_config, llm_config) are replaced wholesale; deep merging is intentionally not supported. Raises TypeError if the argument is not a dict.
response = client.update_config({"shadow_mode_enabled": True})| Prop | Type |
|---|---|
partialrequired | dict |
Returns: dict with success and msg keys.
invalidate_cachemethodExplicitly evict the server-side per-org Emend cache entry. Useful when the running config has been mutated through a channel the server can't observe (sibling-replica writes, direct DB updates, hand-edited config files). Most cases are handled automatically; this is the manual escape hatch.
response = client.invalidate_cache()| Prop | Type |
|---|---|
org_id | string |
Returns: dict {"invalidated": bool, "org_id": str}. The invalidated flag is False when nothing was cached for the org (still a successful no-op).
Identity & Storage Routing
Two read-only endpoints expose information about the organization and storage backing the current API key. Hosted Enterprise users commonly use them to verify where a key is routed.
whoamimethodReturn the server's view of the caller's org and storage routing. The response is masked — it never contains raw credentials, so it is safe to print or include in bug reports.
identity = client.whoami()print(identity.org_id, identity.storage_type, identity.storage_label)Returns WhoamiResponse.
emend status whoami CLI command wraps this method and prints a formatted summary.get_my_configmethodReturn the raw storage credentials for the caller's org. Used by emend config pull / config storage to let users move per-org server-side config to a fresh machine.
my_config = client.get_my_config()if my_config.success: print(my_config.storage_type) # my_config.storage_config is a dict containing raw credentialsReturns MyConfigResponse.
whoami, this response does contain raw credentials. Do not log or print the full response. Treat it like any other secret material.