Skip to main content

A client library for the OpenWebUI API, compatible with OpenAI Python SDK

Project description

This seems to work:

#!/bin/bash

# Configuration
API_BASE_URL="https://ai.bemade.org"
AUTH_TOKEN="..." # Fill with a real token
PDF_PATH="..." # Fill with a real value

# Vérifier si le fichier existe
if [ ! -f "$PDF_PATH" ]; then
    echo "Erreur: Le fichier $PDF_PATH n'existe pas."
    exit 1
fi

# Télécharger le fichier PDF
echo "Téléchargement du fichier PDF..."
FILE_RESPONSE=$(curl -s -X POST \
  "${API_BASE_URL}/api/v1/files/" \
  -H "Authorization: Bearer ${AUTH_TOKEN}" \
  -F "file=@${PDF_PATH}" \
  -F "process=true")

# Afficher la réponse complète pour le débogage
echo "Réponse complète du serveur:"
echo "$FILE_RESPONSE"

# Vérifier si la réponse contient un ID de fichier
if echo "$FILE_RESPONSE" | grep -q "id"; then
    FILE_ID=$(echo $FILE_RESPONSE | grep -o '"id":"[^"]*"' | cut -d'"' -f4)
    echo "Fichier téléchargé avec succès!"
    echo "ID du fichier: $FILE_ID"
else
    echo "Erreur lors du téléchargement du fichier."
fi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openwebui_client-0.1.0.tar.gz (584.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openwebui_client-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file openwebui_client-0.1.0.tar.gz.

File metadata

  • Download URL: openwebui_client-0.1.0.tar.gz
  • Upload date:
  • Size: 584.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for openwebui_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 043c7e65173b00be200c6b7d65a339fb7d5fc5bae2d3d12685ea63b396c5de20
MD5 4d1221e9faed813cab4f81548d4f4259
BLAKE2b-256 31fa4b5fe6c4d0a913b5c38346034aa46f73fa70ec4a98e6ad8d12fc356a96a7

See more details on using hashes here.

File details

Details for the file openwebui_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openwebui_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fef9aa3a5eac2449ea02a008c2068d045e25568e8ff6a5f3700d333c918cbb8
MD5 cdfe08e558b78d4d28e8a717de512773
BLAKE2b-256 8f4cf0d126aee80c3bccd28e0804851357c05e8037919cc69bc2d38e1df49a80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page