Skip to main content

conversations

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

Overview​

Nameconversations
TypeResource
Idopenai.conversations.conversations

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique ID of the conversation.
created_atinteger (unixtime)The time at which the conversation was created, measured in seconds since the Unix epoch.
metadataSet of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
objectstringThe object type, which is always conversation. (conversation) (default: conversation)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectconversation_idopenai-organization, openai-project
createinsertopenai-organization, openai-project
updateupdateconversation_id, metadataopenai-organization, openai-project
deletedeleteconversation_idopenai-organization, openai-project

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
conversation_idstringThe ID of the conversation to delete.
openai-organizationstringOptionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization.
openai-projectstringOptionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project.

SELECT examples​

Success

SELECT
id,
created_at,
metadata,
object
FROM openai.conversations.conversations
WHERE conversation_id = '{{ conversation_id }}' -- required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;

INSERT examples​

No description available.

INSERT INTO openai.conversations.conversations (
metadata,
items,
"openai-organization",
"openai-project"
)
SELECT
'{{ metadata }}',
'{{ items }}',
'{{ openai-organization }}',
'{{ openai-project }}'
RETURNING
id,
created_at,
metadata,
object
;

UPDATE examples​

No description available.

UPDATE openai.conversations.conversations
SET
metadata = '{{ metadata }}'
WHERE
conversation_id = '{{ conversation_id }}' --required
AND metadata = '{{ metadata }}' --required
AND "openai-organization" = '{{ openai-organization}}'
AND "openai-project" = '{{ openai-project}}'
RETURNING
id,
created_at,
metadata,
object;

DELETE examples​

No description available.

DELETE FROM openai.conversations.conversations
WHERE conversation_id = '{{ conversation_id }}' --required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;