Files
XiaoYang 63a89b0c96 feat(api): add OpenAI-compatible ASR transcription endpoint
- Implement POST /audio/transcriptions and /v1/audio/transcriptions
  endpoints for automatic speech recognition
- Add support for multipart/form-data audio file uploads
- Support multiple audio formats (wav, mp3, m4a, etc.)
- Implement language detection with 29 supported languages
- Return transcription text in OpenAI-compatible JSON format
- Add proper error handling and validation
- Include comprehensive tests for ASR functionality

refactor(api): restructure API modules and export MODEL

- Move API declarations to src/api/mod.rs
- Add ASR module and type definitions
- Export MODEL static for use in ASR module
- Mount ASR routes at both /audio and /v1/audio endpoints
2026-03-06 11:41:32 +08:00

51 lines
1.3 KiB
Makefile

SHELL := bash
.DELETE_ON_ERROR:
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-print-directory
build:
@echo "Building project..."
@cargo build
build_mac:
@echo "Building project for macOS..."
@cargo build --features metal --release
build_mac_universal:
@echo "Building universal binary for macOS..."
@cargo build --features metal --release --target aarch64-apple-darwin
@cargo build --features metal --release --target x86_64-apple-darwin
@mkdir -p target/universal/release
@lipo -create target/aarch64-apple-darwin/release/aha target/x86_64-apple-darwin/release/aha -output target/universal/release/aha
test:
@echo "Running tests..."
@cargo test
clean:
@echo "Cleaning project..."
@cargo clean
fmt:
@echo "Formatting code..."
@cargo fmt --all -- --check
lint:
@echo "Linting code..."
@cargo clippy --no-deps --all-targets -- -D warnings
help:
@echo "Available commands:"
@echo " build - Build the project"
@echo " build_mac - Build the project for macOS"
@echo " test - Run tests"
@echo " clean - Clean the project"
@echo " fmt - Format the code"
@echo " lint - Lint the code"
@echo " help - Show this help message"
.PHONY: build test clean fmt lint help