-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move create_ai_function_info
to function_context.py
#1260
Conversation
… reduce repetation
🦋 Changeset detectedLatest commit: d6da32b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create_ai_function_info
to function_context.pycreate_ai_function_info
to function_context.py
def create_ai_function_info( | ||
fnc_ctx: FunctionContext, | ||
tool_call_id: str, | ||
fnc_name: str, | ||
raw_arguments: str, # JSON string | ||
) -> FunctionCallInfo: | ||
if fnc_name not in fnc_ctx.ai_functions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was initially for OpenAI but if they all support the same kind of arguments (same json format).
Then it makes sense to move it.
Tho I'm not sure about what the implementation will looks like when we add support for structured output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this function prefixed with _ tho. It's not really relevant to users
@@ -289,6 +289,8 @@ async def recv_task(ws: aiohttp.ClientWebSocketResponse): | |||
except Exception: | |||
logger.exception("failed to process AssemblyAI message") | |||
|
|||
ws: aiohttp.ClientWebSocketResponse | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't add assemblyai to the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have, but test case was failing because it wasn't able to access ws
in finally
https://github.com/livekit/agents/blob/main/livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/stt.py#L313
create_ai_function_info
to function_context.py for better reusability and reduce repetationUnboundLocalError
intest_stt.py::test_stream[24000-assemblyai]
by ensuringws
is initialized before access.