conversations
Creates, updates, deletes, gets or lists a conversations resource.
Overview​
| Name | conversations |
| Type | Resource |
| Id | openai.conversations.conversations |
Fields​
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the conversation. |
created_at | integer (unixtime) | The time at which the conversation was created, measured in seconds since the Unix epoch. |
metadata | | Set 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. |
object | string | The object type, which is always conversation. (conversation) (default: conversation) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | conversation_id | openai-organization, openai-project | |
create | insert | openai-organization, openai-project | ||
update | update | conversation_id, metadata | openai-organization, openai-project | |
delete | delete | conversation_id | openai-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.
| Name | Datatype | Description |
|---|---|---|
conversation_id | string | The ID of the conversation to delete. |
openai-organization | string | Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as openai_organization. |
openai-project | string | Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as openai_project. |
SELECT examples​
- get
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​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: conversations
props:
- name: metadata
value: "{{ metadata }}"
description: |
Set 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.
- name: items
description: |
Initial items to include in the conversation context. You may add up to 20 items at a time.
value:
- role: "{{ role }}"
content: "{{ content }}"
phase: "{{ phase }}"
type: "{{ type }}"
status: "{{ status }}"
id: "{{ id }}"
queries: "{{ queries }}"
results: "{{ results }}"
call_id: "{{ call_id }}"
action:
type: "{{ type }}"
button: "{{ button }}"
x: {{ x }}
y: {{ y }}
keys:
- "{{ keys }}"
path:
- x: {{ x }}
y: {{ y }}
scroll_x: {{ scroll_x }}
scroll_y: {{ scroll_y }}
text: "{{ text }}"
actions: "{{ actions }}"
pending_safety_checks: "{{ pending_safety_checks }}"
output:
type: "{{ type }}"
image_url: "{{ image_url }}"
file_id: "{{ file_id }}"
acknowledged_safety_checks: "{{ acknowledged_safety_checks }}"
namespace: "{{ namespace }}"
name: "{{ name }}"
arguments: "{{ arguments }}"
execution: "{{ execution }}"
tools: "{{ tools }}"
encrypted_content: "{{ encrypted_content }}"
summary: "{{ summary }}"
result: "{{ result }}"
container_id: "{{ container_id }}"
code: "{{ code }}"
outputs: "{{ outputs }}"
environment: "{{ environment }}"
max_output_length: {{ max_output_length }}
operation:
type: "{{ type }}"
path: "{{ path }}"
diff: "{{ diff }}"
server_label: "{{ server_label }}"
error: "{{ error }}"
approval_request_id: "{{ approval_request_id }}"
approve: {{ approve }}
reason: "{{ reason }}"
input: "{{ input }}"
- name: openai-organization
value: "{{ openai-organization }}"
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
description: Optionally scope the request to a specific organization (overrides the default associated with the API key). Addressable in SQL as `openai_organization`.
- name: openai-project
value: "{{ openai-project }}"
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
description: Optionally scope the request to a specific project (overrides the default associated with the API key). Addressable in SQL as `openai_project`.
UPDATE examples​
- update
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​
- delete
No description available.
DELETE FROM openai.conversations.conversations
WHERE conversation_id = '{{ conversation_id }}' --required
AND "openai-organization" = '{{ openai-organization }}'
AND "openai-project" = '{{ openai-project }}'
;