Skip to content

Latest commit

 

History

History
673 lines (535 loc) · 22.8 KB

ConversationsApi.md

File metadata and controls

673 lines (535 loc) · 22.8 KB

Pieces.Os.Core.Api.ConversationsApi

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

Method HTTP request Description
ConversationsCreateFromAsset POST /conversations/create/from_asset/{asset} /conversations/create/from_asset/{asset} [POST]
ConversationsCreateSpecificConversation POST /conversations/create /conversations/create [POST]
ConversationsDeleteSpecificConversation POST /conversations/{conversation}/delete /conversations/{conversation}/delete [POST]
ConversationsIdentifiersSnapshot GET /conversations/identifiers /conversations/identifiers [GET]
ConversationsSnapshot GET /conversations /conversations [GET]
ConversationsStreamIdentifiers GET /conversations/stream/identifiers /conversations/stream/identifiers [WS]
SearchConversations POST /conversations/search /conversations/search [POST]

ConversationsCreateFromAsset

ConversationsCreateFromAssetOutput ConversationsCreateFromAsset (Guid asset)

/conversations/create/from_asset/{asset} [POST]

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

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class ConversationsCreateFromAssetExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);
            var asset = 2254f2c8-5797-40e8-ac56-41166dc0e159;  // Guid | The id (uuid) of the asset that you are trying to access.

            try
            {
                // /conversations/create/from_asset/{asset} [POST]
                ConversationsCreateFromAssetOutput result = apiInstance.ConversationsCreateFromAsset(asset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.ConversationsCreateFromAsset: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ConversationsCreateFromAssetWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations/create/from_asset/{asset} [POST]
    ApiResponse<ConversationsCreateFromAssetOutput> response = apiInstance.ConversationsCreateFromAssetWithHttpInfo(asset);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.ConversationsCreateFromAssetWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
asset Guid The id (uuid) of the asset that you are trying to access.

Return type

ConversationsCreateFromAssetOutput

Authorization

application

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ConversationsCreateSpecificConversation

Conversation ConversationsCreateSpecificConversation (bool? transferables = null, SeededConversation seededConversation = null)

/conversations/create [POST]

Creates a specific conversation.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class ConversationsCreateSpecificConversationExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);
            var transferables = true;  // bool? | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional) 
            var seededConversation = new SeededConversation(); // SeededConversation |  (optional) 

            try
            {
                // /conversations/create [POST]
                Conversation result = apiInstance.ConversationsCreateSpecificConversation(transferables, seededConversation);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.ConversationsCreateSpecificConversation: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ConversationsCreateSpecificConversationWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations/create [POST]
    ApiResponse<Conversation> response = apiInstance.ConversationsCreateSpecificConversationWithHttpInfo(transferables, seededConversation);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.ConversationsCreateSpecificConversationWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
transferables bool? This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) [optional]
seededConversation SeededConversation [optional]

Return type

Conversation

Authorization

application

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ConversationsDeleteSpecificConversation

void ConversationsDeleteSpecificConversation (string conversation)

/conversations/{conversation}/delete [POST]

Deletes a specific conversation.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class ConversationsDeleteSpecificConversationExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);
            var conversation = "conversation_example";  // string | This is the uuid of a conversation.

            try
            {
                // /conversations/{conversation}/delete [POST]
                apiInstance.ConversationsDeleteSpecificConversation(conversation);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.ConversationsDeleteSpecificConversation: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ConversationsDeleteSpecificConversationWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations/{conversation}/delete [POST]
    apiInstance.ConversationsDeleteSpecificConversationWithHttpInfo(conversation);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.ConversationsDeleteSpecificConversationWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
conversation string This is the uuid of a conversation.

Return type

void (empty response body)

Authorization

application

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ConversationsIdentifiersSnapshot

FlattenedConversations ConversationsIdentifiersSnapshot ()

/conversations/identifiers [GET]

Retrieves all the UUIDs associated with a Conversation.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class ConversationsIdentifiersSnapshotExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);

            try
            {
                // /conversations/identifiers [GET]
                FlattenedConversations result = apiInstance.ConversationsIdentifiersSnapshot();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.ConversationsIdentifiersSnapshot: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ConversationsIdentifiersSnapshotWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations/identifiers [GET]
    ApiResponse<FlattenedConversations> response = apiInstance.ConversationsIdentifiersSnapshotWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.ConversationsIdentifiersSnapshotWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

FlattenedConversations

Authorization

application

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ConversationsSnapshot

Conversations ConversationsSnapshot (bool? transferables = null)

/conversations [GET]

Retrieves a snapshot of a specific conversation.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class ConversationsSnapshotExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);
            var transferables = true;  // bool? | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional) 

            try
            {
                // /conversations [GET]
                Conversations result = apiInstance.ConversationsSnapshot(transferables);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.ConversationsSnapshot: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ConversationsSnapshotWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations [GET]
    ApiResponse<Conversations> response = apiInstance.ConversationsSnapshotWithHttpInfo(transferables);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.ConversationsSnapshotWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
transferables bool? This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) [optional]

Return type

Conversations

Authorization

application

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ConversationsStreamIdentifiers

void ConversationsStreamIdentifiers ()

/conversations/stream/identifiers [WS]

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class ConversationsStreamIdentifiersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);

            try
            {
                // /conversations/stream/identifiers [WS]
                apiInstance.ConversationsStreamIdentifiers();
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.ConversationsStreamIdentifiers: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ConversationsStreamIdentifiersWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations/stream/identifiers [WS]
    apiInstance.ConversationsStreamIdentifiersWithHttpInfo();
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.ConversationsStreamIdentifiersWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

application

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SearchConversations

SearchedConversations SearchConversations (bool? transferables = null, SearchInput searchInput = null)

/conversations/search [POST]

This will search your conversations for a specific conversation note: we will search annotations, the name of the conversation, and the conversation messages

Example

using System.Collections.Generic;
using System.Diagnostics;
using Pieces.Os.Core.Api;
using Pieces.Os.Core.Client;
using Pieces.Os.Core.SdkModel;

namespace Example
{
    public class SearchConversationsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost:1000";
            // Configure API key authorization: application
            config.AddApiKey("X-Application-ID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-Application-ID", "Bearer");

            var apiInstance = new ConversationsApi(config);
            var transferables = true;  // bool? | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional) 
            var searchInput = new SearchInput(); // SearchInput |  (optional) 

            try
            {
                // /conversations/search [POST]
                SearchedConversations result = apiInstance.SearchConversations(transferables, searchInput);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ConversationsApi.SearchConversations: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the SearchConversationsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // /conversations/search [POST]
    ApiResponse<SearchedConversations> response = apiInstance.SearchConversationsWithHttpInfo(transferables, searchInput);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ConversationsApi.SearchConversationsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
transferables bool? This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) [optional]
searchInput SearchInput [optional]

Return type

SearchedConversations

Authorization

application

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]