Skip to content

Files

Latest commit

 

History

History

FlaskApp-Python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Flask App / Python

The app uses Generative AI and Large Language Models (LLM) specifically PaLM2 APIs to understand and respond to user messages.

Screenshots

Here are some screenshots of the app:

Screenshot 3
A simple UI for the conversation with the clients

Screenshot 7
If the Summarize button clicked, the summary will appear on the bottom

This is a step-by-step guide to deploying a Python-based REST API on Cloud Run. The guide follows the instructions provided in the official Cloud Run documentation here.

To Use The Deployment API Endpoints

To interact with the deployed API endpoints, their information below.

/chat

This endpoint allows you to have a conversation with the English Chat Bard model.

Endpoint

  • URL: <Your URL>/chat
  • Method: POST

Request Payload

{
    "message": "User's message in English"
}

Response Payload

{
    "response": "Response from the English Chat Bard model"
}

/summary

This endpoint generates a summary of a conversation between a customer and the English Chat Bard model.

Endpoint

  • URL: <Your URL>/summary
  • Method: POST

Request Payload

{
    "content": "Conversation content in English"
}

Response Payload

{
    "response": "Summary of the conversation in English"
}

Arabic Chat Bard

This section includes endpoints related to the Arabic Chat Bard model.

/chat_ar

This endpoint allows you to have a conversation with the Arabic Chat Bard model.

Endpoint

  • URL: <Your URL>/chat_ar
  • Method: POST

Request Payload

{
  "message": "User's message in Arabic"
}

Response Payload

{
  "response": "Response from the Arabic Chat Bard "
}

/summary_ar

This endpoint generates a summary of a conversation between a customer and the Arabic Chat Bard.

Endpoint

  • URL: <Your URL>/summary_ar
  • Method: POST

Request Payload

{
  "content": "Conversation content in Arabic"
}

Response Payload

{
  "response": "Summary of the conversation in Arabic"
}

/en2ar

This endpoint translates English text to Arabic.

Endpoint

  • URL: <Your URL>/en2ar
  • Method: POST

Request Payload

{
  "response": "English text to be translated"
}

Response Payload

{
  "response": "Translated Arabic text"
}

/ar2en

This endpoint translates Arabic text to English.

Endpoint

  • URL: <Your URL>/ar2en
  • Method: POST

Request Payload

{
  "response": "Arabic text to be translated"
}

Response Payload

{
  "response": "Translated English text"
}

Contributing

Contributions to the app are welcome! If you find any issues or want to add new features, feel free to open a pull request.

License

The app is released under the MIT License.