Skip to content

Commit

Permalink
examples: updated llamaindex-rag examples to use VoicePipelineAgent (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hamdananwar authored Oct 14, 2024
1 parent 6b2aa77 commit cce8e08
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from dotenv import load_dotenv
from livekit.agents import AutoSubscribe, JobContext, WorkerOptions, cli, llm
from livekit.agents.voice_assistant import VoiceAssistant
from livekit.agents.pipeline import VoicePipelineAgent
from livekit.plugins import deepgram, llama_index, openai, silero
from llama_index.core import (
SimpleDirectoryReader,
Expand Down Expand Up @@ -41,7 +41,7 @@ async def entrypoint(ctx: JobContext):

await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)

assistant = VoiceAssistant(
assistant = VoicePipelineAgent(
vad=silero.VAD.load(),
stt=deepgram.STT(),
llm=llama_index.LLM(chat_engine=chat_engine),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from dotenv import load_dotenv
from livekit.agents import AutoSubscribe, JobContext, WorkerOptions, cli, llm
from livekit.agents.voice_assistant import VoiceAssistant
from livekit.agents.pipeline import VoicePipelineAgent
from livekit.plugins import deepgram, openai, silero
from llama_index.core import (
SimpleDirectoryReader,
Expand Down Expand Up @@ -47,7 +47,7 @@ async def query_info(query: str) -> str:
print("Query result:", res)
return str(res)

assistant = VoiceAssistant(
assistant = VoicePipelineAgent(
vad=silero.VAD.load(),
stt=deepgram.STT(),
llm=openai.LLM(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from dotenv import load_dotenv
from livekit.agents import AutoSubscribe, JobContext, WorkerOptions, cli, llm
from livekit.agents.voice_assistant import VoiceAssistant
from livekit.agents.pipeline import VoicePipelineAgent
from livekit.plugins import deepgram, openai, silero
from llama_index.core import (
SimpleDirectoryReader,
Expand Down Expand Up @@ -40,7 +40,7 @@ async def entrypoint(ctx: JobContext):
initial_ctx.messages.append(system_msg)

async def _will_synthesize_assistant_reply(
assistant: VoiceAssistant, chat_ctx: llm.ChatContext
assistant: VoicePipelineAgent, chat_ctx: llm.ChatContext
):
ctx_msg = system_msg.copy()
user_msg = chat_ctx.messages[-1]
Expand All @@ -57,7 +57,7 @@ async def _will_synthesize_assistant_reply(

await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)

assistant = VoiceAssistant(
assistant = VoicePipelineAgent(
vad=silero.VAD.load(),
stt=deepgram.STT(),
llm=openai.LLM(),
Expand Down

0 comments on commit cce8e08

Please sign in to comment.