diff --git a/docs/10-dynamic-routes-via-openai-function-calling.ipynb b/docs/10-dynamic-routes-via-openai-function-calling.ipynb index 0eb3ae16e25c4d02ddf002d0cd0b781e94c87d93..e20ade1b8218bdf94269d24669f9b7f79a991949 100644 --- a/docs/10-dynamic-routes-via-openai-function-calling.ipynb +++ b/docs/10-dynamic-routes-via-openai-function-calling.ipynb @@ -134,7 +134,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "\u001b[32m2024-04-27 02:23:29 INFO semantic_router.utils.logger local\u001b[0m\n" + "\u001b[32m2024-04-28 22:54:05 INFO semantic_router.utils.logger local\u001b[0m\n" ] } ], @@ -253,7 +253,7 @@ { "data": { "text/plain": [ - "'18:23'" + "'14:54'" ] }, "execution_count": 6, @@ -388,7 +388,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "\u001b[32m2024-04-27 02:23:30 INFO semantic_router.utils.logger Adding `get_time` route\u001b[0m\n" + "\u001b[32m2024-04-28 22:54:06 INFO semantic_router.utils.logger Adding `get_time` route\u001b[0m\n" ] } ], @@ -407,7 +407,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 11, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -418,25 +418,10 @@ }, "outputs": [ { - "name": "stdout", + "name": "stderr", "output_type": "stream", "text": [ - "##################################################\n", - "tools\n", - "[{'type': 'function', 'function': {'name': 'get_time', 'description': 'Finds the current time in a specific timezone.\\n\\n:param timezone: The timezone to find the current time in, should\\n be a valid timezone from the IANA Time Zone Database like\\n \"America/New_York\" or \"Europe/London\". Do NOT put the place\\n name itself like \"rome\", or \"new york\", you must provide\\n the IANA format.\\n:type timezone: str\\n:return: The current time in the specified timezone.', 'parameters': {'type': 'object', 'properties': {'timezone': {'type': 'string', 'description': 'The timezone to find the current time in, should\\n be a valid timezone from the IANA Time Zone Database like\\n \"America/New_York\" or \"Europe/London\". Do NOT put the place\\n name itself like \"rome\", or \"new york\", you must provide\\n the IANA format.'}}, 'required': ['timezone']}}}]\n", - "##################################################\n", - "##################################################\n", - "completion.choices[0].message.tool_calls\n", - "[ChatCompletionMessageToolCall(id='call_MS5F6OgeHtULS2OYN1dGSd7C', function=Function(arguments='{\"timezone\":\"America/New_York\"}', name='get_time'), type='function')]\n", - "##################################################\n", - "##################################################\n", - "output\n", - "[ChatCompletionMessageToolCall(id='call_MS5F6OgeHtULS2OYN1dGSd7C', function=Function(arguments='{\"timezone\":\"America/New_York\"}', name='get_time'), type='function')]\n", - "##################################################\n", - "##################################################\n", - "function_inputs\n", - "{'timezone': 'America/New_York'}\n", - "##################################################\n" + "\u001b[33m2024-04-28 22:54:07 WARNING semantic_router.utils.logger No LLM provided for dynamic route, will use OpenAI LLM default. Ensure API key is set in OPENAI_API_KEY environment variable.\u001b[0m\n" ] }, { @@ -445,7 +430,7 @@ "RouteChoice(name='get_time', function_call={'timezone': 'America/New_York'}, similarity_score=None)" ] }, - "execution_count": 19, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -457,16 +442,16 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'14:07'" + "'14:54'" ] }, - "execution_count": 20, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -493,7 +478,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -502,7 +487,7 @@ "RouteChoice(name='chitchat', function_call=None, similarity_score=None)" ] }, - "execution_count": 16, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -521,7 +506,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -530,7 +515,7 @@ "RouteChoice(name=None, function_call=None, similarity_score=None)" ] }, - "execution_count": 21, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" }