Skip to content

Commit ca5a831

Browse files
committed
Remove dead code; nits
1 parent 172a2d3 commit ca5a831

File tree

5 files changed

+8
-27
lines changed

5 files changed

+8
-27
lines changed

examples/avatar_agents/keyframe/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ await avatar.set_emotion("happy") # "neutral", "happy", "sad", "angry"
3737
To let the LLM control the avatar's expression, register it as a tool:
3838

3939
```python
40-
@session.tool()
40+
@function_tool()
4141
async def set_avatar_emotion(emotion: keyframe.Emotion):
4242
"""Set the avatar's facial expression and demeanor."""
4343
await avatar.set_emotion(emotion)

livekit-plugins/livekit-plugins-keyframe/livekit/plugins/keyframe/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414

1515
from .avatar import AvatarSession
1616
from .errors import KeyframeException
17-
from .types import Emotion, PersonaConfig
17+
from .types import Emotion
1818
from .version import __version__
1919

2020
__all__ = [
2121
"AvatarSession",
2222
"Emotion",
2323
"KeyframeException",
24-
"PersonaConfig",
2524
"__version__",
2625
]
2726

livekit-plugins/livekit-plugins-keyframe/livekit/plugins/keyframe/avatar.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def __init__(
5454
)
5555

5656
# Resolve persona
57-
self._persona_id = persona_id if utils.is_given(persona_id) else None
58-
self._persona_slug = persona_slug if utils.is_given(persona_slug) else None
59-
60-
has_id = bool(self._persona_id)
61-
has_slug = bool(self._persona_slug)
57+
has_id = utils.is_given(persona_id)
58+
has_slug = utils.is_given(persona_slug)
6259
if has_id == has_slug:
6360
raise KeyframeException("Provide exactly one of persona_id or persona_slug")
6461

62+
self._persona_id = persona_id if has_id else None
63+
self._persona_slug = persona_slug if has_slug else None
64+
6565
# Resolve API config
6666
api_url_val = (
6767
api_url if utils.is_given(api_url) else os.getenv("KEYFRAME_API_URL", DEFAULT_API_URL)
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
from dataclasses import dataclass
21
from typing import Literal
32

43
Emotion = Literal["neutral", "happy", "sad", "angry"]
5-
6-
7-
@dataclass
8-
class PersonaConfig:
9-
"""Configuration for Keyframe Labs avatar persona.
10-
11-
Provide exactly one of persona_id or persona_slug.
12-
"""
13-
14-
persona_id: str | None = None
15-
persona_slug: str | None = None
16-
17-
def __post_init__(self) -> None:
18-
has_id = bool(self.persona_id and self.persona_id.strip())
19-
has_slug = bool(self.persona_slug and self.persona_slug.strip())
20-
if has_id == has_slug:
21-
raise ValueError("Provide exactly one of persona_id or persona_slug")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.0"
1+
__version__ = "1.4.3"

0 commit comments

Comments
 (0)