Sign inSign up

schogini/voice-flow-kb-upload

By schogini

•Updated almost 2 years ago

Uploads a knowledge base document via a POST request to VoiceFlow's API using a provided URL.

Image
0

525

schogini/voice-flow-kb-upload repository overview

⁠Schogini VoiceFlow Knowledge Base Upload Docker Image

This Docker image can either upload a knowledge base document to VoiceFlow or list the knowledge base documents if no URL is provided. It requires an authorization code for the VoiceFlow API.

⁠How It Works

  • Upload: The script sends a POST request to upload a knowledge base document using a provided URL.
  • List Knowledge Base: If no URL is provided, the script sends a GET request to list existing knowledge base documents.
⁠Prerequisites
  • Docker must be installed on your machine.
  • An authorization code is required to authenticate with the VoiceFlow API.

⁠Usage

⁠Build the Docker Image

To build the Docker image:

docker build -t voice-flow-kb-upload .
⁠Run the Docker Container
⁠1. Upload a Knowledge Base Document

To upload a knowledge base document, provide the URL and the authorization code:

docker run --rm -e AUTHORIZATION_CODE="your-auth-code" voice-flow-kb-upload <url>

Replace <url> with the URL of the knowledge base document, and "your-auth-code" with your actual authorization code.

⁠2. List Knowledge Base Documents

If no URL is provided, the script will list the knowledge base documents:

docker run --rm -e AUTHORIZATION_CODE="your-auth-code" voice-flow-kb-upload
⁠Example Command
⁠Example 1: Uploading a File
docker run --rm -e AUTHORIZATION_CODE="abcd" voice-flow-kb-upload https://example.com/document.txt
⁠Example 2: Listing Knowledge Base Documents
docker run --rm -e AUTHORIZATION_CODE="abcd" voice-flow-kb-upload
⁠Environment Variables
  • AUTHORIZATION_CODE: The authorization code required to authenticate with the VoiceFlow API.
⁠Output
⁠1. Success Message After Upload:

If the request is successful, the script will extract the documentID from the JSON response and display it as part of the success message:

Success! DocumentID: <documentID>
⁠2. Knowledge Base Listing:

If no URL is provided, the script will list the knowledge base documents with details like documentID, name, status, and updatedAt.

Total Knowledge Base Documents: 2
DocumentID: qqqq, Name: qqqq, Status: SUCCESS, Updated At: 2024-09-26T11:17:44.809Z

⁠License

This project is licensed under the MIT License.

⁠Company Information

This Docker image was created by Schogini Systems Private Limited. We specialize in AI Chatbot and Automation solutions for small businesses.

For more information about our services, visit: https://www.schogini.com⁠.

Tag summary

Content type

Image

Digest

sha256:504486ee3…

Size

49 MB

Last updated

almost 2 years ago

docker pull schogini/voice-flow-kb-upload