ToolFlag.IGNORE_ON_ENTER Is Broken With Amazon Nova 2 Sonic
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- aws, python
- Ambito
- audio-video-rtc
Direzione di ricerca
Start with the supplied reproduction, focusing on the three generate_reply calls in TestAgent.on_enter and the function_tool decorated with ToolFlag.IGNORE_ON_ENTER. Compare behavior with versions 1.6.4 and 1.6.5 or later using the listed Nova 2 Sonic setup. Done means each on_enter call plays audio while the flag still excludes the tool; a linked pull request is already open.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
When using the ToolFlag.IGNORE_ON_ENTER flag on a function_tool with AWS nova 2 sonic, multiple generate_reply calls in an on_enter function won't play audio. IE, the first generate_reply call will generate audio, however subsequent generate_reply calls will not. This only affects livekit-agents and livekit-plugins-aws[realtime] versions greater or equal to 1.6.5. Version 1.6.4 is does not contain the defect.
Expected Behavior
ToolFlag.IGNORE_ON_ENTER won't affect audio being played from an on_enter function. The flag is only supposed to exclude any tool from any generate_reply calls made inside the agent's on_enter method.
Reproduction Steps
Test file:
from livekit.agents import AgentServer, WorkerOptions, JobContext, AutoSubscribe, function_tool, RunContext
from livekit.agents.cli import run_app
from livekit.agents.llm import ToolFlag
from livekit.plugins import aws
from livekit.agents import TurnHandlingOptions, AgentSession, Agent
import dotenv
# loads the following env vars in .env file.
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_SESSION_TOKEN
# AWS_REGION
# LIVEKIT_URL
# LIVEKIT_API_KEY
# LIVEKIT_API_SECRET
dotenv.load_dotenv()
def main() -> None:
server = AgentServer.from_server_options(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name='fake-agent-name', # CHANGE THIS
load_threshold=0.99,
max_retry=6,
port=8080,
drain_timeout=900,
prometheus_port=9095,
multiprocessing_context="spawn",
)
)
run_app(server)
async def entrypoint(ctx: JobContext) -> None:
session = AgentSession(
llm=aws.realtime.RealtimeModel(
model="amazon.nova-2-sonic-v1:0",
tool_choice="auto",
max_tokens=6000,
temperature=0,
region='us-west-2',
turn_detection="HIGH",
),
tts=aws.TTS(voice="Ruth", region='us-west-2'),
turn_handling=TurnHandlingOptions(
interruption={"resume_false_interruption": True, "false_interruption_timeout": 1.0},
),
)
await session.start(room=ctx.room, agent=TestAgent())
await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
class TestAgent(Agent):
def __init__(self, *args, **kwargs) -> None:
super().__init__(
*args,
instructions='you are test agent. just have a conversation',
tools=[test_tool],
**kwargs,
)
async def on_enter(self):
await self.session.generate_reply(instructions='say hello') # will generate audio
await self.session.generate_reply(instructions='introduce yourself') # doesn't generate audio
await self.session.generate_reply(instructions='say goodbye') # doesn't generate audio
@function_tool(flags=ToolFlag.IGNORE_ON_ENTER)
def test_tool(context: RunContext) -> None:
"""Call this tool when the user requests that you execute the test tool."""
context.session.generate_reply(instructions='announce that you just called the test tool')
if __name__ == "__main__":
main()
Call into the agent, and the generate_reply calls in the on_enter function will not play audio. Removing ToolFlag.IGNORE_ON_ENTER from the function tool and calling back will play audio
Operating System
macOS Tahoe/Linux Debian GNU/Linux 12 (bookworm)
Models Used
Nova 2 Sonic
Package Versions
livekit-agents==1.6.8
livekit-plugins-aws[realtime]==1.6.8
livekit==1.1.14
livekit-api==1.2.0
Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings
No response
- Lingua principale
- Python
- Stelle
- 14.6k
- Fork
- 3.9k
- Merge medio
- 2g 9h
- PR unite (30g)
- 159
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di livekit/agents
-
BM25SearchStrategy (the default) never matches underscore-joined terms in tool descriptions or param descriptionsForse già presa @BlueX888 l’ha presa 2 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
livekit/agents#7727 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Assistant markup is stripped from chat history when expressive mode is offForse già presa @ShivamSharma43 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsForse di nuovo libera @AbarnaaSree l’ha presa 45 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
livekit/agents#7022 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
elevenlabs: text-to-dialogue (v3/v4) alignment timestamps are chunk-relative, breaking synced transcriptsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di livekit/agents
Issue simili
-
fix(accounts): Balance Sheet and Profit and Loss crash on PostgreSQL due to MySQL force_indexAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Discord webhook notifications fail with HTTP 403 (Cloudflare blocks default urllib User-Agent)Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
tharje/spooler-v2#20 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Bump version of azure-servicebusForse già presa @joostlek l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
home-assistant/core#186275 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100