Loke-60000 / simplon-chatbot

Chatbot app integrating Azure OpenAI to provide text generation based on conversation histories.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chatbot Application with Azure OpenAI

Overview

This application integrates Azure OpenAI to provide text generation based on conversation histories.

API Usage

Start the backend Server

Navigate to the backend directory and start the API server with the following commands:

uvicorn app:app --host 0.0.0.0 --port 8000

Endpoint Documentation

Generate Text

  • URL: /generate-text
  • Method: POST
  • Description: Generates text based on the provided conversation history.
  • Request Body:
    • system: A brief description about the system's context.
    • history: A list of messages including sender and content.
    • temperature: Adjusts the randomness of the response.
    • max_tokens: Limits the length of the generated response.
    • top_p: Controls nucleus sampling.
    • frequency_penalty: Reduces the likelihood of token repetition.
    • presence_penalty: Encourages the introduction of new topics.
  • Response: JSON with generated text and configuration or error message.

Start the frontend Server

Navigate to the frontend directory and start the server with:

uvicorn app:app --host 0.0.0.0 --port 8001

About

Chatbot app integrating Azure OpenAI to provide text generation based on conversation histories.


Languages

Language:Python 67.5%Language:CSS 14.2%Language:JavaScript 10.2%Language:Dockerfile 5.3%Language:HTML 2.7%