clever-doctor-15083
02/15/2025, 8:21 AMgray-monkey-83525
02/15/2025, 8:21 AMretrieve_extra_information
to perform vector searches and provide additional context before generating a response.
Would you like more details on how to set this up?
Sources:
- LiveKit Pipeline Agent Documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.miniature-nail-35141
03/03/2025, 6:00 AMgray-monkey-83525
03/03/2025, 6:00 AMminiature-nail-35141
03/03/2025, 6:02 AMgray-monkey-83525
03/03/2025, 6:02 AMVoicePipelineAgent
to enable the agent to use the function during its operation.
3. Perform Vector Search: When the function is called, perform a vector search using your RAG setup to retrieve relevant documents or information.
Here's a simplified code snippet to illustrate the setup:
from livekit.agents import llm
from livekit.agents.pipeline import VoicePipelineAgent
class AssistantFnc(llm.FunctionContext):
@llm.ai_callable()
async def retrieve_extra_information(self, query: str):
# Implement your vector search logic here
# For example, query your vector database and return results
return "Relevant information based on query"
fnc_ctx = AssistantFnc()
pipeline_agent = VoicePipelineAgent(
vad=vad_instance,
stt=stt_instance,
llm=llm_instance,
tts=tts_instance,
fnc_ctx=fnc_ctx
)
Would you like more detailed guidance on any specific part of this process?
Sources:
- https://livekit-users.slack.com/archives/C07FY8WHGPM/p1728300800.962959
- https://livekit-users.slack.com/archives/C025KM0S1CK/p1732170429.559829 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.miniature-nail-35141
03/03/2025, 6:06 AMgray-monkey-83525
03/03/2025, 6:06 AMminiature-nail-35141
03/03/2025, 6:10 AMgray-monkey-83525
03/03/2025, 6:10 AM