chore(proxy): exclude the dashboard AI chat route from the OpenAPI schema

/dashboard/ai/chat is an internal dashboard endpoint, so it does not belong in the public API docs. It surfaced two ways: the route decorator, now carrying include_in_schema=False, and the lazy-openapi snapshot injection, whose dashboard_ai fragment is emptied to match what a snapshot regen produces once the route is hidden. The generated dashboard types drop the now-unreferenced path, operation, DashboardAIChatRequest, and ChatMessage
This commit is contained in:
ryan-crabbe-berri 2026-07-12 22:46:59 -07:00
parent 4089198b06
commit 83bab34129
3 changed files with 3 additions and 226 deletions

View file

@ -6134,153 +6134,9 @@
},
"dashboard_ai": {
"components": {
"schemas": {
"ChatMessage": {
"properties": {
"content": {
"title": "Content",
"type": "string"
},
"role": {
"enum": [
"user",
"assistant"
],
"title": "Role",
"type": "string"
}
},
"required": [
"role",
"content"
],
"title": "ChatMessage",
"type": "object"
},
"DashboardAIChatRequest": {
"properties": {
"messages": {
"description": "Chat messages (user/assistant history)",
"items": {
"$ref": "#/components/schemas/ChatMessage"
},
"title": "Messages",
"type": "array"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Model group to use for AI chat",
"title": "Model"
}
},
"required": [
"messages"
],
"title": "DashboardAIChatRequest",
"type": "object"
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"title": "Detail",
"type": "array"
}
},
"title": "HTTPValidationError",
"type": "object"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"title": "Location",
"type": "array"
},
"msg": {
"title": "Message",
"type": "string"
},
"type": {
"title": "Error Type",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError",
"type": "object"
}
}
"schemas": {}
},
"paths": {
"/dashboard/ai/chat": {
"post": {
"description": "AI chat about usage data. Streams SSE events with the AI response.\n\nThe agent queries aggregated daily activity data through a provider scoped\nto the caller: admins get a global view, non-admins are restricted to their\nown ``user_id``.",
"operationId": "dashboard_ai_chat_dashboard_ai_chat_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DashboardAIChatRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"security": [
{
"APIKeyHeader": []
}
],
"summary": "Dashboard Ai Chat",
"tags": [
"usage_ai"
]
}
}
}
"paths": {}
},
"evals": {
"components": {

View file

@ -30,6 +30,7 @@ class DashboardAIChatRequest(BaseModel):
"/dashboard/ai/chat",
tags=["Budget & Spend Tracking"],
dependencies=[Depends(user_api_key_auth)],
include_in_schema=False,
)
async def dashboard_ai_chat(
data: DashboardAIChatRequest,

View file

@ -3078,30 +3078,6 @@ export interface paths {
patch?: never;
trace?: never;
};
"/dashboard/ai/chat": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Dashboard Ai Chat
* @description AI chat about usage data. Streams SSE events with the AI response.
*
* The agent queries aggregated daily activity data through a provider scoped
* to the caller: admins get a global view, non-admins are restricted to their
* own ``user_id``.
*/
post: operations["dashboard_ai_chat_dashboard_ai_chat_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/debug/asyncio-tasks": {
parameters: {
query?: never;
@ -22142,16 +22118,6 @@ export interface components {
/** Url */
url: string;
};
/** ChatMessage */
ChatMessage: {
/** Content */
content: string;
/**
* Role
* @enum {string}
*/
role: "user" | "assistant";
};
/** ChoiceLogprobs */
ChoiceLogprobs: {
/** Content */
@ -23257,19 +23223,6 @@ export interface components {
* DefaultInternalUserParams
* @description Default parameters to apply when a new user signs in via SSO or is created on the /user/new API endpoint
*/
/** DashboardAIChatRequest */
DashboardAIChatRequest: {
/**
* Messages
* @description Chat messages (user/assistant history)
*/
messages: components["schemas"]["ChatMessage"][];
/**
* Model
* @description Model group to use for AI chat
*/
model?: string | null;
};
DefaultInternalUserParams: {
/**
* Budget Duration
@ -33685,39 +33638,6 @@ export interface components {
}
export type $defs = Record<string, never>;
export interface operations {
dashboard_ai_chat_dashboard_ai_chat_post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["DashboardAIChatRequest"];
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": unknown;
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
home__get: {
parameters: {
query?: never;