Fix request_image_frame and usage
This commit is contained in:
@@ -68,13 +68,7 @@ async def get_image(params: FunctionCallParams):
|
|||||||
text_content=question,
|
text_content=question,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Wait a short time for the frame to be processed
|
await params.result_callback(None)
|
||||||
await asyncio.sleep(0.5)
|
|
||||||
|
|
||||||
# Return a result to complete the function call
|
|
||||||
await params.result_callback(
|
|
||||||
f"I've captured an image from your camera and I'm analyzing what you asked about: {question}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# We store functions so objects (e.g. SileroVADAnalyzer) don't get
|
# We store functions so objects (e.g. SileroVADAnalyzer) don't get
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ async def get_image(params: FunctionCallParams):
|
|||||||
text_content=question,
|
text_content=question,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await params.result_callback(None)
|
||||||
|
|
||||||
|
|
||||||
async def get_saved_conversation_filenames(params: FunctionCallParams):
|
async def get_saved_conversation_filenames(params: FunctionCallParams):
|
||||||
# Construct the full pattern including the BASE_FILENAME
|
# Construct the full pattern including the BASE_FILENAME
|
||||||
@@ -257,7 +259,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady
|
voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady
|
||||||
)
|
)
|
||||||
|
|
||||||
llm = GoogleLLMService(model="gemini-2.0-flash-001", api_key=os.getenv("GOOGLE_API_KEY"))
|
llm = GoogleLLMService(api_key=os.getenv("GOOGLE_API_KEY"))
|
||||||
|
|
||||||
# you can either register a single function for all function calls, or specific functions
|
# you can either register a single function for all function calls, or specific functions
|
||||||
# llm.register_function(None, fetch_weather_from_api)
|
# llm.register_function(None, fetch_weather_from_api)
|
||||||
|
|||||||
@@ -519,6 +519,7 @@ class LLMService(AIService):
|
|||||||
UserImageRequestFrame(
|
UserImageRequestFrame(
|
||||||
user_id=user_id,
|
user_id=user_id,
|
||||||
text=text_content,
|
text=text_content,
|
||||||
|
append_to_context=True,
|
||||||
# Deprecated fields below.
|
# Deprecated fields below.
|
||||||
function_name=function_name,
|
function_name=function_name,
|
||||||
tool_call_id=tool_call_id,
|
tool_call_id=tool_call_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user