diff --git a/apps/website/content/docs/ag-ui/api/api-docs.json b/apps/website/content/docs/ag-ui/api/api-docs.json index 85cbb5322..7be9fe93b 100644 --- a/apps/website/content/docs/ag-ui/api/api-docs.json +++ b/apps/website/content/docs/ag-ui/api/api-docs.json @@ -8,7 +8,7 @@ "name": "opts", "type": "object", "description": "", - "optional": false + "optional": true } ], "examples": [], @@ -588,7 +588,7 @@ "name": "config", "type": "FakeAgentConfig", "description": "", - "optional": false + "optional": true } ], "returns": { @@ -613,7 +613,7 @@ "name": "options", "type": "ToAgentOptions", "description": "", - "optional": false + "optional": true } ], "returns": { diff --git a/apps/website/content/docs/chat/api/api-docs.json b/apps/website/content/docs/chat/api/api-docs.json index 1b4293563..dac1fb041 100644 --- a/apps/website/content/docs/chat/api/api-docs.json +++ b/apps/website/content/docs/chat/api/api-docs.json @@ -7151,7 +7151,7 @@ "name": "opts", "type": "MockAgentOptions", "description": "", - "optional": false + "optional": true } ], "returns": { diff --git a/apps/website/content/docs/langgraph/api/api-docs.json b/apps/website/content/docs/langgraph/api/api-docs.json index 0870ce31d..b6232ddd0 100644 --- a/apps/website/content/docs/langgraph/api/api-docs.json +++ b/apps/website/content/docs/langgraph/api/api-docs.json @@ -38,7 +38,7 @@ "name": "config", "type": "FakeAgentConfig", "description": "", - "optional": false + "optional": true } ], "examples": [], @@ -420,7 +420,7 @@ "name": "metadata", "type": "Record", "description": "", - "optional": false + "optional": true } ] }, @@ -563,7 +563,7 @@ "name": "script", "type": "StreamEvent[][]", "description": "Array of event batches. Each batch is emitted as a group.", - "optional": false + "optional": true } ], "examples": [ @@ -2366,7 +2366,7 @@ "name": "initial", "type": "MockAgentOptions & { hasValue?: boolean; isThreadLoading?: boolean; langGraphMessages?: BaseMessage, MessageType>[] }", "description": "", - "optional": false + "optional": true } ], "returns": { @@ -2404,7 +2404,7 @@ "name": "config", "type": "FakeAgentConfig", "description": "", - "optional": false + "optional": true } ], "returns": { diff --git a/apps/website/content/docs/render/api/api-docs.json b/apps/website/content/docs/render/api/api-docs.json index 3b34c44e4..21b47069f 100644 --- a/apps/website/content/docs/render/api/api-docs.json +++ b/apps/website/content/docs/render/api/api-docs.json @@ -624,7 +624,7 @@ "name": "initialState", "type": "StateModel", "description": "", - "optional": false + "optional": true } ], "returns": { diff --git a/apps/website/content/docs/telemetry/api/api-docs.json b/apps/website/content/docs/telemetry/api/api-docs.json index a0893a4a2..dc96404b4 100644 --- a/apps/website/content/docs/telemetry/api/api-docs.json +++ b/apps/website/content/docs/telemetry/api/api-docs.json @@ -42,7 +42,7 @@ "name": "env", "type": "ProcessEnv<>", "description": "", - "optional": false + "optional": true } ], "returns": { @@ -61,7 +61,7 @@ "name": "env", "type": "ProcessEnv<>", "description": "", - "optional": false + "optional": true } ], "returns": { @@ -233,7 +233,7 @@ "name": "properties", "type": "Record", "description": "", - "optional": false + "optional": true } ], "returns": { @@ -460,7 +460,7 @@ "name": "maxLength", "type": "number", "description": "", - "optional": false + "optional": true } ], "returns": { diff --git a/apps/website/scripts/generate-api-docs.ts b/apps/website/scripts/generate-api-docs.ts index 07cc01a88..04e4460b1 100644 --- a/apps/website/scripts/generate-api-docs.ts +++ b/apps/website/scripts/generate-api-docs.ts @@ -78,7 +78,10 @@ function extractParams(sig: any): ApiParam[] { name: `${p.flags?.isRest ? '...' : ''}${p.name}`, type: extractType(p.type), description: extractDescription(p.comment), - optional: p.flags?.isOptional ?? false, + // A parameter is optional if explicitly marked `?` OR it has a default + // value (e.g. `opts: MockAgentOptions = {}`) — TypeDoc only sets the + // `isOptional` flag for the former, so check `defaultValue` for the latter. + optional: (p.flags?.isOptional ?? false) || p.defaultValue !== undefined, })); }