Skip to main content

AI-powered video call with virtual companions

Project description

Fancall Backend

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

주요 기능

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

설치

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

API 문서:

LiveKit 설정

서버

brew install livekit
livekit-server --dev

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

Agent

cd backend
export OPENAI_API_KEY=sk-...
export FISH_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

환경 변수

필수 (Agent 실행 시)

변수 설명
OPENAI_API_KEY OpenAI API 키
FISH_API_KEY Fish Audio TTS API 키

선택 (기능 활성화)

변수 기본값 설명
FANCALL_OPENAI_MODEL gpt-4o-mini 사용할 OpenAI LLM 모델
HEDRA_ENABLED false Hedra 아바타 활성화
HEDRA_API_KEY - Hedra API 키 (enabled=true일 때 필수)

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

의존성

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

라이선스

Apache 2.0

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

fancall-0.2.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

fancall-0.2.1-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file fancall-0.2.1.tar.gz.

File metadata

  • Download URL: fancall-0.2.1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fancall-0.2.1.tar.gz
Algorithm Hash digest
SHA256 261d2602382c6544272c095068eeca771fe7f2b4c54e92684d756fa0243c7077
MD5 e2bb1cbeed7cb231fc5bb11aeca31482
BLAKE2b-256 688a92202ed895e7ceffa708ae696059ffdc662c234706a35369802567bf9789

See more details on using hashes here.

Provenance

The following attestation bundles were made for fancall-0.2.1.tar.gz:

Publisher: publish-backend.yml on algorima/fancall

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fancall-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fancall-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fancall-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a568c7a354cb1a58a77096c5a40d1d6dee10175a8f1425d038857776c77756
MD5 5755a36dc2c8c280bf04ce7a7a456c4c
BLAKE2b-256 5510783d4e5205a5be9545e2fa92e0989e4e7f498f07b5e1c883a9c8bbc9e97d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fancall-0.2.1-py3-none-any.whl:

Publisher: publish-backend.yml on algorima/fancall

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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