Skip to main content

Fancall Backend

AI 아이돌과 실시간 영상 통화 Python 패키지

주요 기능

  • LiveKit 기반 실시간 음성/영상 통화
  • ElevenLabs TTS 음성 합성
  • Hedra 아바타 지원 (선택)
  • 동적 설정 (voice_id, avatar_id, system_prompt)

Fish Audio에서 옮겨오는 호스트 앱: voice_id는 이제 ElevenLabs voice ID입니다. 기존 Fish Audio voice_id를 그대로 넘기면 ElevenLabs에서 찾지 못해 음성 합성이 실패하므로, ElevenLabs voice ID로 바꾸거나 voice_id를 비워 기본 목소리를 쓰세요. create_worker_options()의 fish_settings 인자는 elevenlabs_settings로 바뀌었습니다.

설치

cd backend
poetry install
poetry run uvicorn main:app --reload

API 문서:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

LiveKit 설정

서버

brew install livekit
livekit-server --dev

서버: ws://localhost:7880 (API Key: devkey, Secret: secret)

Agent

cd backend
export OPENAI_API_KEY=sk-...
export ELEVEN_API_KEY=...

# 개발 모드
python -m fancall.agent.worker dev

# 프로덕션 모드
python -m fancall.agent.worker start

# 특정 룸 연결
python -m fancall.agent.worker connect --room <room-name>

사용법

FastAPI 통합

from fancall.api.router import create_fancall_router
from fancall.factories import LiveRoomRepositoryFactory
from fancall.settings import LiveKitSettings

router = create_fancall_router(
    livekit_settings=LiveKitSettings(),
    jwt_settings=jwt_settings,
    db_session_factory=db_session_factory,
    repository_factory=LiveRoomRepositoryFactory(db_session_factory),
)
app.include_router(router, prefix="/api")

개발

poetry install
make lint
make type-check
make unit-test
make format

데이터베이스 마이그레이션

데이터베이스 스키마를 최신 상태로 업데이트하려면:

make migrate

새로운 마이그레이션을 생성하려면 (models.py 변경 후):

poetry run alembic revision --autogenerate -m "변경 설명"

환경 변수

필수 (Agent 실행 시)

변수 설명
OPENAI_API_KEY OpenAI API 키
ELEVEN_API_KEY ElevenLabs TTS API 키

선택 (기능 활성화)

변수 기본값 설명
FANCALL_OPENAI_MODEL gpt-4o-mini 사용할 OpenAI LLM 모델
FANCALL_ELEVENLABS_MODEL eleven_flash_v2_5 사용할 ElevenLabs TTS 모델
HEDRA_ENABLED false Hedra 아바타 활성화
HEDRA_API_KEY - Hedra API 키 (enabled=true일 때 필수)
CORS_ALLOWED_ORIGINS http://localhost:3000 쿠키를 실은 요청을 허용할 프런트 origin (쉼표로 구분). 운영에서는 실제 도메인으로 설정

참고: LiveKit, 데이터베이스, 모델 등 추가 설정은 기본값으로 로컬 개발 가능합니다. 변경이 필요한 경우 fancall/settings.py의 Settings 클래스를 참고하세요.

의존성

  • aioia-core (공통 인프라)
  • FastAPI, SQLAlchemy, Pydantic
  • livekit-api, livekit-agents

라이선스

Apache 2.0

Metadata

Release files for fancall 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fancall 0.8.0
File Size Uploaded Provenance
fancall-0.8.0.tar.gz 24.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fancall 0.8.0
File Interpreter ABI Platform
fancall-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.7 kB

Release files / fancall-0.8.0.tar.gz

Download URL fancall-0.8.0.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1c3fbf724f8f617e8c0bcf7c0d4e854a56b417a4405628fda6dea5a005262b54
BLAKE2b-256 checksum
How to use checksums
2c535fddadf5ddb102049090ddefad0b1294afbcb4dde3369f06932672988df3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / fancall-0.8.0-py3-none-any.whl

Download URL fancall-0.8.0-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db257f0e68aacab89b7d4d38c47949aafb08deb11dca17e6f12d8ddcccb747a6
BLAKE2b-256 checksum
How to use checksums
118ea942d0e70dcdfeb2ccb51214aae7f39a14c96e6331d68c597cdb5e2ca364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for fancall 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fancall-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page