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.1.tar.gz (584.9 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.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openwebui_client-0.1.1.tar.gz
  • Upload date:
  • Size: 584.9 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.1.tar.gz
Algorithm Hash digest
SHA256 e24e670f539870d2e82156ddf01d053ae99df340cf855a57c568c86faec2ec64
MD5 4828fe967d9760c0ad57c7e9a3da11d9
BLAKE2b-256 871d4adfca7ac17030c89c8228c1672e5c6e759cef0dd208f2d0e3e2b8f14e24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openwebui_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f43c652e67297be83c276dc4d2c8486ec954ba8387c5000afdaed3b50c927db
MD5 601265c499f18aebf9de9dcbe6065888
BLAKE2b-256 8297fddef7586d6f9c22a7f5fe98bf98e52d3d87102e9862643ca24e7a25bde1

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