diff --git a/semantic_router/utils/function_call.py b/semantic_router/utils/function_call.py index 80a65d040ef677566659593226f6702ba7bcb398..2db5a8d0aea3a9ea6d33dcd8e982c13dfbfdeb75 100644 --- a/semantic_router/utils/function_call.py +++ b/semantic_router/utils/function_call.py @@ -47,34 +47,34 @@ def extract_function_inputs( logger.info("Extracting function input...") prompt = f""" - You are a helpful assistant designed to output JSON. - Given the following function schema - << {function_schema} >> - and query - << {query} >> - extract the parameters values from the query, in a valid JSON format. - Example: - Input: - query: "How is the weather in Hawaii right now in International units?" - schema: - {{ - "name": "get_weather", - "description": "Useful to get the weather in a specific location", - "signature": "(location: str, degree: str) -> float", - "output": "<class 'float'>", - }} - - - Result: {{ - "location": "Hawaii", - "degree": "Kelvin", - }} - - Input: - query: {query} - schema: {function_schema} - Result: - """ +You are a helpful assistant designed to output JSON. +Given the following function schema +<< {function_schema} >> +and query +<< {query} >> +extract the parameters values from the query, in a valid JSON format. +Example: +Input: +query: "How is the weather in Hawaii right now in International units?" +schema: +{{ + "name": "get_weather", + "description": "Useful to get the weather in a specific location", + "signature": "(location: str, degree: str) -> float", + "output": "<class 'float'>", +}} + + +Result: {{ + "location": "Hawaii", + "degree": "Kelvin", +}} + +Input: +query: {query} +schema: {function_schema} +Result: +""" llm_input = [Message(role="user", content=prompt)] output = llm(llm_input) if not output: