Skip to main content

chat_completions

Creates, updates, deletes, gets or lists a chat_completions resource.

Overview

Namechat_completions
TypeResource
Idcloudflare.ai_search.chat_completions

Fields

The following fields are returned by SELECT queries:

Returns the chat completions results with retrieved files.

NameDatatypeDescription
idstring
choicesarray
chunksarray
modelstring
objectstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
chat_completions_by_accountselectid, account_idPerforms a chat completion request against an AI Search instance, using indexed content as context for generating responses.
chat_completionsselectaccount_id, namePerforms 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
idstringResource ID.
namestringResource name.

SELECT examples

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
;