chat_completions
Creates, updates, deletes, gets or lists a chat_completions resource.
Overview
| Name | chat_completions |
| Type | Resource |
| Id | cloudflare.ai_search.chat_completions |
Fields
The following fields are returned by SELECT queries:
- chat_completions_by_account
- chat_completions
Returns the chat completions results with retrieved files.
| Name | Datatype | Description |
|---|---|---|
id | string | |
choices | array | |
chunks | array | |
model | string | |
object | string |
Returns the chat completion result with merged chunks from all instances.
| Name | Datatype | Description |
|---|---|---|
id | string | |
choices | array | |
chunks | array | |
errors | array | |
model | string | |
object | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
chat_completions_by_account | select | id, account_id | Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses. | |
chat_completions | select | account_id, name | Performs a chat completion request against multiple AI Search instances in parallel, merging retrieved content as context for generating a response. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
id | string | Resource ID. |
name | string | Resource name. |
SELECT examples
- chat_completions_by_account
- chat_completions
Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.
SELECT
id,
choices,
chunks,
model,
object
FROM cloudflare.ai_search.chat_completions
WHERE id = '{{ id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Performs a chat completion request against multiple AI Search instances in parallel, merging retrieved content as context for generating a response.
SELECT
id,
choices,
chunks,
errors,
model,
object
FROM cloudflare.ai_search.chat_completions
WHERE account_id = '{{ account_id }}' -- required
AND name = '{{ name }}' -- required
;