Update 05- sample, sticking with generators here because they give us a lot more control over the order that things get queued.
This commit is contained in:
@@ -32,6 +32,10 @@ async def main(room_url:str):
|
||||
# queue two pieces of speech: one specified as a text literal,
|
||||
# and one generated by an llm. We'll kick off the llm first, and let
|
||||
# it generate a response while we're speaking the literal string.
|
||||
#
|
||||
# Note that in this case, we don't use `run_llm_async` because we're
|
||||
# taking advantage of the time spent speaking the first phrase to generate
|
||||
# the entire LLM response, and this happens asynchronously in a task.
|
||||
llm_response_task = asyncio.create_task(llm.run_llm(
|
||||
[{"role": "system", "content": "tell the user a joke about llamas"}]
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user