Skip to main content

libs for cameramonit, ocr, fin-officer, cfo, and other projects

Project description

movatalk

System pipelinów KidsVoiceAI

System pipelinów KidsVoiceAI umożliwia tworzenie złożonych aplikacji głosowych za pomocą prostych plików konfiguracyjnych YAML, bez konieczności pisania kodu w Pythonie. Pipelines łączą gotowe komponenty i operacje w jeden spójny przepływ pracy.

Spis treści

  1. Wprowadzenie do pipelinów
  2. Struktura pliku YAML
  3. Komponenty pipelinów
  4. Zmienne i kontekst
  5. Kroki warunkowe i pętle
  6. Programistyczne użycie pipelinów
  7. Tworzenie własnych komponentów
  8. Kreator pipelinów
  9. Wizualizacja pipelinów
  10. Przykłady

Wprowadzenie do pipelinów

Pipeline to sekwencja kroków, które są wykonywane kolejno, aby osiągnąć określony cel. W kontekście KidsVoiceAI, pipeline może reprezentować na przykład asystenta głosowego, który:

  1. Słucha pytania użytkownika
  2. Przetwarza mowę na tekst
  3. Wysyła zapytanie do modelu językowego
  4. Filtruje odpowiedź pod kątem bezpieczeństwa
  5. Zamienia tekst na mowę i odtwarza odpowiedź

Zamiast pisać kod w Pythonie, możesz zdefiniować taki przepływ pracy w pliku YAML, który jest łatwy do czytania i modyfikacji.

Struktura pliku YAML

Plik pipeline'u YAML składa się z następujących elementów:

name: "Nazwa pipeline'u"
description: "Opis działania pipeline'u"
version: "1.0.0"

variables:
  zmienna1: "wartość1"
  zmienna2: "wartość2"

steps:
  - name: "k

Install

pip install movatalk
git clone https://github.com/movatalk/python.git movatalk

Contributing

python3 -m venv pytest-env
source pytest-env/bin/activate
pip install --upgrade pip
pip install pytest

run the test, execute the pytest command:

pytest

Tips

simple method to generate a requirements.txt file is to pipe them,

pip freeze > requirements.txt
pip freeze > requirements/runtime.txt

if push not possible

[remote rejected] (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/python-app.yml` without `workflow` scope)

Problem z odrzuceniem tokena dostępu osobistego (Personal Access Token, PAT) podczas próby aktualizacji pliku workflow, musisz zaktualizować uprawnienia swojego tokena.

Oto kroki, które powinieneś podjąć:

  1. Przejdź do ustawień GitHub:

    • Kliknij na swój awatar w prawym górnym rogu GitHub
    • Wybierz "Settings"
  2. Przejdź do ustawień deweloperskich:

    • W lewym menu wybierz "Developer settings"
  3. Zarządzaj tokenami dostępu:

    • Wybierz "Personal access tokens"
    • Następnie "Tokens (classic)"
  4. Utwórz nowy token lub zaktualizuj istniejący:

    • Jeśli tworzysz nowy, kliknij "Generate new token"
    • Jeśli aktualizujesz istniejący, znajdź odpowiedni token i kliknij "Edit"
  5. Dodaj uprawnienie "workflow":

    • Przewiń do sekcji "Select scopes"
    • Zaznacz pole obok "workflow"
  6. Zapisz zmiany:

    • Przewiń na dół i kliknij "Generate token" (dla nowego) lub "Update token" (dla istniejącego)
  7. Skopiuj nowy token:

    • Upewnij się, że skopiowałeś nowy token, ponieważ nie będziesz mógł go zobaczyć ponownie
  8. Zaktualizuj token w swoim lokalnym repozytorium:

    • Jeśli używasz HTTPS, zaktualizuj swoje dane logowania
    • Jeśli używasz SSH, upewnij się, że Twój klucz SSH jest poprawnie skonfigurowany
  9. Spróbuj ponownie wykonać push:

    • Użyj nowego tokena do autoryzacji

Pamiętaj, że tokeny dostępu osobistego są bardzo wrażliwe na bezpieczeństwo. Traktuj je jak hasła i nigdy nie udostępniaj ich publicznie. Jeśli przypadkowo ujawnisz swój token, natychmiast go usuń i wygeneruj nowy.

Po wykonaniu tych kroków, powinieneś być w stanie zaktualizować plik workflow bez problemów. Jeśli nadal napotkasz problemy, upewnij się, że masz odpowiednie uprawnienia w repozytorium i że workflow nie są zablokowane przez ustawienia organizacji lub repozytorium.

update PAT in repo

our local repo and want to push it to a remote repo.

create a PAT (personal access token): official doc here. Make sure to tick the box "workflow" when creating it. In the terminal, instead of the classic

git remote add origin https://github.com/<account>/<repo>.git

swap it by

git remote add origin https://<PAT>@github.com/<account>/<repo>.git

example

# check
git remote -v
PAT=...
git remote add origin https://$PAT@github.com/movatalk/python.git
# OR update:
git remote set-url origin https://$PAT@github.com/movatalk/python.git
# check
git remote -v
git push

Follow-up with the classic git branch -M main and git push -u origin main

That worked for me. Hopefully for you too.

pypi publishing

Creating a PyPI Project with a Trusted Publisher - PyPI Docs

Creating tags from the command line

To create a tag on your current branch, run this:

git tag <tagname>

If you want to include a description with your tag, add -a to create an annotated tag:

git tag <tagname> -a

This will create a local tag with the current state of the branch you are on. When pushing to your remote repo, tags are NOT included by default. You will need to explicitly say that you want to push your tags to your remote repo:

git push origin --tags

example:

git tag 0.1.12
git push origin --tags

test

pip install build
pip install build hatchling
py -m build

Quick Start

Local Development

  1. Create virtual environment
rm -rf venv
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

I see a persistent issue with your package publication process. Let me help you resolve these problems:

  1. Version Detection Problem The error messages show that the version is not being correctly detected:
❌ Could not find version in src/movatalk/__init__.py
❌ Could not find version in ./src/movatalk/_version.py
❌ Could not find version in ./pyproject.toml
  1. License Classifier Issue There's an ongoing problem with the license classifier in the pyproject.toml.

  2. Replace your existing pyproject.toml with the new version

  3. Create src/movatalk/_version.py with the content I provided

  4. Remove any existing setup.py if it exists

  5. Use python -m build to create distribution

  6. Use twine upload dist/* to publish

Recommended workflow:

# Ensure you're in your project root
python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*

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

movatalk-0.1.41.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

movatalk-0.1.41-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file movatalk-0.1.41.tar.gz.

File metadata

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

File hashes

Hashes for movatalk-0.1.41.tar.gz
Algorithm Hash digest
SHA256 006e88834d4163ab28ecd5dfe19b81e5e52abbb361ed1eb3bfedef8f9744e87e
MD5 4085aa19ebd02ebacd65295ba9f1a586
BLAKE2b-256 c29343b61775aa9e2d0c5888c014475a96dad26242098527f6d63fc1c982aef6

See more details on using hashes here.

File details

Details for the file movatalk-0.1.41-py3-none-any.whl.

File metadata

  • Download URL: movatalk-0.1.41-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for movatalk-0.1.41-py3-none-any.whl
Algorithm Hash digest
SHA256 1456593f6df96be666cec12ccc4910746bcbd637475b51809565e329f8adc8c9
MD5 59f56f3c08c48fe95bbcd56046bfb6a4
BLAKE2b-256 d984928bc5c78f7fddd293fc12df3f42e984bb0f6fed51f7db1ff1ef332b3844

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