Bit-Barron / chatbot-backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Porsche Chatbot API

Overview

The Porsche Chatbot API is a powerful tool for integrating a chatbot with speech-to-text and text-to-speech functionality into Porsche-related applications. This API provides a seamless interface for interacting with the chatbot and leveraging cutting-edge language models for natural language processing.

Features

  • Chatbot Integration: Easily integrate a chatbot into your Porsche-related applications.
  • Speech-to-Text: Convert spoken input into text for processing by the chatbot.
  • Text-to-Speech: Convert text responses from the chatbot into spoken audio.
  • Language Model Interaction: Access state-of-the-art language models for advanced natural language understanding.
  • Web Scraping: Optional functionality for scraping data from the web to enhance the chatbot's capabilities.

Getting Started

Installation

  1. Clone the repository:
  2. git clone (https://github.com/Bit-Barron/PorscheChatbot.git)
  3. Navigate to the project directory:
  4. cd PorscheChatbot
  5. Install dependencies:
  6. pip install -r requirements.txt

Configuration

Set up environment variables by creating environment variables


    Add your OpenAI key as environment var should be named as: OPENAI_API_KEY

Usage

  1. Start the Flask server:
  2. python api/api.py
  3. Access the API endpoints using tools like curl, Postman, or by integrating with your application.

API Endpoints

  • /api/get_solutions: Endpoint for interacting with the chatbot and get Solutions.
  • /api/create_voice: Endpoint for converting speech to text.
  • /api/scrape_data: Endpoint for getting scraped data from: https://ask.porsche.com/.

Examples

Example 1: Chatbot Interaction

import requests

url = "http://127.0.0.1/scrape_data/"
data = {"input": "What is the top speed of the latest Porsche 911?"}

response = requests.post(url, json=data)
print(response.json())

<

Contributing

Contributions are welcome! Feel free to open issues for feature requests, bug fixes, or general improvements. Pull requests are also appreciated.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About


Languages

Language:Python 100.0%