Skip to main content

A FastAPI application serving ws bom/robot/llm platform ai.

Project description

🤖 ws-bom-robot-app

A FastAPI application serving ws bom/robot/llm platform ai

🌵 Minimal app structure

app/
|-- .env
|-- main.py

Fill main.py with the following code:

from ws_bom_robot_app import main
app = main.app

FIll .env with the following code:

#robot_env=local/development/production
robot_env=local
robot_user='[user]'
robot_password='[pwd]'
robot_data_folder='./.data'
robot_cms_auth='[auth]'
robot_cms_host='https://[DOMAIN]'
robot_cms_db_folder=llmVectorDb
robot_cms_files_folder=llmKbFile

🚀 Run the app

  • development

    fastapi dev --port 6001
    #uvicorn --reload --host 0.0.0.0 --port 6001 main:app
    
  • production

    fastapi run --port 6001
    
  • production with multipler workers

    fastapi run --port 6001 --workers 4
    

🔖 Windows requirements

libmagic (mandatory)

py -m pip install --upgrade python-magic-bin

tesseract-ocr (mandatory)

Install tesseract Last win-64 release

Add tesseract executable (C:\Program Files\Tesseract-OCR) to system PATH

$pathToAdd = "C:\Program Files\Tesseract-OCR"; `
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine); `
if ($currentPath -split ';' -notcontains $pathToAdd) { `
  [System.Environment]::SetEnvironmentVariable("Path", "$currentPath;$pathToAdd", [System.EnvironmentVariableTarget]::Machine) `
}

libreoffice (optional: for robot_env set to development/production)

Install libreoffice Last win-64 release

Add libreoffice executable (C:\Program Files\LibreOffice\program) to system PATH

$pathToAdd = "C:\Program Files\LibreOffice\program"; `
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine); `
if ($currentPath -split ';' -notcontains $pathToAdd) { `
  [System.Environment]::SetEnvironmentVariable("Path", "$currentPath;$pathToAdd", [System.EnvironmentVariableTarget]::Machine) `
}

poppler (optional: for robot_env set to development/production)

Download win poppler release Extract the zip, copy the nested folder "poppler-x.x.x." to a program folder (e.g. C:\Program Files\poppler-24.08.0) Add poppler executable (C:\Program Files\poppler-24.08.0\Library\bin) to system PATH

$pathToAdd = "C:\Program Files\poppler-24.08.0\Library\bin"; `
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine); `
if ($currentPath -split ';' -notcontains $pathToAdd) { `
  [System.Environment]::SetEnvironmentVariable("Path", "$currentPath;$pathToAdd", [System.EnvironmentVariableTarget]::Machine) `
}

👷 Contributors

Build/distribute pkg from websolutespa bom [Github]

dir in robot project folder

  cd ./src/robot

🔖 requirements

py -m pip install --upgrade setuptools build twine streamlit 

🪛 build

if (Test-Path ./dist) {rm ./dist -r -force}; `
cp .\requirements.txt .\ws_bom_robot_app\ && `
py -m build && `
twine check dist/*

📦 test / 🧪 debugger

Install the package in editable project location

py -m pip install --upgrade -e .
py -m pip show ws-bom-robot-app

launch the debugger

streamlit run debugger.py --server.port 6002

✈️ publish

  • testpypi

    twine upload --verbose -r testpypi dist/*
    #py -m pip install -i https://test.pypi.org/simple/ --upgrade ws-bom-robot-app 
    
  • pypi

    twine upload --verbose dist/* 
    #py -m pip install --upgrade ws-bom-robot-app
    

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

ws_bom_robot_app-0.0.5.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

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

ws_bom_robot_app-0.0.5-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file ws_bom_robot_app-0.0.5.tar.gz.

File metadata

  • Download URL: ws_bom_robot_app-0.0.5.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for ws_bom_robot_app-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9ceb14971bd035a46c7def71d57346107e956aff256e521dd55e92d1e3841c67
MD5 bfb22313b82e88c6f22cf31ceb43605b
BLAKE2b-256 7d548a82f481c540f0bc24af89e9e36cea977a0fb673578d63e9c077375e6e27

See more details on using hashes here.

File details

Details for the file ws_bom_robot_app-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ws_bom_robot_app-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9aea093887a1f20d4e76ca5f8f7abf3175d1c543e5d4a87e10d9a6c8802552b6
MD5 1fa770e1b9f068965a7b7e62f94a7ae8
BLAKE2b-256 2653118587765721fa704ea541ff20a0b9737a8c9f1ed6d2c341498b3eed2d1a

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