realsanjay's picture
Update README.md
da4a1b5 verified

A newer version of the Streamlit SDK is available: 1.51.0

Upgrade
metadata
title: Mistral AI Chat Application
emoji: πŸŒ–
colorFrom: gray
colorTo: green
sdk: streamlit
sdk_version: 1.42.2
app_file: app.py
pinned: false
license: other

Mistral AI Chat Application

A Streamlit-based chat application powered by Mistral AI's language models.

Features

  • Clean and intuitive chat interface
  • Real-time responses from Mistral AI
  • Message history persistence
  • Easy-to-use sidebar controls
  • Responsive design

Setup

  1. Clone this repository
  2. Install the required dependencies:
    pip install -r requirements.txt
    
  3. Create a .env file and add your Mistral AI API key:
    MISTRAL_API_KEY=your_api_key_here
    
    Get your API key from Mistral AI Platform

Running the Application

Run the application using Streamlit:

streamlit run app.py

The application will open in your default web browser at http://localhost:8501.

Usage

  1. Enter your message in the chat input at the bottom of the screen
  2. Press Enter to send your message
  3. Wait for the AI's response
  4. Use the "Clear Chat" button in the sidebar to start a new conversation

Models Available

The application uses the following Mistral AI models:

  • mistral-tiny (default)
  • mistral-small
  • mistral-medium

To change the model, modify the model parameter in the client.chat() function call in app.py.

Requirements

  • Python 3.7+
  • Streamlit
  • Mistral AI Python SDK
  • python-dotenv

Note

Make sure to keep your API key secure and never commit it to version control.