Skip to content

AarhusAI/open-webui-feedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open WebUI Feedback Extractor

A Python command-line tool for extracting and exporting feedback data from Open WebUI instances.

Features

  • Extract feedback data from Open WebUI API
  • Export to Excel (.xlsx) format
  • Display feedback in text format
  • Include user information (when available)
  • Include chat conversation data
  • Filter feedback by rating (exclude unrated feedback)
  • Support for custom SSL verification settings

Prerequisites

  • Python 3.11 or higher
  • Access to an Open WebUI instance with API access
  • Bearer token for authentication

Installation

  1. Clone this repository: git clone <repository-url> cd open-webui-feedback

  2. Create and activate a virtual environment: python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate

  3. Install dependencies: pip install -r requirements.txt

Configuration

  1. Copy the example environment file: cp .env.example .env

  2. Edit .env file with your Open WebUI instance details: BASE_URL=https://your-openwebui-instance.com BEARER_TOKEN=your_bearer_token_here VERIFY_SSL=true

Environment Variables

  • BASE_URL: The base URL of your Open WebUI instance (required)
  • BEARER_TOKEN: Your authentication bearer token (required)
  • VERIFY_SSL: Whether to verify SSL certificates (default: true)

Usage

The tool provides a command-line interface with the following options:

Basic Usage

Extract feedback to Excel file:

python main.py extract --xls --user --chat --everything

Display feedback in text format:

python main.py extract --text --user --chat

Command Options

  • --file: Specify output file name (default: feedback.xlsx)
  • --xls: Export to Excel format
  • --text: Display in text format
  • --user: Include user information (name and role)
  • --chat: Include chat conversation data
  • --everything: Include feedback without ratings

Output Format

Excel Export

The Excel file contains the following columns:

Basic Information:

  • Id: Feedback ID
  • Chat id: Associated chat ID
  • Message id: Associated message ID
  • Model: AI model used
  • Rating: User rating (if provided)
  • Reason: Feedback reason
  • Comment: User comment
  • Created at: Creation timestamp

User Information (with --user flag):

  • Name: User name
  • Role: User role

Chat Information (with --chat flag):

  • Chat title: Title of the conversation
  • User message: User's message content
  • Assistant message: AI assistant's response

Text Output

Displays feedback information in a structured text format with color-coded sections.

Error Handling

The tool includes comprehensive error handling for:

  • Missing environment variables
  • API connection issues
  • Invalid SSL certificates
  • Malformed API responses
  • File writing errors

Dependencies

  • click: Command-line interface
  • pandas: Data manipulation and Excel export
  • requests: HTTP API calls
  • python-dotenv: Environment variable management
  • openpyxl: Excel file support
  • urllib3: HTTP utilities

License

This project is licensed under the terms specified in LICENSE.txt.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Troubleshooting

SSL Certificate Issues

If you encounter SSL certificate errors, you can disable SSL verification by setting:

VERIFY_SSL=false

Authentication Issues

Ensure your bearer token is valid and has the necessary permissions to access the feedback API endpoints.

API Connection Issues

Verify that:

  • Your BASE_URL is correct and accessible
  • The Open WebUI instance is running
  • Network connectivity is available

About

A Python command-line tool for extracting and exporting feedback data from Open WebUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages