Skip to main content

Conversations API

All URIs are relative to http://localhost:1000

MethodHTTP requestDescription
conversationsCreateFromAssetPOST /conversations/create/from_asset/{asset}/conversations/create/from_asset/{asset} [POST]
conversationsCreateSpecificConversationPOST /conversations/create/conversations/create [POST]
conversationsDeleteSpecificConversationPOST /conversations/{conversation}/delete/conversations/{conversation}/delete [POST]
conversationsIdentifiersSnapshotGET /conversations/identifiers/conversations/identifiers [GET]
conversationsSnapshotGET /conversations/conversations [GET]
conversationsStreamIdentifiersGET /conversations/stream/identifiers/conversations/stream/identifiers [WS]

conversationsCreateFromAsset

ConversationsCreateFromAssetOutput conversationsCreateFromAsset()

Creates a conversation based on an asset. It initiates a conversation and generates an initial message that includes a summary of the asset used as contextual grounding.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConversationsApi(configuration)

const body: Pieces.ConversationsCreateFromAssetRequest = {
// string | The id (uuid) of the asset that you are trying to access.
asset: 2254f2c8-5797-40e8-ac56-41166dc0e159,
};

apiInstance.conversationsCreateFromAsset(body).then((data: ConversationsCreateFromAssetOutput) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
asset[string]The id (uuid) of the asset that you are trying to access.defaults to undefined

Return type

ConversationsCreateFromAssetOutput

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

conversationsCreateSpecificConversation

Conversation conversationsCreateSpecificConversation()

Creates a specific conversation.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConversationsApi(configuration)

const body: Pieces.ConversationsCreateSpecificConversationRequest = {
// boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional)
transferables: true,
// SeededConversation (optional)
seededConversation: ,
};

apiInstance.conversationsCreateSpecificConversation(body).then((data: Conversation) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
seededConversationSeededConversation
transferables[boolean]This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)(optional) defaults to undefined

Return type

Conversation

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

conversationsDeleteSpecificConversation

conversationsDeleteSpecificConversation()

Deletes a specific conversation.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConversationsApi(configuration)

const body: Pieces.ConversationsDeleteSpecificConversationRequest = {
// string | This is the uuid of a conversation.
conversation: conversation_example,
};

apiInstance.conversationsDeleteSpecificConversation(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
conversation[string]This is the uuid of a conversation.defaults to undefined

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

HTTP response details

Status codeDescriptionResponse headers
204No Content-
500Internal Server Error-

conversationsIdentifiersSnapshot

FlattenedConversations conversationsIdentifiersSnapshot()

Retrieves all the UUIDs associated with a Conversation.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConversationsApi(configuration)

apiInstance.conversationsIdentifiersSnapshot().then((data: FlattenedConversations) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

This endpoint does not need any parameters.

Return type

FlattenedConversations

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

conversationsSnapshot

Conversations conversationsSnapshot()

Retrieves a snapshot of a specific conversation.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConversationsApi(configuration)

const body: Pieces.ConversationsSnapshotRequest = {
// boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional)
transferables: true,
};

apiInstance.conversationsSnapshot(body).then((data: Conversations) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
transferables[boolean]This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)(optional) defaults to undefined

Return type

Conversations

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

conversationsStreamIdentifiers

conversationsStreamIdentifiers()

Provides a WebSocket connection that emits changes to your conversation identifiers (UUIDs).

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConversationsApi(configuration)

apiInstance.conversationsStreamIdentifiers().then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

This endpoint does not need any parameters.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined