端点模式片段
<EndpointSchemaSnippet> 组件显示来自 API Reference 的端点模式。默认情况下,它渲染完整的模式,或者您可以使用 selector 属性来显示特定部分,如请求体、响应、路径参数或查询参数。
要按名称显示任何类型定义(不限于端点模式),请使用 <Schema> 组件。
尚不支持富 Markdown 字段描述,将显示为纯文本。请参见下面的请求路径示例。
用法
Path parameters
domain
Request
messages
The messages to use for the chat completion
model
The model to use for the chat completion
Allowed values:
max_tokens
The maximum number of tokens to generate. Note: setting a token count lower than 2000 may result in incomplete responses. You can add a custom system prompt to control the verbosity of the response.
system_prompt
The system prompt to use for the chat completion
rewrite_query
Whether to rewrite the query using query decomposition
user_is_authed
Whether the requesting user is authenticated. When true, authed chunks are included in results.
allowed_roles
Roles the authenticated user has. Used to filter chunks by role-based access control.
source
The origin of the request (e.g. 'web', 'slack', 'api').
basepaths
Restrict retrieval to pages under these URL path prefixes (e.g. ['/my-product']). Matches the scoping the Ask AI widget applies when embedded under a product path. Omit to search the whole site.
skip_save_query
Set to true for test or eval traffic. The request is answered (and billed) normally but is excluded from usage analytics.
Response
turns
The conversation turns in the chat completion
citations
List of citation strings
sources
Pages the answer was grounded in, one entry per cited page
Markdown
变体
完整请求
将 request 作为选择器传递将仅渲染请求模式。
Path parameters
domain
Request
messages
The messages to use for the chat completion
model
The model to use for the chat completion
Allowed values:
max_tokens
The maximum number of tokens to generate. Note: setting a token count lower than 2000 may result in incomplete responses. You can add a custom system prompt to control the verbosity of the response.
system_prompt
The system prompt to use for the chat completion
rewrite_query
Whether to rewrite the query using query decomposition
user_is_authed
Whether the requesting user is authenticated. When true, authed chunks are included in results.
allowed_roles
Roles the authenticated user has. Used to filter chunks by role-based access control.
source
The origin of the request (e.g. 'web', 'slack', 'api').
basepaths
Restrict retrieval to pages under these URL path prefixes (e.g. ['/my-product']). Matches the scoping the Ask AI widget applies when embedded under a product path. Omit to search the whole site.
skip_save_query
Set to true for test or eval traffic. The request is answered (and billed) normally but is excluded from usage analytics.
Markdown
请求路径
Path parameters
domain
Markdown
请求查询
Markdown
请求体
Request
messages
The messages to use for the chat completion
model
The model to use for the chat completion
Allowed values:
max_tokens
The maximum number of tokens to generate. Note: setting a token count lower than 2000 may result in incomplete responses. You can add a custom system prompt to control the verbosity of the response.
system_prompt
The system prompt to use for the chat completion
rewrite_query
Whether to rewrite the query using query decomposition
user_is_authed
Whether the requesting user is authenticated. When true, authed chunks are included in results.
allowed_roles
Roles the authenticated user has. Used to filter chunks by role-based access control.
source
The origin of the request (e.g. 'web', 'slack', 'api').
basepaths
Restrict retrieval to pages under these URL path prefixes (e.g. ['/my-product']). Matches the scoping the Ask AI widget applies when embedded under a product path. Omit to search the whole site.
skip_save_query
Set to true for test or eval traffic. The request is answered (and billed) normally but is excluded from usage analytics.
Markdown
完整响应
将 response 作为选择器传递将仅渲染响应模式。
Response
turns
The conversation turns in the chat completion
citations
List of citation strings
sources
Pages the answer was grounded in, one entry per cited page
Markdown
响应体
Response
turns
The conversation turns in the chat completion
citations
List of citation strings
sources
Pages the answer was grounded in, one entry per cited page
Markdown
属性
endpoint
要显示的端点,格式为 METHOD /path(例如,POST /chat/{domain})。如果您的 API 使用命名空间,请在前面加上命名空间和 ::(例如,payments::POST /chat/{domain})。
selector
选择要显示的端点模式的特定部分。支持的值:request、request.path、request.query、request.body、response、response.body。