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 문서:
- 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 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
데이터베이스 마이그레이션
데이터베이스 스키마를 최신 상태로 업데이트하려면:
make migrate
새로운 마이그레이션을 생성하려면 (models.py 변경 후):
poetry run alembic revision --autogenerate -m "변경 설명"
환경 변수
필수 (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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fancall-0.4.0.tar.gz.
File metadata
- Download URL: fancall-0.4.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
041f007e972be39e62796022adb6d7c65b93b1e61244621f22a2b5d9ae3f50de
|
|
| MD5 |
1a1e110538db078823e09f2148fa978a
|
|
| BLAKE2b-256 |
e27ad24218f664215286ea1f0d4182800f55b093f39e3d67c0a40463d8a42098
|
Provenance
The following attestation bundles were made for fancall-0.4.0.tar.gz:
Publisher:
publish-backend.yml on algorima/fancall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fancall-0.4.0.tar.gz -
Subject digest:
041f007e972be39e62796022adb6d7c65b93b1e61244621f22a2b5d9ae3f50de - Sigstore transparency entry: 928263340
- Sigstore integration time:
-
Permalink:
algorima/fancall@89fe74818e8be6937805d2c7a285ec971e9199f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/algorima
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-backend.yml@89fe74818e8be6937805d2c7a285ec971e9199f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fancall-0.4.0-py3-none-any.whl.
File metadata
- Download URL: fancall-0.4.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba0a7cde2dd31873699b6442487452ea8fbde58ac102de0f4704d4bc6ccc6df0
|
|
| MD5 |
c3ca712355643b16bbe0fc27434af0de
|
|
| BLAKE2b-256 |
08b13e1115b5f38fed3acee1a261e5b6bb8745d90b3a2bbc9dae8fbbb5881f08
|
Provenance
The following attestation bundles were made for fancall-0.4.0-py3-none-any.whl:
Publisher:
publish-backend.yml on algorima/fancall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fancall-0.4.0-py3-none-any.whl -
Subject digest:
ba0a7cde2dd31873699b6442487452ea8fbde58ac102de0f4704d4bc6ccc6df0 - Sigstore transparency entry: 928263359
- Sigstore integration time:
-
Permalink:
algorima/fancall@89fe74818e8be6937805d2c7a285ec971e9199f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/algorima
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-backend.yml@89fe74818e8be6937805d2c7a285ec971e9199f3 -
Trigger Event:
push
-
Statement type: