Skip to content

Latest commit

 

History

History
373 lines (296 loc) · 10.6 KB

RabbitHoleApi.md

File metadata and controls

373 lines (296 loc) · 10.6 KB

CheshireCatApi.Api.RabbitHoleApi

All URIs are relative to http://localhost

Method HTTP request Description
GetAllowedMimetypes GET /rabbithole/allowed-mimetypes Get Allowed Mimetypes
UploadFile POST /rabbithole Upload File
UploadMemory POST /rabbithole/memory Upload Memory
UploadUrl POST /rabbithole/web Upload URL

GetAllowedMimetypes

ResponseGetAllowedMimetypes GetAllowedMimetypes ()

Get Allowed Mimetypes

Retrieve the allowed mimetypes that can be ingested by the Rabbit Hole

Example

using System.Collections.Generic;
using System.Diagnostics;
using CheshireCatApi.Api;
using CheshireCatApi.Client;
using CheshireCatApi.Model;

namespace Example
{
    public class GetAllowedMimetypesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            var apiInstance = new RabbitHoleApi(config);

            try
            {
                // Get Allowed Mimetypes
                ResponseGetAllowedMimetypes result = apiInstance.GetAllowedMimetypes();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RabbitHoleApi.GetAllowedMimetypes: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetAllowedMimetypesWithHttpInfo variant

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

try
{
    // Get Allowed Mimetypes
    ApiResponse<ResponseGetAllowedMimetypes> response = apiInstance.GetAllowedMimetypesWithHttpInfo();
    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 RabbitHoleApi.GetAllowedMimetypesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

ResponseGetAllowedMimetypes

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

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

UploadFile

FileResponse UploadFile (System.IO.Stream file)

Upload File

Upload a file containing text (.txt, .md, .pdf, etc.). File content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory.

Example

using System.Collections.Generic;
using System.Diagnostics;
using CheshireCatApi.Api;
using CheshireCatApi.Client;
using CheshireCatApi.Model;

namespace Example
{
    public class UploadFileExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            var apiInstance = new RabbitHoleApi(config);
            var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt"));  // System.IO.Stream | 

            try
            {
                // Upload File
                FileResponse result = apiInstance.UploadFile(file);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RabbitHoleApi.UploadFile: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UploadFileWithHttpInfo variant

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

try
{
    // Upload File
    ApiResponse<FileResponse> response = apiInstance.UploadFileWithHttpInfo(file);
    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 RabbitHoleApi.UploadFileWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
file System.IO.Stream****System.IO.Stream

Return type

FileResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

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

UploadMemory

Object UploadMemory (System.IO.Stream file)

Upload Memory

Upload a memory json file to the cat memory

Example

using System.Collections.Generic;
using System.Diagnostics;
using CheshireCatApi.Api;
using CheshireCatApi.Client;
using CheshireCatApi.Model;

namespace Example
{
    public class UploadMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            var apiInstance = new RabbitHoleApi(config);
            var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt"));  // System.IO.Stream | 

            try
            {
                // Upload Memory
                Object result = apiInstance.UploadMemory(file);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RabbitHoleApi.UploadMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UploadMemoryWithHttpInfo variant

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

try
{
    // Upload Memory
    ApiResponse<Object> response = apiInstance.UploadMemoryWithHttpInfo(file);
    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 RabbitHoleApi.UploadMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
file System.IO.Stream****System.IO.Stream

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

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

UploadUrl

WebResponse UploadUrl (BodyUploadUrl bodyUploadUrl)

Upload URL

Upload a URL. Website content will be extracted and segmented into chunks. Chunks will be then vectorized and stored into documents memory.

Example

using System.Collections.Generic;
using System.Diagnostics;
using CheshireCatApi.Api;
using CheshireCatApi.Client;
using CheshireCatApi.Model;

namespace Example
{
    public class UploadUrlExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            var apiInstance = new RabbitHoleApi(config);
            var bodyUploadUrl = new BodyUploadUrl(); // BodyUploadUrl | 

            try
            {
                // Upload URL
                WebResponse result = apiInstance.UploadUrl(bodyUploadUrl);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RabbitHoleApi.UploadUrl: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UploadUrlWithHttpInfo variant

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

try
{
    // Upload URL
    ApiResponse<WebResponse> response = apiInstance.UploadUrlWithHttpInfo(bodyUploadUrl);
    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 RabbitHoleApi.UploadUrlWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
bodyUploadUrl BodyUploadUrl

Return type

WebResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
422 Validation Error -

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