A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
improvement: multiple models for different roles (#6018)
Myles Scolnickf3fe768df9a9
diff --git a/frontend/src/components/app-config/ai-config.tsx b/frontend/src/components/app-config/ai-config.tsxindex 744b565a7f..ade4b15976 100644--- a/frontend/src/components/app-config/ai-config.tsx+++ b/frontend/src/components/app-config/ai-config.tsx@@ -15,7 +15,7 @@ import { Kbd } from "@/components/ui/kbd";import { NativeSelect } from "@/components/ui/native-select";import { Textarea } from "@/components/ui/textarea";import { CopilotConfig } from "@/core/codemirror/copilot/copilot-config";-import type { UserConfig } from "@/core/config/config-schema";+import { DEFAULT_AI_MODEL, type UserConfig } from "@/core/config/config-schema";import { isWasm } from "@/core/wasm/utils";import {AiProviderIcon,@@ -181,6 +181,7 @@ interface ModelSelectorProps {testId: string;description?: React.ReactNode;disabled?: boolean;+ label: string;}export const ModelSelector: React.FC<ModelSelectorProps> = ({@@ -191,6 +192,7 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({testId,description,disabled = false,+ label,}) => {const modelInputId = useId();@@ -202,7 +204,7 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({render={({ field }) => (<div className="flex flex-col space-y-1"><FormItem className={formItemClasses}>- <FormLabel>Model</FormLabel>+ <FormLabel>{label}</FormLabel><FormControl><Inputlist={modelInputId}@@ -335,25 +337,19 @@ const renderCopilotProvider = (settings.</p><ModelSelector+ label="Autocomplete Model"form={form}config={config}- name="completion.model"- placeholder="Qwen2.5-Coder-7B"+ name="ai.models.autocomplete_model"+ placeholder="ollama/qwen2.5-coder:1.5b"testId="custom-model-input"- />- <BaseUrl- form={form}- config={config}- name="completion.base_url"- placeholder="http://localhost:11434/v1"- testId="custom-base-url-input"- />- <ApiKey- form={form}- config={config}- name="completion.api_key"- placeholder="key"- testId="custom-api-key-input"+ description={+ <>+ Model to use for code completion when using a custom provider.+ Models should include the provider name and model name separated+ by a slash.+ </>+ }/></>);@@ -661,18 +657,20 @@ export const AiAssistConfig: React.FC<AiConfigProps> = ({ form, config }) => {</p><ModelSelector+ label="Chat Model"form={form}config={config}- name="ai.open_ai.model"- placeholder="gpt-4-turbo"- testId="ai-model-input"+ name="ai.models.chat_model"+ placeholder={DEFAULT_AI_MODEL}+ testId="ai-chat-model-input"disabled={isWasmRuntime}description={<><p>- Models should include the provider name and model name separated- by a slash. For example, "anthropic/claude-3-7-sonnet-latest" or- "google/gemini-2.5-flash-preview-05-20".+ Model to use for chat conversations in the Chat panel. Models+ should include the provider name and model name separated by a+ slash. For example, "anthropic/claude-3-5-sonnet-latest" or+ "google/gemini-2.0-flash-exp".</p><p className="pt-1">Depending on the provider, we will use the respective API key and@@ -682,6 +680,29 @@ export const AiAssistConfig: React.FC<AiConfigProps> = ({ form, config }) => {}/>+ <ModelSelector+ label="Edit Model"+ form={form}+ config={config}+ name="ai.models.edit_model"+ placeholder={DEFAULT_AI_MODEL}+ testId="ai-edit-model-input"+ disabled={isWasmRuntime}+ description={+ <>+ <p>+ Model to use for code editing with the{" "}+ <Kbd className="inline">Generate with AI</Kbd> button. Models+ should include the provider name and model name separated by a+ slash.+ </p>+ <p className="pt-1">+ You can use a faster, cheaper model for edits if desired.+ </p>+ </>+ }+ />+<FormFieldcontrol={form.control}name="ai.rules"diff --git a/frontend/src/components/chat/chat-panel.tsx b/frontend/src/components/chat/chat-panel.tsxindex 190fa27d46..5fea9c3114 100644--- a/frontend/src/components/chat/chat-panel.tsx+++ b/frontend/src/components/chat/chat-panel.tsx@@ -44,7 +44,7 @@ import {} from "@/core/ai/state";import { getCodes } from "@/core/codemirror/copilot/getCodes";import { aiAtom, aiEnabledAtom, userConfigAtom } from "@/core/config/config";-import type { UserConfig } from "@/core/config/config-schema";+import { DEFAULT_AI_MODEL, type UserConfig } from "@/core/config/config-schema";import { FeatureFlagged } from "@/core/config/feature-flag";import { useRequestClient } from "@/core/network/requests";import { useRuntimeManager } from "@/core/runtime/config";@@ -242,12 +242,14 @@ interface ChatInputFooterProps {onStop: () => void;}+const DEFAULT_MODE = "manual";+const ChatInputFooter: React.FC<ChatInputFooterProps> = memo(({ input, onSendClick, isLoading, onStop }) => {const ai = useAtomValue(aiAtom);const [userConfig, setUserConfig] = useAtom(userConfigAtom);- const currentMode = ai?.mode || "manual";- const currentModel = ai?.open_ai?.model || "o4-mini";+ const currentMode = ai?.mode || DEFAULT_MODE;+ const currentModel = ai?.models?.chat_model || DEFAULT_AI_MODEL;const { saveUserConfig } = useRequestClient();const modeOptions = [@@ -279,9 +281,11 @@ const ChatInputFooter: React.FC<ChatInputFooterProps> = memo(...userConfig,ai: {...userConfig.ai,- open_ai: {- ...userConfig.ai?.open_ai,- model: newModel,+ models: {+ custom_models: [],+ displayed_models: [],+ ...userConfig.ai?.models,+ chat_model: newModel,},},};diff --git a/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx b/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsxindex 6bad8609c4..24976fe3b1 100644--- a/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx+++ b/frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx@@ -5,12 +5,14 @@ import { SparklesIcon } from "lucide-react";import React from "react";import { useOpenSettingsToTab } from "@/components/app-config/state";import { aiAtom, aiEnabledAtom } from "@/core/config/config";+import { DEFAULT_AI_MODEL } from "@/core/config/config-schema";import { FooterItem } from "../footer-item";export const AIStatusIcon: React.FC = () => {const ai = useAtomValue(aiAtom);const aiEnabled = useAtomValue(aiEnabledAtom);- const model = ai?.open_ai?.model || "gpt-4-turbo";+ const chatModel = ai?.models?.chat_model || DEFAULT_AI_MODEL;+ const editModel = ai?.models?.edit_model || chatModel;const { handleClick } = useOpenSettingsToTab();if (!aiEnabled) {@@ -30,7 +32,9 @@ export const AIStatusIcon: React.FC = () => {<FooterItemtooltip={<>- <b>Assist model:</b> {model}+ <b>Chat model:</b> {chatModel}+ <br />+ <b>Edit model:</b> {editModel}</>}onClick={() => handleClick("ai")}diff --git a/frontend/src/core/config/__tests__/config-schema.test.ts b/frontend/src/core/config/__tests__/config-schema.test.tsindex 718e45f189..43e33e727e 100644--- a/frontend/src/core/config/__tests__/config-schema.test.ts+++ b/frontend/src/core/config/__tests__/config-schema.test.ts@@ -45,6 +45,10 @@ test("default UserConfig - empty", () => {{"ai": {"mode": "manual",+ "models": {+ "custom_models": [],+ "displayed_models": [],+ },"rules": "",},"completion": {@@ -105,6 +109,10 @@ test("default UserConfig - one level", () => {{"ai": {"mode": "manual",+ "models": {+ "custom_models": [],+ "displayed_models": [],+ },"rules": "",},"completion": {diff --git a/frontend/src/core/config/config-schema.ts b/frontend/src/core/config/config-schema.tsindex f18e2b545c..34bd22070d 100644--- a/frontend/src/core/config/config-schema.ts+++ b/frontend/src/core/config/config-schema.ts@@ -37,6 +37,8 @@ const VALID_SQL_OUTPUT_FORMATS = [] as const;export type SqlOutputType = (typeof VALID_SQL_OUTPUT_FORMATS)[number];+export const DEFAULT_AI_MODEL = "openai/gpt-4o";+/*** Export types for auto download*/@@ -142,13 +144,7 @@ export const UserConfigSchema = z.object({rules: z.string().default(""),mode: z.enum(["manual", "ask"]).default("manual"),- // TODO: the model currently exists on the open_ai object, but we should- // move it to the top level.- open_ai: AiConfigSchema.extend({- model: z.string().optional(),- })- .passthrough()- .optional(),+ open_ai: AiConfigSchema.optional(),anthropic: AiConfigSchema.optional(),google: AiConfigSchema.optional(),ollama: AiConfigSchema.optional(),@@ -162,6 +158,18 @@ export const UserConfigSchema = zaws_secret_access_key: z.string().optional(),}).optional(),+ models: z+ .object({+ chat_model: z.string().nullish(),+ edit_model: z.string().nullish(),+ autocomplete_model: z.string().nullish(),+ displayed_models: z.array(z.string()).default([]),+ custom_models: z.array(z.string()).default([]),+ })+ .default({+ displayed_models: [],+ custom_models: [],+ }),}).passthrough().default({}),@@ -198,6 +206,7 @@ export const UserConfigSchema = zrules: "",mode: "manual",open_ai: {},+ models: {},},});export type UserConfig = MarimoConfig;diff --git a/frontend/src/core/config/config.ts b/frontend/src/core/config/config.tsindex 8504f5408d..e1c38bbc23 100644--- a/frontend/src/core/config/config.ts+++ b/frontend/src/core/config/config.ts@@ -79,6 +79,9 @@ export function isAiEnabled(config: UserConfig) {Boolean(config.ai?.open_ai?.api_key) ||Boolean(config.ai?.anthropic?.api_key) ||Boolean(config.ai?.google?.api_key) ||+ Boolean(config.ai?.azure?.api_key) ||+ Boolean(config.ai?.ollama?.api_key) ||+ Boolean(config.ai?.open_ai_compatible?.api_key) ||Boolean(config.ai?.bedrock?.profile_name));}diff --git a/marimo/_config/config.py b/marimo/_config/config.pyindex 571732a64f..61ef825366 100644--- a/marimo/_config/config.py+++ b/marimo/_config/config.py@@ -40,9 +40,6 @@ class CompletionConfig(TypedDict):until the completion hotkey is entered- `copilot`: one of `"github"`, `"codeium"`, or `"custom"`- `codeium_api_key`: the Codeium API key- - `api_key`: the API key for the LLM provider, when `copilot` is `"custom"`- - `model`: the model to use, when `copilot` is `"custom"`- - `base_url`: the base URL for the API, when `copilot` is `"custom"`"""activate_on_typing: bool@@ -51,7 +48,7 @@ class CompletionConfig(TypedDict):# Codeiumcodeium_api_key: NotRequired[Optional[str]]- # Custom+ # @deprecated: use `ai.models.autocomplete_model` insteadapi_key: NotRequired[Optional[str]]model: NotRequired[Optional[str]]base_url: NotRequired[Optional[str]]@@ -233,6 +230,28 @@ class PackageManagementConfig(TypedDict):CopilotMode = Literal["ask", "manual"]+@mddoc+@dataclass+class AiModelConfig(TypedDict):+ """Configuration options for an AI model.++ **Keys.**++ - `chat_model`: the model to use for chat completions+ - `edit_model`: the model to use for edit completions+ - `autocomplete_model`: the model to use for code completion/autocomplete+ - `displayed_models`: a list of models to display in the UI+ - `custom_models`: a list of custom models to use that are not from the default list+ """++ chat_model: NotRequired[str]+ edit_model: NotRequired[str]+ autocomplete_model: NotRequired[str]++ displayed_models: list[str]+ custom_models: list[str]++@dataclassclass AiConfig(TypedDict, total=False):"""Configuration options for AI.@@ -242,15 +261,20 @@ class AiConfig(TypedDict, total=False):- `rules`: custom rules to include in all AI completion prompts- `max_tokens`: the maximum number of tokens to use in AI completions- `mode`: the mode to use for AI completions. Can be one of: `"ask"` or `"manual"`+ - `models`: the models to use for AI completions- `open_ai`: the OpenAI config- `anthropic`: the Anthropic config- `google`: the Google AI config- `bedrock`: the Bedrock config+ - `azure`: the Azure config+ - `ollama`: the Ollama config+ - `open_ai_compatible`: the OpenAI-compatible config"""rules: NotRequired[str]max_tokens: NotRequired[int]mode: NotRequired[CopilotMode]+ models: AiModelConfig# providersopen_ai: OpenAiConfig@@ -269,8 +293,6 @@ class OpenAiConfig(TypedDict, total=False):**Keys.**- `api_key`: the OpenAI API key- - `model`: the model to use.- if model starts with `claude-` we use the AnthropicConfig- `base_url`: the base URL for the API- `ssl_verify` : Boolean argument for httpx passed to open ai client. httpx defaults to true, but some use cases to let users override to False in some testing scenarios- `ca_bundle_path`: custom ca bundle to be used for verifying SSL certificates. Used to create custom SSL context for httpx client@@ -278,12 +300,14 @@ class OpenAiConfig(TypedDict, total=False):"""api_key: str- model: NotRequired[str]base_url: NotRequired[str]ssl_verify: NotRequired[bool]ca_bundle_path: NotRequired[str]client_pem: NotRequired[str]+ # @deprecated: use `ai.models.chat_model` instead+ model: NotRequired[str]+@dataclassclass AnthropicConfig(TypedDict, total=False):@@ -582,6 +606,12 @@ DEFAULT_CONFIG: MarimoConfig = {"enable_pyflakes": False,}},+ "ai": {+ "models": {+ "displayed_models": [],+ "custom_models": [],+ }+ },"snippets": {"custom_paths": [],"include_default_snippets": True,@@ -638,4 +668,36 @@ def merge_config():merged["runtime"]["auto_reload"] = "lazy"+ # If missing ai.models.chat_model or ai.models.edit_model, use ai.open_ai.model+ openai_model = merged.get("ai", {}).get("open_ai", {}).get("model")+ chat_model = merged.get("ai", {}).get("models", {}).get("chat_model")+ edit_model = merged.get("ai", {}).get("models", {}).get("edit_model")+ if not chat_model and not edit_model and openai_model:+ merged_ai_config = cast(dict[Any, Any], merged.get("ai", {}))+ models_config = {+ "models": {+ "chat_model": chat_model or openai_model,+ "edit_model": edit_model or openai_model,+ }+ }+ merged["ai"] = cast(+ AiConfig, deep_merge(merged_ai_config, models_config)+ )++ # Migrate completion.model to ai.models.autocomplete_model+ completion_model = merged.get("completion", {}).get("model")+ autocomplete_model = (+ merged.get("ai", {}).get("models", {}).get("autocomplete_model")+ )+ if completion_model and not autocomplete_model:+ merged_ai_config = cast(dict[Any, Any], merged.get("ai", {}))+ models_config = {+ "models": {+ "autocomplete_model": completion_model,+ }+ }+ merged["ai"] = cast(+ AiConfig, deep_merge(merged_ai_config, models_config)+ )+return mergeddiff --git a/marimo/_server/ai/config.py b/marimo/_server/ai/config.pyindex 93f5c3a48b..5311f459b2 100644--- a/marimo/_server/ai/config.py+++ b/marimo/_server/ai/config.py@@ -5,6 +5,7 @@ from dataclasses import dataclass, fieldfrom typing import (Any,Optional,+ Union,cast,)@@ -12,17 +13,15 @@ from starlette.exceptions import HTTPExceptionfrom marimo._config.config import (AiConfig,- CompletionConfig,CopilotMode,MarimoConfig,+ PartialMarimoConfig,)+from marimo._server.ai.constants import DEFAULT_MAX_TOKENS, DEFAULT_MODELfrom marimo._server.ai.ids import AiModelIdfrom marimo._server.ai.tools import Tool, get_tool_managerfrom marimo._server.api.status import HTTPStatus-DEFAULT_MAX_TOKENS = 4096-DEFAULT_MODEL = "gpt-4o-mini"-@dataclassclass AnyProviderConfig:@@ -131,15 +130,6 @@ class AnyProviderConfig:tools=_get_tools(config.get("mode", "manual")),)- @classmethod- def for_completion(cls, config: CompletionConfig) -> AnyProviderConfig:- key = _get_key(config, "AI completion")- return cls(- base_url=_get_base_url(config),- api_key=key,- tools=[], # Inline completion never uses tools- )-@classmethoddef for_model(cls, model: str, config: AiConfig) -> AnyProviderConfig:model_id = AiModelId.from_model(model)@@ -185,8 +175,33 @@ def _get_ai_config(config: AiConfig, key: str, name: str) -> dict[str, Any]:return cast(dict[str, Any], config.get(key, {}))-def get_model(config: AiConfig) -> str:- return config.get("open_ai", {}).get("model") or DEFAULT_MODEL+def get_chat_model(config: AiConfig) -> str:+ """Get the chat model from the config."""+ return (+ # Current config+ config.get("models", {}).get("chat_model")+ # Legacy config+ or config.get("open_ai", {}).get("model")+ or DEFAULT_MODEL+ )+++def get_edit_model(config: AiConfig) -> str:+ """Get the edit model from the config."""+ return config.get("models", {}).get("edit_model") or get_chat_model(config)+++def get_autocomplete_model(+ config: Union[MarimoConfig, PartialMarimoConfig],+) -> str:+ """Get the autocomplete model from the config."""+ return (+ # Current config+ config.get("ai", {}).get("models", {}).get("autocomplete_model")+ # Legacy config+ or config.get("completion", {}).get("model")+ or DEFAULT_MODEL+ )def get_max_tokens(config: MarimoConfig) -> int:@@ -210,6 +225,8 @@ def _get_key(detail="Invalid config",)+ config = cast(dict[str, Any], config)+if name == "Bedrock":if "profile_name" in config:profile_name = config.get("profile_name", "")diff --git a/marimo/_server/ai/constants.py b/marimo/_server/ai/constants.pynew file mode 100644index 0000000000..ae4ac373ac--- /dev/null+++ b/marimo/_server/ai/constants.py@@ -0,0 +1,2 @@+DEFAULT_MAX_TOKENS = 4096+DEFAULT_MODEL = "openai/gpt-4o"diff --git a/marimo/_server/api/endpoints/ai.py b/marimo/_server/api/endpoints/ai.pyindex df66f70acb..34066e4e27 100644--- a/marimo/_server/api/endpoints/ai.py+++ b/marimo/_server/api/endpoints/ai.py@@ -16,10 +16,11 @@ from marimo import _loggersfrom marimo._ai._types import ChatMessagefrom marimo._config.config import AiConfig, MarimoConfigfrom marimo._server.ai.config import (- DEFAULT_MODEL,AnyProviderConfig,+ get_autocomplete_model,+ get_chat_model,+ get_edit_model,get_max_tokens,- get_model,)from marimo._server.ai.prompts import (FILL_ME_TAG,@@ -112,7 +113,7 @@ async def ai_completion()prompt = body.prompt- model = get_model(ai_config)+ model = get_edit_model(ai_config)provider = get_completion_provider(AnyProviderConfig.for_model(model, ai_config),model=model,@@ -168,7 +169,7 @@ async def ai_chat(max_tokens = get_max_tokens(config)- model = body.model or get_model(ai_config)+ model = body.model or get_chat_model(ai_config)provider = get_completion_provider(AnyProviderConfig.for_model(model, ai_config),model=model,@@ -223,15 +224,15 @@ async def ai_inline_completion(# of 4096, since it is smaller/faster for inline completionsINLINE_COMPLETION_MAX_TOKENS = 1024- try:- model = config["completion"]["model"] or DEFAULT_MODEL- except Exception:- model = DEFAULT_MODEL+ ai_config = get_ai_config(config)- provider = get_completion_provider(- AnyProviderConfig.for_completion(config["completion"]),- model=model,- )+ model = get_autocomplete_model(config)+ provider_config = AnyProviderConfig.for_model(model, ai_config)+ # Inline completion never uses tools+ if provider_config.tools:+ provider_config.tools.clear()++ provider = get_completion_provider(provider_config, model=model)response = provider.stream_completion(messages=messages,system_prompt=system_prompt,diff --git a/packages/openapi/api.yaml b/packages/openapi/api.yamlindex 48ea2e41a2..dfb2d63b58 100644--- a/packages/openapi/api.yaml+++ b/packages/openapi/api.yaml@@ -8,7 +8,7 @@ components:nullable: truetype: booleanrequired:- - package+ - packagetype: objectAiCompletionContext:properties:@@ -19,12 +19,12 @@ components:variables:items:oneOf:- - $ref: '#/components/schemas/VariableContext'- - type: string+ - $ref: '#/components/schemas/VariableContext'+ - type: stringtype: arrayrequired:- - schema- - variables+ - schema+ - variablestype: objectAiCompletionRequest:properties:@@ -37,9 +37,9 @@ components:type: stringlanguage:enum:- - python- - markdown- - sql+ - python+ - markdown+ - sqltype: stringprompt:type: string@@ -47,10 +47,10 @@ components:nullable: truetype: stringrequired:- - prompt- - includeOtherCode- - code- - language+ - prompt+ - includeOtherCode+ - code+ - languagetype: objectAiConfig:properties:@@ -66,9 +66,29 @@ components:type: integermode:enum:- - ask- - manual+ - ask+ - manualtype: string+ models:+ properties:+ autocomplete_model:+ type: string+ chat_model:+ type: string+ custom_models:+ items:+ type: string+ type: array+ edit_model:+ type: string+ displayed_models:+ items:+ type: string+ type: array+ required:+ - displayed_models+ - custom_models+ type: objectollama:$ref: '#/components/schemas/OpenAiConfig'open_ai:@@ -82,18 +102,18 @@ components:properties:language:enum:- - python- - markdown- - sql+ - python+ - markdown+ - sqltype: stringprefix:type: stringsuffix:type: stringrequired:- - prefix- - suffix- - language+ - prefix+ - suffix+ - languagetype: objectAlert:properties:@@ -101,19 +121,19 @@ components:type: stringname:enum:- - alert+ - alerttype: stringtitle:type: stringvariant:enum:- - danger+ - dangernullable: truetype: stringrequired:- - title- - description- - name+ - title+ - description+ - nametype: objectAnthropicConfig:properties:@@ -124,33 +144,33 @@ components:properties:action:enum:- - restart+ - restartnullable: truetype: stringdescription:type: stringname:enum:- - banner+ - bannertype: stringtitle:type: stringvariant:enum:- - danger+ - dangernullable: truetype: stringrequired:- - title- - description- - name+ - title+ - description+ - nametype: objectBaseResponse:properties:success:type: booleanrequired:- - success+ - successtype: objectBedrockConfig:properties:@@ -165,13 +185,13 @@ components:type: objectCellChannel:enum:- - stdout- - stderr- - stdin- - pdb- - output- - marimo-error- - media+ - stdout+ - stderr+ - stdin+ - pdb+ - output+ - marimo-error+ - mediatype: stringCellConfig:properties:@@ -183,8 +203,8 @@ components:hide_code:type: booleanrequired:- - disabled- - hide_code+ - disabled+ - hide_codetype: objectCellOp:properties:@@ -193,13 +213,13 @@ components:console:nullable: trueoneOf:- - $ref: '#/components/schemas/CellOutput'- - items:- $ref: '#/components/schemas/CellOutput'- type: array+ - $ref: '#/components/schemas/CellOutput'+ - items:+ $ref: '#/components/schemas/CellOutput'+ type: arrayname:enum:- - cell-op+ - cell-optype: stringoutput:$ref: '#/components/schemas/CellOutput'@@ -219,9 +239,9 @@ components:timestamp:type: numberrequired:- - cell_id- - timestamp- - name+ - cell_id+ - timestamp+ - nametype: objectCellOutput:properties:@@ -229,21 +249,21 @@ components:$ref: '#/components/schemas/CellChannel'data:oneOf:- - type: string- - items:- $ref: '#/components/schemas/Error'- type: array- - additionalProperties: {}- type: object+ - type: string+ - items:+ $ref: '#/components/schemas/Error'+ type: array+ - additionalProperties: {}+ type: objectmimetype:$ref: '#/components/schemas/MimeType'timestamp:type: numberrequired:- - channel- - mimetype- - data- - timestamp+ - channel+ - mimetype+ - data+ - timestamptype: objectChatRequest:properties:@@ -265,8 +285,8 @@ components:url:type: stringrequired:- - url- - name+ - url+ - nametype: objectnullable: truetype: array@@ -276,90 +296,90 @@ components:parts:items:oneOf:- - properties:- text:- type: string- type:- enum:+ - properties:+ text:+ type: string+ type:+ enum:+ - text+ type: string+ required:+ - type- text- type: string- required:- - type- - text- type: object- - properties:- details:- items:+ type: object+ - properties:+ details:+ items:+ properties:+ signature:+ nullable: true+ type: string+ text:+ type: string+ type:+ enum:+ - text+ type: string+ required:+ - type+ - text+ type: object+ type: array+ reasoning:+ type: string+ type:+ enum:+ - reasoning+ type: string+ required:+ - type+ - reasoning+ - details+ type: object+ - properties:+ toolInvocation:properties:- signature:- nullable: true+ args:+ additionalProperties: {}+ type: object+ result: {}+ state:+ enum:+ - resulttype: string- text:+ step:+ type: integer+ toolCallId:type: string- type:- enum:- - text+ toolName:type: stringrequired:- - type- - text- type: object- type: array- reasoning:- type: string- type:- enum:- - reasoning- type: string- required:- - type- - reasoning- - details- type: object- - properties:- toolInvocation:- properties:- args:- additionalProperties: {}- type: object- result: {}- state:- enum:+ - state- result- type: string- step:- type: integer- toolCallId:- type: string- toolName:- type: string- required:- - state- - result- - toolCallId- - toolName- - step- - args- type: object- type:- enum:- - tool-invocation- type: string- required:- - type- - toolInvocation- type: object+ - toolCallId+ - toolName+ - step+ - args+ type: object+ type:+ enum:+ - tool-invocation+ type: string+ required:+ - type+ - toolInvocation+ type: objectnullable: truetype: arrayrole:enum:- - user- - assistant- - system+ - user+ - assistant+ - systemtype: stringrequired:- - role- - content+ - role+ - contenttype: objecttype: arraymodel:@@ -368,14 +388,14 @@ components:variables:items:oneOf:- - $ref: '#/components/schemas/VariableContext'- - type: string+ - $ref: '#/components/schemas/VariableContext'+ - type: stringnullable: truetype: arrayrequired:- - context- - includeOtherCode- - messages+ - context+ - includeOtherCode+ - messagestype: objectCodeCompletionRequest:properties:@@ -386,9 +406,9 @@ components:id:type: stringrequired:- - id- - document- - cellId+ - id+ - document+ - cellIdtype: objectColumnStats:properties:@@ -439,10 +459,10 @@ components:properties:name:enum:- - completed-run+ - completed-runtype: stringrequired:- - name+ - nametype: objectCompletionResult:properties:@@ -450,7 +470,7 @@ components:type: stringname:enum:- - completion-result+ - completion-resulttype: stringoptions:items:@@ -463,17 +483,17 @@ components:type:type: stringrequired:- - name- - type+ - name+ - typetype: objecttype: arrayprefix_length:type: integerrequired:- - completion_id- - prefix_length- - options- - name+ - completion_id+ - prefix_length+ - options+ - nametype: objectCopyNotebookRequest:properties:@@ -482,8 +502,8 @@ components:source:type: stringrequired:- - source- - destination+ - source+ - destinationtype: objectCreateSecretRequest:properties:@@ -493,36 +513,36 @@ components:type: stringprovider:enum:- - env- - dotenv+ - env+ - dotenvtype: stringvalue:type: stringrequired:- - key- - value- - provider- - name+ - key+ - value+ - provider+ - nametype: objectCycleError:properties:edges_with_vars:items:prefixItems:- - type: string- - items:- type: string- type: array- - type: string+ - type: string+ - items:+ type: string+ type: array+ - type: stringtype: arraytype: arraytype:enum:- - cycle+ - cycletype: stringrequired:- - edges_with_vars- - type+ - edges_with_vars+ - typetype: objectDataColumnPreview:properties:@@ -544,7 +564,7 @@ components:type: arrayname:enum:- - data-column-preview+ - data-column-previewtype: stringstats:$ref: '#/components/schemas/ColumnStats'@@ -552,9 +572,9 @@ components:table_name:type: stringrequired:- - table_name- - column_name- - name+ - table_name+ - column_name+ - nametype: objectDataSourceConnection:properties:@@ -578,14 +598,14 @@ components:$ref: '#/components/schemas/DataTable'type: arrayrequired:- - name- - tables+ - name+ - tablestype: objecttype: arrayrequired:- - name- - dialect- - schemas+ - name+ - dialect+ - schemastype: objecttype: arraydefault_database:@@ -603,11 +623,11 @@ components:source:type: stringrequired:- - source- - dialect- - name- - display_name- - databases+ - source+ - dialect+ - name+ - display_name+ - databasestype: objectDataSourceConnections:properties:@@ -617,11 +637,11 @@ components:type: arrayname:enum:- - data-source-connections+ - data-source-connectionstype: stringrequired:- - connections- - name+ - connections+ - nametype: objectDataTable:properties:@@ -654,25 +674,25 @@ components:type: stringsource_type:enum:- - local- - duckdb- - connection- - catalog+ - local+ - duckdb+ - connection+ - catalogtype: stringtype:enum:- - table- - view+ - table+ - viewtype: stringvariable_name:nullable: truetype: stringrequired:- - source_type- - source- - name- - columns- - type+ - source_type+ - source+ - name+ - columns+ - typetype: objectDataTableColumn:properties:@@ -686,21 +706,21 @@ components:type:$ref: '#/components/schemas/DataType'required:- - name- - type- - external_type- - sample_values+ - name+ - type+ - external_type+ - sample_valuestype: objectDataType:enum:- - string- - boolean- - integer- - number- - date- - datetime- - time- - unknown+ - string+ - boolean+ - integer+ - number+ - date+ - datetime+ - time+ - unknowntype: stringDatabase:properties:@@ -716,45 +736,45 @@ components:$ref: '#/components/schemas/Schema'type: arrayrequired:- - name- - dialect- - schemas+ - name+ - dialect+ - schemastype: objectDatasets:properties:clear_channel:enum:- - local- - duckdb- - connection- - catalog+ - local+ - duckdb+ - connection+ - catalognullable: truetype: stringname:enum:- - datasets+ - datasetstype: stringtables:items:$ref: '#/components/schemas/DataTable'type: arrayrequired:- - tables- - name+ - tables+ - nametype: objectDeleteCellRequest:properties:cellId:type: stringrequired:- - cellId+ - cellIdtype: objectDeleteSecretRequest:properties:key:type: stringrequired:- - key+ - keytype: objectDependencyTreeNode:properties:@@ -774,9 +794,9 @@ components:nullable: truetype: stringrequired:- - name- - tags- - dependencies+ - name+ - tags+ - dependenciestype: objectDependencyTreeResponse:properties:@@ -786,18 +806,18 @@ components:type: objectError:oneOf:- - $ref: '#/components/schemas/SetupRootError'- - $ref: '#/components/schemas/CycleError'- - $ref: '#/components/schemas/MultipleDefinitionError'- - $ref: '#/components/schemas/ImportStarError'- - $ref: '#/components/schemas/MarimoAncestorStoppedError'- - $ref: '#/components/schemas/MarimoAncestorPreventedError'- - $ref: '#/components/schemas/MarimoExceptionRaisedError'- - $ref: '#/components/schemas/MarimoStrictExecutionError'- - $ref: '#/components/schemas/MarimoInterruptionError'- - $ref: '#/components/schemas/MarimoSyntaxError'- - $ref: '#/components/schemas/MarimoInternalError'- - $ref: '#/components/schemas/UnknownError'+ - $ref: '#/components/schemas/SetupRootError'+ - $ref: '#/components/schemas/CycleError'+ - $ref: '#/components/schemas/MultipleDefinitionError'+ - $ref: '#/components/schemas/ImportStarError'+ - $ref: '#/components/schemas/MarimoAncestorStoppedError'+ - $ref: '#/components/schemas/MarimoAncestorPreventedError'+ - $ref: '#/components/schemas/MarimoExceptionRaisedError'+ - $ref: '#/components/schemas/MarimoStrictExecutionError'+ - $ref: '#/components/schemas/MarimoInterruptionError'+ - $ref: '#/components/schemas/MarimoSyntaxError'+ - $ref: '#/components/schemas/MarimoInternalError'+ - $ref: '#/components/schemas/UnknownError'ExecuteMultipleRequest:properties:cellIds:@@ -814,9 +834,9 @@ components:timestamp:type: numberrequired:- - cellIds- - codes- - timestamp+ - cellIds+ - codes+ - timestamptype: objectExecuteScratchpadRequest:properties:@@ -826,7 +846,7 @@ components:$ref: '#/components/schemas/HTTPRequest'nullable: truerequired:- - code+ - codetype: objectExecuteStaleRequest:properties:@@ -846,9 +866,9 @@ components:timestamp:type: numberrequired:- - cellId- - code- - timestamp+ - cellId+ - code+ - timestamptype: objectExportAsHTMLRequest:properties:@@ -864,30 +884,30 @@ components:includeCode:type: booleanrequired:- - download- - files- - includeCode+ - download+ - files+ - includeCodetype: objectExportAsIPYNBRequest:properties:download:type: booleanrequired:- - download+ - downloadtype: objectExportAsMarkdownRequest:properties:download:type: booleanrequired:- - download+ - downloadtype: objectExportAsScriptRequest:properties:download:type: booleanrequired:- - download+ - downloadtype: objectFileCreateRequest:properties:@@ -900,13 +920,13 @@ components:type: stringtype:enum:- - file- - directory+ - file+ - directorytype: stringrequired:- - path- - type- - name+ - path+ - type+ - nametype: objectFileCreateResponse:properties:@@ -919,14 +939,14 @@ components:success:type: booleanrequired:- - success+ - successtype: objectFileDeleteRequest:properties:path:type: stringrequired:- - path+ - pathtype: objectFileDeleteResponse:properties:@@ -936,14 +956,14 @@ components:success:type: booleanrequired:- - success+ - successtype: objectFileDetailsRequest:properties:path:type: stringrequired:- - path+ - pathtype: objectFileDetailsResponse:properties:@@ -956,7 +976,7 @@ components:nullable: truetype: stringrequired:- - file+ - filetype: objectFileInfo:properties:@@ -978,12 +998,12 @@ components:path:type: stringrequired:- - id- - path- - name- - isDirectory- - isMarimoFile- - children+ - id+ - path+ - name+ - isDirectory+ - isMarimoFile+ - childrentype: objectFileListRequest:properties:@@ -1000,8 +1020,8 @@ components:root:type: stringrequired:- - files- - root+ - files+ - roottype: objectFileMoveRequest:properties:@@ -1010,8 +1030,8 @@ components:path:type: stringrequired:- - path- - newPath+ - path+ - newPathtype: objectFileMoveResponse:properties:@@ -1024,14 +1044,14 @@ components:success:type: booleanrequired:- - success+ - successtype: objectFileOpenRequest:properties:path:type: stringrequired:- - path+ - pathtype: objectFileUpdateRequest:properties:@@ -1040,8 +1060,8 @@ components:path:type: stringrequired:- - path- - contents+ - path+ - contentstype: objectFileUpdateResponse:properties:@@ -1054,7 +1074,7 @@ components:success:type: booleanrequired:- - success+ - successtype: objectFocusCell:properties:@@ -1062,11 +1082,11 @@ components:type: stringname:enum:- - focus-cell+ - focus-celltype: stringrequired:- - cell_id- - name+ - cell_id+ - nametype: objectFormatRequest:properties:@@ -1077,8 +1097,8 @@ components:lineLength:type: integerrequired:- - codes- - lineLength+ - codes+ - lineLengthtype: objectFormatResponse:properties:@@ -1087,7 +1107,7 @@ components:type: stringtype: objectrequired:- - codes+ - codestype: objectFunctionCallRequest:properties:@@ -1101,10 +1121,10 @@ components:namespace:type: stringrequired:- - functionCallId- - namespace- - functionName- - args+ - functionCallId+ - namespace+ - functionName+ - argstype: objectFunctionCallResult:properties:@@ -1112,30 +1132,30 @@ components:type: stringname:enum:- - function-call-result+ - function-call-resulttype: stringreturn_value:nullable: trueoneOf:- - additionalProperties:- $ref: '#/components/schemas/JSONType'- type: object- - items:- $ref: '#/components/schemas/JSONType'- type: array- - type: string- - type: integer- - type: number- - type: boolean- - additionalProperties: true- type: object- - $ref: '#/components/schemas/MIME'+ - additionalProperties:+ $ref: '#/components/schemas/JSONType'+ type: object+ - items:+ $ref: '#/components/schemas/JSONType'+ type: array+ - type: string+ - type: integer+ - type: number+ - type: boolean+ - additionalProperties: true+ type: object+ - $ref: '#/components/schemas/MIME'status:$ref: '#/components/schemas/HumanReadableStatus'required:- - function_call_id- - status- - name+ - function_call_id+ - status+ - nametype: objectGoogleAiConfig:properties:@@ -1148,8 +1168,8 @@ components:properties:code:enum:- - ok- - error+ - ok+ - errortype: stringmessage:nullable: true@@ -1158,7 +1178,7 @@ components:nullable: truetype: stringrequired:- - code+ - codetype: objectImportStarError:properties:@@ -1166,11 +1186,11 @@ components:type: stringtype:enum:- - import-star+ - import-startype: stringrequired:- - msg- - type+ - msg+ - typetype: objectInstallMissingPackagesRequest:properties:@@ -1181,27 +1201,27 @@ components:type: stringtype: objectrequired:- - manager- - versions+ - manager+ - versionstype: objectInstallingPackageAlert:properties:name:enum:- - installing-package-alert+ - installing-package-alerttype: stringpackages:additionalProperties:enum:- - queued- - installing- - installed- - failed+ - queued+ - installing+ - installed+ - failedtype: stringtype: objectrequired:- - packages- - name+ - packages+ - nametype: objectInstantiateRequest:properties:@@ -1215,18 +1235,18 @@ components:items: {}type: arrayrequired:- - objectIds- - values- - autoRun+ - objectIds+ - values+ - autoRuntype: objectInterrupted:properties:name:enum:- - interrupted+ - interruptedtype: stringrequired:- - name+ - nametype: objectInvokeAiToolRequest:properties:@@ -1236,8 +1256,8 @@ components:toolName:type: stringrequired:- - toolName- - arguments+ - toolName+ - argumentstype: objectInvokeAiToolResponse:properties:@@ -1250,18 +1270,18 @@ components:toolName:type: stringrequired:- - success- - toolName- - result+ - success+ - toolName+ - resulttype: objectJSONType:oneOf:- - type: string- - type: number- - type: object- - type: array- - type: boolean- - type: 'null'+ - type: string+ - type: number+ - type: object+ - type: array+ - type: boolean+ - type: 'null'KernelReady:properties:app_config:@@ -1272,9 +1292,9 @@ components:auto_download:items:enum:- - html- - markdown- - ipynb+ - html+ - markdown+ - ipynbtype: stringtype: arraycss_file:@@ -1288,24 +1308,24 @@ components:type: stringsql_output:enum:- - polars- - lazy-polars- - pandas- - native- - auto+ - polars+ - lazy-polars+ - pandas+ - native+ - autotype: stringwidth:enum:- - normal- - compact- - medium- - full- - columns+ - normal+ - compact+ - medium+ - full+ - columnstype: stringrequired:- - width- - auto_download- - sql_output+ - width+ - auto_download+ - sql_outputtype: objectcapabilities:properties:@@ -1318,10 +1338,10 @@ components:ty:type: booleanrequired:- - terminal- - pylsp- - ty- - basedpyright+ - terminal+ - pylsp+ - ty+ - basedpyrighttype: objectcell_ids:items:@@ -1356,12 +1376,12 @@ components:type:type: stringrequired:- - type- - data+ - type+ - datatype: objectname:enum:- - kernel-ready+ - kernel-readytype: stringnames:items:@@ -1373,59 +1393,59 @@ components:additionalProperties:nullable: trueoneOf:- - additionalProperties:- nullable: true- oneOf:- - additionalProperties:- $ref: '#/components/schemas/JSONType'- type: object- - items:- $ref: '#/components/schemas/JSONType'- type: array- - type: string- - type: integer- - type: number- - type: boolean- - additionalProperties: true- type: object- - $ref: '#/components/schemas/MIME'- type: object- - items:- nullable: true- oneOf:- - additionalProperties:- $ref: '#/components/schemas/JSONType'- type: object- - items:- $ref: '#/components/schemas/JSONType'- type: array- - type: string- - type: integer- - type: number- - type: boolean- - additionalProperties: true- type: object- - $ref: '#/components/schemas/MIME'- type: array- - type: string- - type: integer- - type: number- - type: boolean- - additionalProperties: true- type: object- - $ref: '#/components/schemas/MIME'+ - additionalProperties:+ nullable: true+ oneOf:+ - additionalProperties:+ $ref: '#/components/schemas/JSONType'+ type: object+ - items:+ $ref: '#/components/schemas/JSONType'+ type: array+ - type: string+ - type: integer+ - type: number+ - type: boolean+ - additionalProperties: true+ type: object+ - $ref: '#/components/schemas/MIME'+ type: object+ - items:+ nullable: true+ oneOf:+ - additionalProperties:+ $ref: '#/components/schemas/JSONType'+ type: object+ - items:+ $ref: '#/components/schemas/JSONType'+ type: array+ - type: string+ - type: integer+ - type: number+ - type: boolean+ - additionalProperties: true+ type: object+ - $ref: '#/components/schemas/MIME'+ type: array+ - type: string+ - type: integer+ - type: number+ - type: boolean+ - additionalProperties: true+ type: object+ - $ref: '#/components/schemas/MIME'nullable: truetype: objectrequired:- - cell_ids- - codes- - names- - configs- - resumed- - app_config- - kiosk- - capabilities- - name+ - cell_ids+ - codes+ - names+ - configs+ - resumed+ - app_config+ - kiosk+ - capabilities+ - nametype: objectListPackagesResponse:properties:@@ -1434,14 +1454,14 @@ components:$ref: '#/components/schemas/PackageDescription'type: arrayrequired:- - packages+ - packagestype: objectListSecretKeysRequest:properties:requestId:type: stringrequired:- - requestId+ - requestIdtype: objectListSecretKeysResponse:properties:@@ -1450,7 +1470,7 @@ components:$ref: '#/components/schemas/SecretKeysWithProvider'type: arrayrequired:- - keys+ - keystype: objectMIME:properties: {}@@ -1466,12 +1486,12 @@ components:type: stringtype:enum:- - ancestor-prevented+ - ancestor-preventedtype: stringrequired:- - msg- - raising_cell- - type+ - msg+ - raising_cell+ - typetype: objectMarimoAncestorStoppedError:properties:@@ -1481,12 +1501,12 @@ components:type: stringtype:enum:- - ancestor-stopped+ - ancestor-stoppedtype: stringrequired:- - msg- - raising_cell- - type+ - msg+ - raising_cell+ - typetype: objectMarimoConfig:properties:@@ -1507,39 +1527,39 @@ components:type: stringcopilot:oneOf:- - type: boolean- - enum:- - github- - codeium- - custom- type: string+ - type: boolean+ - enum:+ - github+ - codeium+ - custom+ type: stringmodel:nullable: truetype: stringrequired:- - activate_on_typing- - copilot+ - activate_on_typing+ - copilottype: objectdatasources:properties:auto_discover_columns:oneOf:- - type: boolean- - enum:- - auto- type: string+ - type: boolean+ - enum:+ - auto+ type: stringauto_discover_schemas:oneOf:- - type: boolean- - enum:- - auto- type: string+ - type: boolean+ - enum:+ - auto+ type: stringauto_discover_tables:oneOf:- - type: boolean- - enum:- - auto- type: string+ - type: boolean+ - enum:+ - auto+ type: stringtype: objectdiagnostics:properties:@@ -1550,8 +1570,8 @@ components:properties:cell_output:enum:- - above- - below+ - above+ - belowtype: stringcode_editor_font_size:type: integer@@ -1561,8 +1581,8 @@ components:type: arraydataframes:enum:- - rich- - plain+ - rich+ - plaintype: stringdefault_table_max_columns:type: integer@@ -1570,28 +1590,28 @@ components:type: integerdefault_width:enum:- - normal- - compact- - medium- - full- - columns+ - normal+ - compact+ - medium+ - full+ - columnstype: stringreference_highlighting:type: booleantheme:enum:- - light- - dark- - system+ - light+ - dark+ - systemtype: stringrequired:- - theme- - code_editor_font_size- - cell_output- - default_width- - dataframes- - default_table_page_size- - default_table_max_columns+ - theme+ - code_editor_font_size+ - cell_output+ - default_width+ - dataframes+ - default_table_page_size+ - default_table_max_columnstype: objectexperimental:additionalProperties: {}@@ -1601,7 +1621,7 @@ components:line_length:type: integerrequired:- - line_length+ - line_lengthtype: objectkeymap:properties:@@ -1613,14 +1633,14 @@ components:type: objectpreset:enum:- - default- - vim+ - default+ - vimtype: stringvimrc:nullable: truetype: stringrequired:- - preset+ - presettype: objectlanguage_servers:properties:@@ -1656,14 +1676,14 @@ components:properties:manager:enum:- - pip- - rye- - uv- - poetry- - pixi+ - pip+ - rye+ - uv+ - poetry+ - pixitype: stringrequired:- - manager+ - managertype: objectruntime:properties:@@ -1671,25 +1691,25 @@ components:type: booleanauto_reload:enum:- - 'off'- - lazy- - autorun+ - 'off'+ - lazy+ - autoruntype: stringdefault_auto_download:items:enum:- - html- - markdown- - ipynb+ - html+ - markdown+ - ipynbtype: stringtype: arraydefault_sql_output:enum:- - polars- - lazy-polars- - pandas- - native- - auto+ - polars+ - lazy-polars+ - pandas+ - native+ - autotype: stringdotenv:items:@@ -1697,8 +1717,8 @@ components:type: arrayon_cell_change:enum:- - lazy- - autorun+ - lazy+ - autoruntype: stringoutput_max_bytes:type: integer@@ -1712,48 +1732,48 @@ components:type: integerwatcher_on_save:enum:- - lazy- - autorun+ - lazy+ - autoruntype: stringrequired:- - auto_instantiate- - auto_reload- - reactive_tests- - on_cell_change- - watcher_on_save- - output_max_bytes- - std_stream_max_bytes- - default_sql_output+ - auto_instantiate+ - auto_reload+ - reactive_tests+ - on_cell_change+ - watcher_on_save+ - output_max_bytes+ - std_stream_max_bytes+ - default_sql_outputtype: objectsave:properties:autosave:enum:- - 'off'- - after_delay+ - 'off'+ - after_delaytype: stringautosave_delay:type: integerformat_on_save:type: booleanrequired:- - autosave- - autosave_delay- - format_on_save+ - autosave+ - autosave_delay+ - format_on_savetype: objectserver:properties:browser:oneOf:- - enum:- - default- type: string- - type: string+ - enum:+ - default+ type: string+ - type: stringfollow_symlink:type: booleanrequired:- - browser- - follow_symlink+ - browser+ - follow_symlinktype: objectsharing:properties:@@ -1772,14 +1792,14 @@ components:type: booleantype: objectrequired:- - completion- - display- - formatting- - keymap- - runtime- - save- - server- - package_management+ - completion+ - display+ - formatting+ - keymap+ - runtime+ - save+ - server+ - package_managementtype: objectMarimoExceptionRaisedError:properties:@@ -1792,12 +1812,12 @@ components:type: stringtype:enum:- - exception+ - exceptiontype: stringrequired:- - msg- - exception_type- - type+ - msg+ - exception_type+ - typetype: objectMarimoFile:properties:@@ -1815,8 +1835,8 @@ components:nullable: truetype: stringrequired:- - name- - path+ - name+ - pathtype: objectMarimoInternalError:properties:@@ -1826,21 +1846,21 @@ components:type: stringtype:enum:- - internal+ - internaltype: stringrequired:- - error_id- - type- - msg+ - error_id+ - type+ - msgtype: objectMarimoInterruptionError:properties:type:enum:- - interruption+ - interruptiontype: stringrequired:- - type+ - typetype: objectMarimoStrictExecutionError:properties:@@ -1853,12 +1873,12 @@ components:type: stringtype:enum:- - strict-exception+ - strict-exceptiontype: stringrequired:- - msg- - ref- - type+ - msg+ - ref+ - typetype: objectMarimoSyntaxError:properties:@@ -1866,66 +1886,66 @@ components:type: stringtype:enum:- - syntax+ - syntaxtype: stringrequired:- - msg- - type+ - msg+ - typetype: objectMessageOperation:oneOf:- - $ref: '#/components/schemas/CellOp'- - $ref: '#/components/schemas/FunctionCallResult'- - $ref: '#/components/schemas/SendUIElementMessage'- - $ref: '#/components/schemas/RemoveUIElements'- - $ref: '#/components/schemas/Reload'- - $ref: '#/components/schemas/Reconnected'- - $ref: '#/components/schemas/Interrupted'- - $ref: '#/components/schemas/CompletedRun'- - $ref: '#/components/schemas/KernelReady'- - $ref: '#/components/schemas/CompletionResult'- - $ref: '#/components/schemas/Alert'- - $ref: '#/components/schemas/Banner'- - $ref: '#/components/schemas/MissingPackageAlert'- - $ref: '#/components/schemas/InstallingPackageAlert'- - $ref: '#/components/schemas/Variables'- - $ref: '#/components/schemas/VariableValues'- - $ref: '#/components/schemas/QueryParamsSet'- - $ref: '#/components/schemas/QueryParamsAppend'- - $ref: '#/components/schemas/QueryParamsDelete'- - $ref: '#/components/schemas/QueryParamsClear'- - $ref: '#/components/schemas/Datasets'- - $ref: '#/components/schemas/DataColumnPreview'- - $ref: '#/components/schemas/SQLTablePreview'- - $ref: '#/components/schemas/SQLTableListPreview'- - $ref: '#/components/schemas/DataSourceConnections'- - $ref: '#/components/schemas/SecretKeysResult'- - $ref: '#/components/schemas/FocusCell'- - $ref: '#/components/schemas/UpdateCellCodes'- - $ref: '#/components/schemas/UpdateCellIdsRequest'+ - $ref: '#/components/schemas/CellOp'+ - $ref: '#/components/schemas/FunctionCallResult'+ - $ref: '#/components/schemas/SendUIElementMessage'+ - $ref: '#/components/schemas/RemoveUIElements'+ - $ref: '#/components/schemas/Reload'+ - $ref: '#/components/schemas/Reconnected'+ - $ref: '#/components/schemas/Interrupted'+ - $ref: '#/components/schemas/CompletedRun'+ - $ref: '#/components/schemas/KernelReady'+ - $ref: '#/components/schemas/CompletionResult'+ - $ref: '#/components/schemas/Alert'+ - $ref: '#/components/schemas/Banner'+ - $ref: '#/components/schemas/MissingPackageAlert'+ - $ref: '#/components/schemas/InstallingPackageAlert'+ - $ref: '#/components/schemas/Variables'+ - $ref: '#/components/schemas/VariableValues'+ - $ref: '#/components/schemas/QueryParamsSet'+ - $ref: '#/components/schemas/QueryParamsAppend'+ - $ref: '#/components/schemas/QueryParamsDelete'+ - $ref: '#/components/schemas/QueryParamsClear'+ - $ref: '#/components/schemas/Datasets'+ - $ref: '#/components/schemas/DataColumnPreview'+ - $ref: '#/components/schemas/SQLTablePreview'+ - $ref: '#/components/schemas/SQLTableListPreview'+ - $ref: '#/components/schemas/DataSourceConnections'+ - $ref: '#/components/schemas/SecretKeysResult'+ - $ref: '#/components/schemas/FocusCell'+ - $ref: '#/components/schemas/UpdateCellCodes'+ - $ref: '#/components/schemas/UpdateCellIdsRequest'MimeType:enum:- - application/json- - application/vnd.marimo+error- - application/vnd.marimo+traceback- - application/vnd.marimo+mimebundle- - application/vnd.vega.v5+json- - application/vnd.vegalite.v5+json- - application/vnd.jupyter.widget-view+json- - image/png- - image/svg+xml- - image/tiff- - image/avif- - image/bmp- - image/gif- - image/jpeg- - video/mp4- - video/mpeg- - text/html- - text/plain- - text/markdown- - text/latex- - text/csv+ - application/json+ - application/vnd.marimo+error+ - application/vnd.marimo+traceback+ - application/vnd.marimo+mimebundle+ - application/vnd.vega.v5+json+ - application/vnd.vegalite.v5+json+ - application/vnd.jupyter.widget-view+json+ - image/png+ - image/svg+xml+ - image/tiff+ - image/avif+ - image/bmp+ - image/gif+ - image/jpeg+ - video/mp4+ - video/mpeg+ - text/html+ - text/plain+ - text/markdown+ - text/latex+ - text/csvtype: stringMissingPackageAlert:properties:@@ -1933,16 +1953,16 @@ components:type: booleanname:enum:- - missing-package-alert+ - missing-package-alerttype: stringpackages:items:type: stringtype: arrayrequired:- - packages- - isolated- - name+ - packages+ - isolated+ - nametype: objectMultipleDefinitionError:properties:@@ -1954,29 +1974,29 @@ components:type: stringtype:enum:- - multiple-defs+ - multiple-defstype: stringrequired:- - name- - cells- - type+ - name+ - cells+ - typetype: objectNonNestedLiteral:oneOf:- - type: integer- - type: number- - format: date- type: string- - format: time- type: string- - format: date-time- type: string- - format: duration- type: string- - type: string- - type: boolean- - format: byte- type: string+ - type: integer+ - type: number+ - format: date+ type: string+ - format: time+ type: string+ - format: date-time+ type: string+ - format: duration+ type: string+ - type: string+ - type: boolean+ - format: byte+ type: stringOpenAiConfig:properties:api_key:@@ -1996,22 +2016,22 @@ components:properties:tutorialId:oneOf:- - enum:- - intro- - dataflow- - ui- - markdown- - plots- - sql- - layout- - fileformat- - for-jupyter-users- type: string- - enum:- - markdown-format- type: string+ - enum:+ - intro+ - dataflow+ - ui+ - markdown+ - plots+ - sql+ - layout+ - fileformat+ - for-jupyter-users+ type: string+ - enum:+ - markdown-format+ type: stringrequired:- - tutorialId+ - tutorialIdtype: objectPackageDescription:properties:@@ -2020,8 +2040,8 @@ components:version:type: stringrequired:- - name- - version+ - name+ - versiontype: objectPackageOperationResponse:properties:@@ -2031,7 +2051,7 @@ components:success:type: booleanrequired:- - success+ - successtype: objectPdbRequest:properties:@@ -2041,14 +2061,14 @@ components:$ref: '#/components/schemas/HTTPRequest'nullable: truerequired:- - cellId+ - cellIdtype: objectPreviewDataSourceConnectionRequest:properties:engine:type: stringrequired:- - engine+ - enginetype: objectPreviewDatasetColumnRequest:properties:@@ -2061,18 +2081,18 @@ components:type: stringsourceType:enum:- - local- - duckdb- - connection- - catalog+ - local+ - duckdb+ - connection+ - catalogtype: stringtableName:type: stringrequired:- - sourceType- - source- - tableName- - columnName+ - sourceType+ - source+ - tableName+ - columnNametype: objectPreviewSQLTableListRequest:properties:@@ -2085,10 +2105,10 @@ components:schema:type: stringrequired:- - requestId- - engine- - database- - schema+ - requestId+ - engine+ - database+ - schematype: objectPreviewSQLTableRequest:properties:@@ -2103,11 +2123,11 @@ components:tableName:type: stringrequired:- - requestId- - engine- - database- - schema- - tableName+ - requestId+ - engine+ - database+ - schema+ - tableNametype: objectQueryParamsAppend:properties:@@ -2115,23 +2135,23 @@ components:type: stringname:enum:- - query-params-append+ - query-params-appendtype: stringvalue:type: stringrequired:- - key- - value- - name+ - key+ - value+ - nametype: objectQueryParamsClear:properties:name:enum:- - query-params-clear+ - query-params-cleartype: stringrequired:- - name+ - nametype: objectQueryParamsDelete:properties:@@ -2139,14 +2159,14 @@ components:type: stringname:enum:- - query-params-delete+ - query-params-deletetype: stringvalue:nullable: truetype: stringrequired:- - key- - name+ - key+ - nametype: objectQueryParamsSet:properties:@@ -2154,25 +2174,25 @@ components:type: stringname:enum:- - query-params-set+ - query-params-settype: stringvalue:oneOf:- - type: string- - items:- type: string- type: array+ - type: string+ - items:+ type: string+ type: arrayrequired:- - key- - value- - name+ - key+ - value+ - nametype: objectReadCodeResponse:properties:contents:type: stringrequired:- - contents+ - contentstype: objectRecentFilesResponse:properties:@@ -2181,32 +2201,32 @@ components:$ref: '#/components/schemas/MarimoFile'type: arrayrequired:- - files+ - filestype: objectReconnected:properties:name:enum:- - reconnected+ - reconnectedtype: stringrequired:- - name+ - nametype: objectReload:properties:name:enum:- - reload+ - reloadtype: stringrequired:- - name+ - nametype: objectRemovePackageRequest:properties:package:type: stringrequired:- - package+ - packagetype: objectRemoveUIElements:properties:@@ -2214,25 +2234,25 @@ components:type: stringname:enum:- - remove-ui-elements+ - remove-ui-elementstype: stringrequired:- - cell_id- - name+ - cell_id+ - nametype: objectRenameFileRequest:properties:filename:type: stringrequired:- - filename+ - filenametype: objectRenameRequest:properties:filename:type: stringrequired:- - filename+ - filenametype: objectRunRequest:properties:@@ -2248,8 +2268,8 @@ components:$ref: '#/components/schemas/HTTPRequest'nullable: truerequired:- - cellIds- - codes+ - cellIds+ - codestype: objectRunningNotebooksResponse:properties:@@ -2258,14 +2278,14 @@ components:$ref: '#/components/schemas/MarimoFile'type: arrayrequired:- - files+ - filestype: objectRuntimeState:enum:- - idle- - queued- - running- - disabled-transitively+ - idle+ - queued+ - running+ - disabled-transitivelytype: stringSQLTableListPreview:properties:@@ -2274,7 +2294,7 @@ components:type: stringname:enum:- - sql-table-list-preview+ - sql-table-list-previewtype: stringrequest_id:type: string@@ -2283,9 +2303,9 @@ components:$ref: '#/components/schemas/DataTable'type: arrayrequired:- - request_id- - tables- - name+ - request_id+ - tables+ - nametype: objectSQLTablePreview:properties:@@ -2294,7 +2314,7 @@ components:type: stringname:enum:- - sql-table-preview+ - sql-table-previewtype: stringrequest_id:type: string@@ -2302,8 +2322,8 @@ components:$ref: '#/components/schemas/DataTable'nullable: truerequired:- - request_id- - name+ - request_id+ - nametype: objectSaveAppConfigurationRequest:properties:@@ -2311,7 +2331,7 @@ components:additionalProperties: {}type: objectrequired:- - config+ - configtype: objectSaveNotebookRequest:properties:@@ -2340,19 +2360,19 @@ components:persist:type: booleanrequired:- - cellIds- - codes- - names- - configs- - filename- - persist+ - cellIds+ - codes+ - names+ - configs+ - filename+ - persisttype: objectSaveUserConfigurationRequest:properties:config:$ref: '#/components/schemas/MarimoConfig'required:- - config+ - configtype: objectSchema:properties:@@ -2363,8 +2383,8 @@ components:$ref: '#/components/schemas/DataTable'type: arrayrequired:- - name- - tables+ - name+ - tablestype: objectSchemaColumn:properties:@@ -2376,9 +2396,9 @@ components:type:type: stringrequired:- - name- - type- - sampleValues+ - name+ - type+ - sampleValuestype: objectSchemaTable:properties:@@ -2389,14 +2409,14 @@ components:name:type: stringrequired:- - name- - columns+ - name+ - columnstype: objectSecretKeysResult:properties:name:enum:- - secret-keys-result+ - secret-keys-resulttype: stringrequest_id:type: string@@ -2405,9 +2425,9 @@ components:$ref: '#/components/schemas/SecretKeysWithProvider'type: arrayrequired:- - request_id- - secrets- - name+ - request_id+ - secrets+ - nametype: objectSecretKeysWithProvider:properties:@@ -2419,13 +2439,13 @@ components:type: stringprovider:enum:- - env- - dotenv+ - env+ - dotenvtype: stringrequired:- - provider- - name- - keys+ - provider+ - name+ - keystype: objectSendUIElementMessage:properties:@@ -2442,14 +2462,14 @@ components:type: stringname:enum:- - send-ui-element-message+ - send-ui-element-messagetype: stringui_element:nullable: truetype: stringrequired:- - message- - name+ - message+ - nametype: objectSetCellConfigRequest:properties:@@ -2459,7 +2479,7 @@ components:type: objecttype: objectrequired:- - configs+ - configstype: objectSetModelMessageRequest:properties:@@ -2474,22 +2494,22 @@ components:items:items:oneOf:- - type: string- - type: integer+ - type: string+ - type: integertype: arraytype: arraystate:additionalProperties: {}type: objectrequired:- - state- - bufferPaths+ - state+ - bufferPathstype: objectmodelId:type: stringrequired:- - modelId- - message+ - modelId+ - messagetype: objectSetUIElementValueRequest:properties:@@ -2506,43 +2526,43 @@ components:items: {}type: arrayrequired:- - objectIds- - values- - token+ - objectIds+ - values+ - tokentype: objectSetUserConfigRequest:properties:config:$ref: '#/components/schemas/MarimoConfig'required:- - config+ - configtype: objectSetupRootError:properties:edges_with_vars:items:prefixItems:- - type: string- - items:- type: string- type: array- - type: string+ - type: string+ - items:+ type: string+ type: array+ - type: stringtype: arraytype: arraytype:enum:- - setup-refs+ - setup-refstype: stringrequired:- - edges_with_vars- - type+ - edges_with_vars+ - typetype: objectShutdownSessionRequest:properties:sessionId:type: stringrequired:- - sessionId+ - sessionIdtype: objectSnippet:properties:@@ -2553,8 +2573,8 @@ components:title:type: stringrequired:- - title- - sections+ - title+ - sectionstype: objectSnippetSection:properties:@@ -2567,7 +2587,7 @@ components:id:type: stringrequired:- - id+ - idtype: objectSnippets:properties:@@ -2576,14 +2596,14 @@ components:$ref: '#/components/schemas/Snippet'type: arrayrequired:- - snippets+ - snippetstype: objectStdinRequest:properties:text:type: stringrequired:- - text+ - texttype: objectStopRequest:properties: {}@@ -2593,7 +2613,7 @@ components:success:type: booleanrequired:- - success+ - successtype: objectUnknownError:properties:@@ -2601,11 +2621,11 @@ components:type: stringtype:enum:- - unknown+ - unknowntype: stringrequired:- - msg- - type+ - msg+ - typetype: objectUpdateCellCodes:properties:@@ -2621,13 +2641,13 @@ components:type: arrayname:enum:- - update-cell-codes+ - update-cell-codestype: stringrequired:- - cell_ids- - codes- - code_is_stale- - name+ - cell_ids+ - codes+ - code_is_stale+ - nametype: objectUpdateCellIdsRequest:properties:@@ -2637,11 +2657,11 @@ components:type: arrayname:enum:- - update-cell-ids+ - update-cell-idstype: stringrequired:- - cell_ids- - name+ - cell_ids+ - nametype: objectUpdateComponentValuesRequest:properties:@@ -2653,8 +2673,8 @@ components:items: {}type: arrayrequired:- - objectIds- - values+ - objectIds+ - valuestype: objectVariableContext:properties:@@ -2664,9 +2684,9 @@ components:valueType:type: stringrequired:- - name- - valueType- - previewValue+ - name+ - valueType+ - previewValuetype: objectVariableDeclaration:properties:@@ -2681,9 +2701,9 @@ components:type: stringtype: arrayrequired:- - name- - declared_by- - used_by+ - name+ - declared_by+ - used_bytype: objectVariableValue:properties:@@ -2696,42 +2716,42 @@ components:nullable: truetype: stringrequired:- - name+ - nametype: objectVariableValues:properties:name:enum:- - variable-values+ - variable-valuestype: stringvariables:items:$ref: '#/components/schemas/VariableValue'type: arrayrequired:- - variables- - name+ - variables+ - nametype: objectVariables:properties:name:enum:- - variables+ - variablestype: stringvariables:items:$ref: '#/components/schemas/VariableDeclaration'type: arrayrequired:- - variables- - name+ - variables+ - nametype: objectWorkspaceFilesRequest:properties:includeMarkdown:type: booleanrequired:- - includeMarkdown+ - includeMarkdowntype: objectWorkspaceFilesResponse:properties:@@ -2742,8 +2762,8 @@ components:root:type: stringrequired:- - root- - files+ - root+ - filestype: objectinfo:title: marimo API@@ -2753,12 +2773,12 @@ paths:/@file/{filename_and_length}:get:parameters:- - description: The filename and byte length of the virtual file- in: path- name: filename_and_length- required: true- schema:- type: string+ - description: The filename and byte length of the virtual file+ in: path+ name: filename_and_length+ required: true+ schema:+ type: stringresponses:200:content:@@ -3603,7 +3623,7 @@ paths:percent:type: numberrequired:- - percent+ - percenttype: objectgpu:items:@@ -3621,17 +3641,17 @@ paths:used:type: integerrequired:- - total- - used- - free- - percent+ - total+ - used+ - free+ - percenttype: objectname:type: stringrequired:- - index- - memory- - name+ - index+ - memory+ - nametype: objecttype: arraykernel:@@ -3652,22 +3672,22 @@ paths:used:type: integerrequired:- - total- - available- - percent- - used- - free+ - total+ - available+ - percent+ - used+ - freetype: objectserver:properties:memory:type: integerrequired:- - memory+ - memorytype: objectrequired:- - memory- - cpu+ - memory+ - cputype: objectdescription: Get the current memory and CPU usage of the application/api/version:@@ -3705,5 +3725,4 @@ paths:type: stringsummary: Submit login formtags:- - auth-+ - authdiff --git a/packages/openapi/src/api.ts b/packages/openapi/src/api.tsindex 77ec296076..5a545f24a8 100644--- a/packages/openapi/src/api.ts+++ b/packages/openapi/src/api.ts@@ -2572,6 +2572,13 @@ export interface components {max_tokens?: number;/** @enum {string} */mode?: "ask" | "manual";+ models?: {+ autocomplete_model?: string;+ chat_model?: string;+ custom_models: string[];+ edit_model?: string;+ displayed_models: string[];+ };ollama?: components["schemas"]["OpenAiConfig"];open_ai?: components["schemas"]["OpenAiConfig"];open_ai_compatible?: components["schemas"]["OpenAiConfig"];diff --git a/tests/_config/test_config.py b/tests/_config/test_config.pyindex c5a1fd953c..23b8fbc8ae 100644--- a/tests/_config/test_config.py+++ b/tests/_config/test_config.py@@ -57,8 +57,14 @@ def test_merge_config() -> None:},))- assert prev_config["ai"]["open_ai"]["api_key"] == "super_secret"- assert prev_config["ai"]["google"]["api_key"] == "google_secret"+ assert (+ prev_config.get("ai", {}).get("open_ai", {}).get("api_key")+ == "super_secret"+ )+ assert (+ prev_config.get("ai", {}).get("google", {}).get("api_key")+ == "google_secret"+ )new_config = merge_config(prev_config,@@ -74,9 +80,17 @@ def test_merge_config() -> None:),)- assert new_config["ai"]["open_ai"]["api_key"] == "super_secret"- assert new_config["ai"]["open_ai"]["model"] == "davinci"- assert new_config["ai"]["google"]["api_key"] == "google_secret"+ assert (+ new_config.get("ai", {}).get("open_ai", {}).get("api_key")+ == "super_secret"+ )+ assert (+ new_config.get("ai", {}).get("open_ai", {}).get("model") == "davinci"+ )+ assert (+ new_config.get("ai", {}).get("google", {}).get("api_key")+ == "google_secret"+ )def test_merge_config_with_keymap_overrides() -> None:@@ -108,8 +122,11 @@ def test_merge_config_with_keymap_overrides() -> None:)assert new_config["keymap"]["preset"] == "vim"- assert "run-all" not in new_config["keymap"]["overrides"]- assert new_config["keymap"]["overrides"]["run-cell"] == "ctrl-enter"+ assert "run-all" not in new_config.get("keymap", {}).get("overrides", {})+ assert (+ new_config.get("keymap", {}).get("overrides", {}).get("run-cell")+ == "ctrl-enter"+ )new_config = merge_config(prev_config,@@ -122,4 +139,258 @@ def test_merge_config_with_keymap_overrides() -> None:)assert new_config["keymap"]["preset"] == "vim"- assert new_config["keymap"]["overrides"] == {}+ assert new_config.get("keymap", {}).get("overrides", {}) == {}+++def test_merge_config_openai_model_fallback() -> None:+ """Test that openai_model is used as fallback for missing chat_model and edit_model."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ ai={+ "open_ai": {+ "api_key": "test_key",+ "model": "gpt-4",+ },+ }+ ),+ )++ # When neither chat_model nor edit_model are present, openai_model should be used for both+ assert (+ new_config.get("ai", {}).get("models", {}).get("chat_model") == "gpt-4"+ )+ assert (+ new_config.get("ai", {}).get("models", {}).get("edit_model") == "gpt-4"+ )+ assert new_config.get("ai", {}).get("open_ai", {}).get("model") == "gpt-4"+++def test_merge_config_existing_chat_edit_models_no_fallback() -> None:+ """Test that existing chat_model and edit_model are preserved (no fallback)."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ ai={+ "open_ai": {+ "api_key": "test_key",+ "model": "gpt-4",+ },+ "models": {+ "chat_model": "claude-3-sonnet",+ "edit_model": "gpt-3.5-turbo",+ "displayed_models": [],+ "custom_models": [],+ },+ }+ ),+ )++ # Existing models should be preserved, not overridden by openai_model+ assert (+ new_config.get("ai", {}).get("models", {}).get("chat_model")+ == "claude-3-sonnet"+ )+ assert (+ new_config.get("ai", {}).get("models", {}).get("edit_model")+ == "gpt-3.5-turbo"+ )+ assert new_config.get("ai", {}).get("open_ai", {}).get("model") == "gpt-4"+++def test_merge_config_no_openai_model_no_fallback() -> None:+ """Test that no fallback happens when openai_model is not present."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ ai={+ "open_ai": {+ "api_key": "test_key",+ },+ }+ ),+ )++ # No models should be set since openai_model is not present+ assert "chat_model" not in new_config.get("ai", {}).get("models", {})+ assert "edit_model" not in new_config.get("ai", {}).get("models", {})+++def test_merge_config_partial_model_config() -> None:+ """Test fallback when only one of chat_model or edit_model is present."""+ base_config = merge_default_config(PartialMarimoConfig())++ # Test with only chat_model present+ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ ai={+ "open_ai": {+ "api_key": "test_key",+ "model": "gpt-4",+ },+ "models": {+ "chat_model": "claude-3-sonnet",+ "displayed_models": [],+ "custom_models": [],+ },+ }+ ),+ )++ # chat_model should be preserved, but no fallback should happen since chat_model exists+ assert (+ new_config.get("ai", {}).get("models", {}).get("chat_model")+ == "claude-3-sonnet"+ )+ assert "edit_model" not in new_config.get("ai", {}).get("models", {})++ # Test with only edit_model present+ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ ai={+ "open_ai": {+ "api_key": "test_key",+ "model": "gpt-4",+ },+ "models": {+ "edit_model": "gpt-3.5-turbo",+ "displayed_models": [],+ "custom_models": [],+ },+ }+ ),+ )++ # edit_model should be preserved, but no fallback should happen since edit_model exists+ assert (+ new_config.get("ai", {}).get("models", {}).get("edit_model")+ == "gpt-3.5-turbo"+ )+ assert "chat_model" not in new_config.get("ai", {}).get("models", {})+++def test_merge_config_empty_models_with_openai_model() -> None:+ """Test fallback when models config exists but chat_model and edit_model are empty/None."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ ai={+ "open_ai": {+ "api_key": "test_key",+ "model": "gpt-4",+ },+ "models": {+ "chat_model": "",+ "edit_model": "",+ "displayed_models": [],+ "custom_models": [],+ },+ }+ ),+ )++ # Empty/None values should trigger fallback to openai_model+ assert (+ new_config.get("ai", {}).get("models", {}).get("chat_model") == "gpt-4"+ )+ assert (+ new_config.get("ai", {}).get("models", {}).get("edit_model") == "gpt-4"+ )+++def test_merge_config_completion_model_migration() -> None:+ """Test that completion.model is migrated to ai.models.autocomplete_model."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ completion={+ "activate_on_typing": True,+ "copilot": "custom",+ "model": "custom-model-v1",+ }+ ),+ )++ # completion.model should be migrated to ai.models.autocomplete_model+ assert (+ new_config.get("ai", {}).get("models", {}).get("autocomplete_model")+ == "custom-model-v1"+ )+ # Original completion.model should still exist for backward compatibility+ assert new_config.get("completion", {}).get("model") == "custom-model-v1"+++def test_merge_config_completion_model_no_migration_when_autocomplete_exists() -> (+ None+):+ """Test that completion.model is not migrated when ai.models.autocomplete_model already exists."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ completion={+ "activate_on_typing": True,+ "copilot": "custom",+ "model": "old-model",+ },+ ai={+ "models": {+ "autocomplete_model": "new-model",+ "displayed_models": [],+ "custom_models": [],+ }+ },+ ),+ )++ # ai.models.autocomplete_model should not be overridden+ assert (+ new_config.get("ai", {}).get("models", {}).get("autocomplete_model")+ == "new-model"+ )+ # Original completion.model should still exist+ assert new_config.get("completion", {}).get("model") == "old-model"+++def test_merge_config_completion_model_migration_creates_ai_config() -> None:+ """Test that completion.model migration creates ai config when it doesn't exist."""+ base_config = merge_default_config(PartialMarimoConfig())++ new_config = merge_config(+ base_config,+ PartialMarimoConfig(+ completion={+ "activate_on_typing": True,+ "copilot": "custom",+ "model": "custom-model",+ }+ ),+ )++ # Should create ai.models config with the migrated model+ assert "ai" in new_config+ assert "models" in new_config.get("ai", {})+ assert (+ new_config.get("ai", {}).get("models", {}).get("autocomplete_model")+ == "custom-model"+ )+ assert (+ new_config.get("ai", {}).get("models", {}).get("displayed_models")+ == []+ )+ assert (+ new_config.get("ai", {}).get("models", {}).get("custom_models") == []+ )diff --git a/tests/_server/ai/test_ai_config.py b/tests/_server/ai/test_ai_config.pyindex e379e49ed6..2ac01fb1e3 100644--- a/tests/_server/ai/test_ai_config.py+++ b/tests/_server/ai/test_ai_config.py@@ -10,7 +10,6 @@ from starlette.exceptions import HTTPExceptionfrom marimo._config.config import (AiConfig,- CompletionConfig,MarimoConfig,)from marimo._server.ai.config import (@@ -20,8 +19,10 @@ from marimo._server.ai.config import (_get_ai_config,_get_base_url,_get_key,+ get_autocomplete_model,+ get_chat_model,+ get_edit_model,get_max_tokens,- get_model,)from marimo._server.ai.tools import Toolfrom marimo._server.api.status import HTTPStatus@@ -178,21 +179,6 @@ class TestAnyProviderConfig:# Note: base_url is None because _get_base_url doesn't get "Bedrock" name parameterassert provider_config.base_url is None- def test_for_completion(self):- """Test completion configuration."""- config: CompletionConfig = {- "activate_on_typing": True,- "copilot": "custom",- "api_key": "test-completion-key",- "base_url": "https://completion.service.com",- }-- provider_config = AnyProviderConfig.for_completion(config)-- assert provider_config.api_key == "test-completion-key"- assert provider_config.base_url == "https://completion.service.com"- assert provider_config.tools == [] # Completion never uses tools-def test_for_model_openai(self) -> None:"""Test for_model with OpenAI model."""config: AiConfig = {"open_ai": {"api_key": "test-key"}}@@ -685,27 +671,38 @@ class TestUtilityFunctions:def test_get_model_with_openai_config(self):"""Test getting model from OpenAI config."""config: AiConfig = {- "open_ai": {"model": "gpt-4", "api_key": "test-key"}+ "models": {+ "chat_model": "gpt-4",+ "edit_model": "gpt-5",+ "displayed_models": [],+ "custom_models": [],+ },+ "open_ai": {"api_key": "test-key"},}- result = get_model(config)-+ result = get_chat_model(config)assert result == "gpt-4"+ result = get_edit_model(config)+ assert result == "gpt-5"+def test_get_model_default(self):"""Test getting default model when not specified."""- config: AiConfig = {"open_ai": {"api_key": "test-key"}}-- result = get_model(config)+ config: AiConfig = {+ "models": {+ "displayed_models": [],+ "custom_models": [],+ },+ "open_ai": {"api_key": "test-key"},+ }+ result = get_chat_model(config)assert result == DEFAULT_MODEL- def test_get_model_no_openai_config(self):- """Test getting default model when no OpenAI config."""- config: AiConfig = {}-- result = get_model(config)+ result = get_edit_model(config)+ assert result == DEFAULT_MODEL+ result = get_autocomplete_model({"ai": config})assert result == DEFAULT_MODELdef test_get_max_tokens_from_config(self):@@ -747,6 +744,98 @@ class TestUtilityFunctions:assert result == DEFAULT_MAX_TOKENS+ def test_get_autocomplete_model(self) -> None:+ """Test get_autocomplete_model with new ai.models.autocomplete_model config."""++ config: AiConfig = {+ "models": {+ "chat_model": "openai/gpt-4o",+ "edit_model": "openai/gpt-4o-mini",+ "autocomplete_model": "openai/gpt-3.5-turbo-instruct",+ "displayed_models": [],+ "custom_models": [],+ }+ }++ assert (+ get_autocomplete_model({"ai": config})+ == "openai/gpt-3.5-turbo-instruct"+ )++ def test_get_chat_model(self) -> None:+ """Test get_chat_model with new ai.models.chat_model config."""++ config: AiConfig = {+ "models": {+ "chat_model": "anthropic/claude-3-5-sonnet-20241022",+ "edit_model": "openai/gpt-4o-mini",+ "displayed_models": [],+ "custom_models": [],+ }+ }++ assert get_chat_model(config) == "anthropic/claude-3-5-sonnet-20241022"++ def test_get_edit_model(self) -> None:+ """Test get_edit_model with new ai.models.edit_model config."""++ config: AiConfig = {+ "models": {+ "chat_model": "openai/gpt-4o",+ "edit_model": "anthropic/claude-3-5-haiku-20241022",+ "displayed_models": [],+ "custom_models": [],+ }+ }++ assert get_edit_model(config) == "anthropic/claude-3-5-haiku-20241022"++ def test_get_edit_model_fallback_to_chat_model(self) -> None:+ """Test get_edit_model falls back to chat_model when edit_model is not set."""++ config: AiConfig = {+ "models": {+ "chat_model": "openai/gpt-4o",+ "displayed_models": [],+ "custom_models": [],+ # Note: no edit_model+ }+ }++ assert get_edit_model(config) == "openai/gpt-4o"++ def test_get_models_with_legacy_openai_config(self) -> None:+ """Test that the new get_*_model functions work with legacy open_ai.model config."""+ config: AiConfig = {+ "open_ai": {+ "api_key": "test-key",+ "model": "gpt-4-legacy",+ }+ }++ # Should fall back to open_ai.model for both chat and edit+ assert get_chat_model(config) == "gpt-4-legacy"+ assert get_edit_model(config) == "gpt-4-legacy"+ assert get_autocomplete_model({"ai": config}) == DEFAULT_MODEL++ def test_for_model_with_autocomplete_model(self) -> None:+ """Test AnyProviderConfig.for_model works with autocomplete models from new config."""+ config: AiConfig = {+ "open_ai": {"api_key": "test-key"},+ "models": {+ "autocomplete_model": "openai/gpt-3.5-turbo-instruct",+ "displayed_models": [],+ "custom_models": [],+ },+ }++ provider_config = AnyProviderConfig.for_model(+ "openai/gpt-3.5-turbo-instruct", config+ )++ assert provider_config.api_key == "test-key"+ assert provider_config.tools == [] # Autocomplete should have no tools+class TestEdgeCases:"""Tests for edge cases and error conditions."""diff --git a/tests/_server/api/endpoints/test_ai.py b/tests/_server/api/endpoints/test_ai.pyindex 48ad04aaaf..f0a658a362 100644--- a/tests/_server/api/endpoints/test_ai.py+++ b/tests/_server/api/endpoints/test_ai.py@@ -311,9 +311,7 @@ class TestOpenAiEndpoints:},)assert response.status_code == 400, response.text- assert response.json() == {- "detail": "AI completion API key not configured"- }+ assert response.json() == {"detail": "OpenAI API key not configured"}@staticmethod@with_session(SESSION_ID)@@ -486,10 +484,9 @@ class TestGoogleAiEndpoints:"ai": {"open_ai": {"model": "gemini-1.5-pro"},"google": {"api_key": "fake-key"},- },- "completion": {- "model": "gemini-1.5-pro-for-inline-completion",- "api_key": "fake-key",+ "models": {+ "autocomplete_model": "google/gemini-1.5-pro-for-inline-completion",+ },},}@@ -598,11 +595,10 @@ def _openai_config():"open_ai": {"api_key": "fake-api","model": "openai/some-openai-model",- }- },- "completion": {- "model": "gpt-marimo-for-inline-completion",- "api_key": "fake-api",+ },+ "models": {+ "autocomplete_model": "gpt-marimo-for-inline-completion",+ },},}@@ -613,11 +609,10 @@ def _openai_config_custom_model():"open_ai": {"api_key": "fake-api","model": "gpt-marimo",- }- },- "completion": {- "model": "gpt-marimo-for-inline-completion",- "api_key": "fake-api",+ },+ "models": {+ "autocomplete_model": "gpt-marimo-for-inline-completion",+ },},}@@ -629,22 +624,21 @@ def _openai_config_custom_base_url():"api_key": "fake-api","base_url": "https://my-openai-instance.com","model": "openai/some-openai-model-with-base-url",- }- },- "completion": {- "model": "gpt-marimo-for-inline-completion",- "api_key": "fake-api",- "base_url": "https://my-openai-instance.com",+ },+ "models": {+ "autocomplete_model": "gpt-marimo-for-inline-completion",+ },},}def _no_openai_config():return {- "ai": {"open_ai": {"api_key": "", "model": ""}},- "completion": {- "model": "gpt-marimo-for-inline-completion",- "api_key": "",+ "ai": {+ "open_ai": {"api_key": "", "model": ""},+ "models": {+ "autocomplete_model": "gpt-marimo-for-inline-completion",+ },},}@@ -654,10 +648,9 @@ def _no_anthropic_config():"ai": {"open_ai": {"model": "claude-3.5"},"anthropic": {"api_key": ""},- },- "completion": {- "model": "claude-3.5-for-inline-completion",- "api_key": "",+ "models": {+ "autocomplete_model": "claude-3.5-for-inline-completion",+ },},}@@ -667,10 +660,9 @@ def _anthropic_config():"ai": {"open_ai": {"model": "claude-3.5"},"anthropic": {"api_key": "fake-key"},- },- "completion": {- "model": "claude-3.5-for-inline-completion",- "api_key": "fake-key",+ "models": {+ "autocomplete_model": "anthropic/claude-3.5-for-inline-completion",+ },},}@@ -680,10 +672,9 @@ def _google_ai_config():"ai": {"open_ai": {"model": "gemini-1.5-pro"},"google": {"api_key": "fake-key"},- },- "completion": {- "model": "gemini-1.5-pro-for-inline-completion",- "api_key": "fake-key",+ "models": {+ "autocomplete_model": "google/gemini-1.5-pro-for-inline-completion",+ },},}diff --git a/tests/_server/api/endpoints/test_resume_session.py b/tests/_server/api/endpoints/test_resume_session.pyindex 0d5004dfcb..c6f557e2c8 100644--- a/tests/_server/api/endpoints/test_resume_session.py+++ b/tests/_server/api/endpoints/test_resume_session.py@@ -6,6 +6,8 @@ from contextlib import contextmanagerfrom dataclasses import asdictfrom typing import TYPE_CHECKING, Any, Optional+import pytest+from marimo._config.manager import UserConfigManagerfrom marimo._messaging.ops import CellOp, KernelCapabilities, KernelReadyfrom marimo._server.sessions import Session@@ -291,6 +293,7 @@ def test_restart_session(client: TestClient) -> None:client.post("/api/kernel/shutdown", headers=HEADERS)[email protected](reruns=5)def test_resume_session_with_watch(client: TestClient) -> None:session_manager = get_session_manager(client)session_manager.watch = Truediff --git a/tests/_server/templates/snapshots/export1.txt b/tests/_server/templates/snapshots/export1.txtindex 2ec18e4e2a..25530a6618 100644--- a/tests/_server/templates/snapshots/export1.txt+++ b/tests/_server/templates/snapshots/export1.txt@@ -59,7 +59,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},"configOverrides": {"formatting": {"line_length": 100}},"appConfig": {"sql_output": "auto", "width": "compact"},"view": {"showAppCode": true},diff --git a/tests/_server/templates/snapshots/export2.txt b/tests/_server/templates/snapshots/export2.txtindex 4bf09ef228..253c5e77fc 100644--- a/tests/_server/templates/snapshots/export2.txt+++ b/tests/_server/templates/snapshots/export2.txt@@ -59,7 +59,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},"configOverrides": {"formatting": {"line_length": 100}},"appConfig": {"sql_output": "auto", "width": "compact"},"view": {"showAppCode": true},diff --git a/tests/_server/templates/snapshots/export3.txt b/tests/_server/templates/snapshots/export3.txtindex f87e27b11f..0990b213b6 100644--- a/tests/_server/templates/snapshots/export3.txt+++ b/tests/_server/templates/snapshots/export3.txt@@ -59,7 +59,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},"configOverrides": {"formatting": {"line_length": 100}},"appConfig": {"sql_output": "auto", "width": "compact"},"view": {"showAppCode": true},diff --git a/tests/_server/templates/snapshots/export4.txt b/tests/_server/templates/snapshots/export4.txtindex fa311cd89e..d79487114c 100644--- a/tests/_server/templates/snapshots/export4.txt+++ b/tests/_server/templates/snapshots/export4.txt@@ -59,7 +59,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},"configOverrides": {"formatting": {"line_length": 100}},"appConfig": {"css_file": "custom.css", "sql_output": "auto", "width": "compact"},"view": {"showAppCode": true},diff --git a/tests/_server/templates/snapshots/export5.txt b/tests/_server/templates/snapshots/export5.txtindex a8ce29f377..66ee1a18da 100644--- a/tests/_server/templates/snapshots/export5.txt+++ b/tests/_server/templates/snapshots/export5.txt@@ -59,7 +59,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},"configOverrides": {"formatting": {"line_length": 100}},"appConfig": {"app_title": "My App", "html_head_file": "head.html", "sql_output": "auto", "width": "compact"},"view": {"showAppCode": true},diff --git a/tests/_server/templates/snapshots/export6.txt b/tests/_server/templates/snapshots/export6.txtindex 104cfe7fa9..2dd52f94f9 100644--- a/tests/_server/templates/snapshots/export6.txt+++ b/tests/_server/templates/snapshots/export6.txt@@ -59,7 +59,7 @@"mode": "read","version": "0.0.0","serverToken": "token",- "config": {"completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "custom_css": ["custom1.css", "custom2.css"], "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},+ "config": {"ai": {"models": {"custom_models": [], "displayed_models": []}}, "completion": {"activate_on_typing": true, "copilot": false}, "display": {"cell_output": "above", "code_editor_font_size": 14, "custom_css": ["custom1.css", "custom2.css"], "dataframes": "rich", "default_table_max_columns": 50, "default_table_page_size": 10, "default_width": "medium", "reference_highlighting": false, "theme": "light"}, "formatting": {"line_length": 79}, "keymap": {"overrides": {}, "preset": "default"}, "language_servers": {"pylsp": {"enable_flake8": false, "enable_mypy": true, "enable_pydocstyle": false, "enable_pyflakes": false, "enable_pylint": false, "enable_ruff": true, "enabled": true}}, "package_management": {"manager": "pixi"}, "runtime": {"auto_instantiate": true, "auto_reload": "off", "default_sql_output": "auto", "on_cell_change": "autorun", "output_max_bytes": 8000000, "reactive_tests": true, "std_stream_max_bytes": 1000000, "watcher_on_save": "lazy"}, "save": {"autosave": "after_delay", "autosave_delay": 1000, "format_on_save": false}, "server": {"browser": "default", "follow_symlink": false}, "snippets": {"custom_paths": [], "include_default_snippets": true}},"configOverrides": {"formatting": {"line_length": 100}},"appConfig": {"sql_output": "auto", "width": "compact"},"view": {"showAppCode": true},