{"id":8212,"date":"2024-07-19T14:37:00","date_gmt":"2024-07-19T09:07:00","guid":{"rendered":"https:\/\/innovationm.co\/?p=8212"},"modified":"2024-07-19T14:37:00","modified_gmt":"2024-07-19T09:07:00","slug":"openai-function-calling","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/","title":{"rendered":"OpenAI Function Calling"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">As AI technology rapidly advances, the integration of language models like OpenAI&#8217;s GPT-4 into various applications has become increasingly prevalent. One of the most\u00a0 powerful features of these models is their ability to call functions directly, enabling\u00a0\u00a0<\/span><span style=\"font-weight: 400;\">developers to create more dynamic and responsive applications. However, to harness\u00a0 this capability effectively, adhering to best coding practices is essential. This blog\u00a0 explores some key best practices for OpenAI function calling, ensuring robust and\u00a0 efficient application development.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Understand the Use Case:\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Before diving into code, it&#8217;s crucial to clearly define the problem you&#8217;re trying to solve and how function calling fits into your solution.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><strong>Ask yourself:\u00a0<\/strong><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-weight: 400;\"> What specific tasks will the AI handle?\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\"> How will the AI&#8217;s function calls improve the application&#8217;s performance or user\u00a0 experience?\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\"> What are the limitations and boundaries of the function calls?\u00a0<\/span><\/li>\n<\/ol>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A clear understanding of your use case helps in designing a more focused and efficient\u00a0 solution.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>High-level workflow of the function calling feature in the Completions API is as\u00a0 follows:\u00a0<\/b><\/p>\n<ul>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A user makes a request.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The message processor (application code) converts this request into a message\u00a0 prompt. It also appends a list of supportable functions (such as \u2018web search\u2019 or\u00a0 \u2018execute os command\u2019) to the prompt.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This message prompt is then sent to the Completions API. If the AI model\u00a0 determines that it needs additional information to fulfill the request, it checks the\u00a0 list of supportable functions provided. If it finds a relevant function, it returns a\u00a0 request to execute that function along with the necessary parameters.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Upon receiving this function request, the message processor uses appropriate\u00a0 handlers to execute the function.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The results of the function execution and the original request are then sent back to\u00a0 the Completions API.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The Completions API then uses this information to formulate a response to the\u00a0 original user\u2019s request. <\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Finally, this response is sent back to the user.<br \/>\n<\/span><\/li>\n<\/ul>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-8214\" src=\"https:\/\/innovationm.co\/wp-content\/uploads\/2024\/07\/Function-Call-300x155.webp\" alt=\"\" width=\"515\" height=\"266\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Function-Call-300x155.webp 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Function-Call-1024x530.webp 1024w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Function-Call-768x397.webp 768w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Function-Call-624x323.webp 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Function-Call.webp 1400w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><\/p>\n<p><b>Defining Functions:\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">funcDef = {<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"name\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"file_save\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"description\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"save code or text into a file\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"parameters\"<\/span><span style=\"font-weight: 400;\">: {<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"type\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"object\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"properties\"<\/span><span style=\"font-weight: 400;\">: {<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"directory_path\"<\/span><span style=\"font-weight: 400;\">: {<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"type\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"description\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"the location of the file to be saved\"<\/span><span style=\"font-weight: 400;\">,<\/span> <span style=\"font-weight: 400;\">\u00a0},<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"file_name\"<\/span><span style=\"font-weight: 400;\">: {<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"type\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"description\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"the name of the file to be saved\"<\/span><span style=\"font-weight: 400;\">,<\/span> <span style=\"font-weight: 400;\">\u00a0},<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"file_content\"<\/span><span style=\"font-weight: 400;\">: {<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"type\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"string\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"description\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"the content of the file to be saved\"<\/span><span style=\"font-weight: 400;\">,<\/span> <span style=\"font-weight: 400;\">\u00a0},<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">},<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"required\"<\/span><span style=\"font-weight: 400;\">: [<\/span><span style=\"font-weight: 400;\">\"directory_path\"<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">\"file_name\"<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">\"file_content\"<\/span><span style=\"font-weight: 400;\">],<\/span> <span style=\"font-weight: 400;\">\u00a0},<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">}<\/span><\/pre>\n<ul>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The definition describes the function, the model uses this when matching functions\u00a0 with some need for information it has.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The definition lists and describes the parameters needed to execute the function.\u00a0<\/span><\/li>\n<li style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A set of function definitions can then be passed to the API when making a request,\u00a0 enabling the model to store text and code to the local file system.<\/span><\/li>\n<\/ul>\n<p><b>Calling the Completions API:\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">def <\/span><span style=\"font-weight: 400;\">get_completionWithFunctions(<\/span><span style=\"font-weight: 400;\">messages ,functions:<\/span><span style=\"font-weight: 400;\">str<\/span><span style=\"font-weight: 400;\">, temperature:<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0 <\/span><span style=\"font-weight: 400;\">model:<\/span><span style=\"font-weight: 400;\">str<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">\"gpt-3.5-turbo-0613\"<\/span><span style=\"font-weight: 400;\">, max_retries:<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\">, retry_wait:<\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">):<\/span> <span style=\"font-weight: 400;\">\u00a0logging.info(<\/span><span style=\"font-weight: 400;\">f'get_completionWithFunctions start: model <\/span><span style=\"font-weight: 400;\">{model}<\/span> <span style=\"font-weight: 400;\">functions <\/span><span style=\"font-weight: 400;\">{functions} <\/span><span style=\"font-weight: 400;\">messages <\/span><span style=\"font-weight: 400;\">{messages}<\/span><span style=\"font-weight: 400;\">'<\/span><span style=\"font-weight: 400;\">)<\/span> \r\n\r\n<span style=\"font-weight: 400;\">\u00a0retries = <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">while <\/span><span style=\"font-weight: 400;\">retries &lt;= max_retries:<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">try<\/span><span style=\"font-weight: 400;\">:<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0response = openai.ChatCompletion.create(<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0model=model,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0messages=messages,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0functions=functions,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0function_call = <\/span><span style=\"font-weight: 400;\">\"auto\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0temperature=temperature,<\/span><span style=\"font-weight: 400;\">\u00a0\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0logging.info(<\/span><span style=\"font-weight: 400;\">f'get_completion end: <\/span><span style=\"font-weight: 400;\">{model}<\/span><span style=\"font-weight: 400;\">'<\/span><span style=\"font-weight: 400;\">)<\/span> <span style=\"font-weight: 400;\">\u00a0response_message = response[<\/span><span style=\"font-weight: 400;\">\"choices\"<\/span><span style=\"font-weight: 400;\">][<\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">][<\/span><span style=\"font-weight: 400;\">\"message\"<\/span><span style=\"font-weight: 400;\">]<\/span> <span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">return <\/span><span style=\"font-weight: 400;\">response_message<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">except <\/span><span style=\"font-weight: 400;\">RateLimitError <\/span><span style=\"font-weight: 400;\">as <\/span><span style=\"font-weight: 400;\">e:<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">if <\/span><span style=\"font-weight: 400;\">retries == max_retries:<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">raise <\/span><span style=\"font-weight: 400;\">e<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0retries += <\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">print<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">f\"RateLimitError encountered, retrying... (attempt <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">{retries}<\/span><span style=\"font-weight: 400;\">)\"<\/span><span style=\"font-weight: 400;\">)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0time.sleep(retry_wait)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/pre>\n<p style=\"text-align: justify;\"><b>Processing a user request:\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">When the model processes a user request requiring additional information, it uses the\u00a0 provided list of functions.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If the user request is \u2018please write python code to compute the first N primes and save\u00a0 the code in primes.py,\u2019 the model can generate the code and, being aware of the\u00a0 \u2018file_save\u2019 function, respond with a request to save the file.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The code that calls the get_completionWithFunctions() method then checks the\u00a0 response for a function call request:\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Besides selecting model versions that support function calling, the main difference is\u00a0 that the set of function definitions is sent to the API via the functions parameter, as\u00a0 shown below: <\/span><\/p>\n<pre><span style=\"font-weight: 400;\">function_calling_definition =\u00a0\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">self.handler.get_function_calling_definition()<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0max_iterations = <\/span><span style=\"font-weight: 400;\">5<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">itr = <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">for <\/span><span style=\"font-weight: 400;\">i <\/span><span style=\"font-weight: 400;\">in <\/span><span style=\"font-weight: 400;\">range<\/span><span style=\"font-weight: 400;\">(max_iterations):<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">#completion_messages = [{\"role\": \"user\", \"content\": message}]<\/span> <span style=\"font-weight: 400;\">\u00a0#default is gpt-3.5-turbo-0613 you can alos use gpt-4-0613<\/span> <span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">response_message = <\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">get_completionWithFunctions(completion_messages, <\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">function_calling_definition, <\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">, model)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">#check if a function call is requested<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">if <\/span><span style=\"font-weight: 400;\">response_message.get(<\/span><span style=\"font-weight: 400;\">\"function_call\"<\/span><span style=\"font-weight: 400;\">):<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0action = []<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0function_name = response_message[<\/span><span style=\"font-weight: 400;\">\"function_call\"<\/span><span style=\"font-weight: 400;\">][<\/span><span style=\"font-weight: 400;\">\"name\"<\/span><span style=\"font-weight: 400;\">]<\/span> <span style=\"font-weight: 400;\">\u00a0function_args_text = <\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">response_message[<\/span><span style=\"font-weight: 400;\">\"function_call\"<\/span><span style=\"font-weight: 400;\">][<\/span><span style=\"font-weight: 400;\">\"arguments\"<\/span><span style=\"font-weight: 400;\">]<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0function_args = json.loads(function_args_text)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">#extract the paramters and nane of the function reqested<\/span> <span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">action_dict = <\/span><span style=\"font-weight: 400;\">dict<\/span><span style=\"font-weight: 400;\">()<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0action_dict[<\/span><span style=\"font-weight: 400;\">\"action_name\"<\/span><span style=\"font-weight: 400;\">] = function_name<\/span> <span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">for <\/span><span style=\"font-weight: 400;\">key, value <\/span><span style=\"font-weight: 400;\">in <\/span><span style=\"font-weight: 400;\">function_args.items():<\/span> <span style=\"font-weight: 400;\">\u00a0action_dict[key] = value<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">#execute the function if available<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">response = self.handler.process_action_dict(action_dict, <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">account_name)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0response_message_text = <\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">QuokkaLoki.handler_repsonse_formated_text(response)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0completion_messages.append(response_message)<\/span> <span style=\"font-weight: 400;\">\u00a0completion_messages.append(<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0{<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"role\"<\/span><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">\"function\"<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">\"name\"<\/span><span style=\"font-weight: 400;\">: function_name,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\"content\"<\/span><span style=\"font-weight: 400;\">: response_message_text,<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0}<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0)<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">else<\/span><span style=\"font-weight: 400;\">:<\/span><span style=\"font-weight: 400;\">\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">break<\/span><\/pre>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Overall, this example highlights two key capabilities made possible by function calling:\u00a0 real-time web search and web text scraping. These functions enable the AI to not only\u00a0 generate responses based on its training data but also fetch and present real-time, up\u00a0<\/span><span style=\"font-weight: 400;\">to-date information from the web, making it a highly dynamic and powerful tool for\u00a0 users.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-8213\" src=\"https:\/\/innovationm.co\/wp-content\/uploads\/2024\/07\/1_DyzVPezowuNs8UaP0fjgmw-300x206.png\" alt=\"\" width=\"483\" height=\"332\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/1_DyzVPezowuNs8UaP0fjgmw-300x206.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/1_DyzVPezowuNs8UaP0fjgmw-624x428.png 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/1_DyzVPezowuNs8UaP0fjgmw.png 700w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><\/p>\n<p style=\"text-align: justify;\"><b>Structure Your Prompts Carefully:\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The prompt is the foundation of any interaction with OpenAI models. Crafting well structured prompts ensures that the model understands your intent and performs the\u00a0 desired function calls correctly.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Be Specific<\/b><span style=\"font-weight: 400;\">: Clearly specify the function to be called and the parameters required. <\/span><b>Provide Context<\/b><span style=\"font-weight: 400;\">: Give the model enough context about the task to minimize ambiguity. <\/span><b>Use Consistent Formatting<\/b><span style=\"font-weight: 400;\">: Consistency in prompt structure helps the model learn and\u00a0 respond more accurately.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Validate Inputs and Outputs:\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To ensure reliability and accuracy, validate the inputs before passing them to the AI\u00a0 model and the outputs returned from the function calls.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Input Validation: <\/b><span style=\"font-weight: 400;\">Check that all required parameters are provided and are of the\u00a0 correct type and format.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Output Validation: <\/b><span style=\"font-weight: 400;\">Verify that the output meets the expected criteria and handle any\u00a0 discrepancies gracefully.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Handle Errors Gracefully:<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Error handling is crucial for maintaining the stability and reliability of your application.\u00a0 Implement robust error handling mechanisms to catch and manage exceptions that may\u00a0 occur during function calls.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Catch Specific Exceptions: Catch and handle specific exceptions to provide more\u00a0 informative error messages.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Retry Mechanism: <\/b><span style=\"font-weight: 400;\">Implement a retry mechanism for transient errors. <\/span><b>Fallback Strategy<\/b><span style=\"font-weight: 400;\">: Have a fallback strategy in place if the AI function call fails.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Optimize API Usage :\u00a0<\/b><\/p>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-weight: 400;\">Efficient use of the OpenAI API ensures better performance and cost management. <\/span><span style=\"font-weight: 400;\">\u2022 <\/span><span style=\"font-weight: 400;\">Batch Requests: Where possible, batch multiple requests into a single API call to\u00a0 reduce latency and API usage.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Rate Limiting: Be mindful of the API rate limits and implement rate limiting in your\u00a0 application to avoid hitting the limits.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Cache Responses: Cache responses for frequently requested data to reduce API calls\u00a0 and improve response times.\u00a0<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><b>Monitor and Log:\u00a0<\/b><\/p>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-weight: 400;\">Monitoring and logging are essential for diagnosing issues and understanding how\u00a0 your application interacts with the OpenAI API.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Log Requests and Responses: Log all API requests and responses for auditing and\u00a0 debugging purposes.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Monitor Performance: Continuously monitor the performance of your application\u00a0 and the API calls to identify and address bottlenecks.\u00a0<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><b>Ensure Security and Privacy:\u00a0<\/b><\/p>\n<ul style=\"text-align: justify;\">\n<li><span style=\"font-weight: 400;\">Handling sensitive data with AI requires strict adherence to security and privacy\u00a0 best practices.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Data Encryption: Encrypt data in transit and at rest to protect it from unauthorized\u00a0 access.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Access Controls: Implement strict access controls to ensure only authorized users\u00a0 and systems can interact with the OpenAI API.\u00a0<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><b>Data Anonymization: <\/b><span style=\"font-weight: 400;\">Where possible, anonymize sensitive data before sending it to\u00a0 the API.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>Conclusion:\u00a0<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Implementing OpenAI function calling can significantly enhance your application&#8217;s\u00a0 capabilities. By following these best practices, you can ensure that your use of OpenAI&#8217;s\u00a0 function calling is efficient, reliable, and secure. Remember to always stay updated with\u00a0 the latest developments and guidelines from OpenAI to continually improve your\u00a0 application&#8217;s integration with their API.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As AI technology rapidly advances, the integration of language models like OpenAI&#8217;s GPT-4 into various applications has become increasingly prevalent. One of the most\u00a0 powerful features of these models is their ability to call functions directly, enabling\u00a0\u00a0developers to create more dynamic and responsive applications. However, to harness\u00a0 this capability effectively, adhering to best coding practices [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8216,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[902,1010,950,1011,1012,1013,1014,1015,1016],"tags":[1017,1018,1019,1020,1021,1022,1023],"class_list":["post-8212","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-ai-integration","category-api","category-api-integration","category-application-development","category-cloud-computing","category-devops","category-security-best-practices","category-tech-tips-and-tutorials","tag-ai-integration","tag-api-integration","tag-application-development","tag-cloud-computing","tag-devops","tag-security-best-practices","tag-tech-tips-and-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>OpenAI Function Calling - InnovationM - Blog<\/title>\n<meta name=\"description\" content=\"Enhance your applications with dynamic AI function calling using OpenAI&#039;s GPT-4. Learn the best practices for robust, efficient, and secure implementation. Stay ahead with InnovationM.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpenAI Function Calling - InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"Enhance your applications with dynamic AI function calling using OpenAI&#039;s GPT-4. Learn the best practices for robust, efficient, and secure implementation. Stay ahead with InnovationM.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-19T09:07:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Blog-Banner_-Innovationm_July-1024x576.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"OpenAI Function Calling\",\"datePublished\":\"2024-07-19T09:07:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/\"},\"wordCount\":1000,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/Blog-Banner_-Innovationm_July.png\",\"keywords\":[\"AI Integration\",\"API Integration\",\"Application Development\",\"Cloud Computing\",\"DevOps\",\"Security Best Practices\",\"Tech Tips and Tutorials\"],\"articleSection\":[\"AI\",\"AI Integration\",\"API\",\"API Integration\",\"Application Development\",\"Cloud Computing\",\"DevOps\",\"Security Best Practices\",\"Tech Tips and Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/\",\"name\":\"OpenAI Function Calling - InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/Blog-Banner_-Innovationm_July.png\",\"datePublished\":\"2024-07-19T09:07:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"description\":\"Enhance your applications with dynamic AI function calling using OpenAI's GPT-4. Learn the best practices for robust, efficient, and secure implementation. Stay ahead with InnovationM.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/Blog-Banner_-Innovationm_July.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/Blog-Banner_-Innovationm_July.png\",\"width\":2240,\"height\":1260,\"caption\":\"OpenAI Function Calling\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/openai-function-calling\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OpenAI Function Calling\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpenAI Function Calling - InnovationM - Blog","description":"Enhance your applications with dynamic AI function calling using OpenAI's GPT-4. Learn the best practices for robust, efficient, and secure implementation. Stay ahead with InnovationM.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/","og_locale":"en_US","og_type":"article","og_title":"OpenAI Function Calling - InnovationM - Blog","og_description":"Enhance your applications with dynamic AI function calling using OpenAI's GPT-4. Learn the best practices for robust, efficient, and secure implementation. Stay ahead with InnovationM.","og_url":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/","og_site_name":"InnovationM - Blog","article_published_time":"2024-07-19T09:07:00+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Blog-Banner_-Innovationm_July-1024x576.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"OpenAI Function Calling","datePublished":"2024-07-19T09:07:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/"},"wordCount":1000,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Blog-Banner_-Innovationm_July.png","keywords":["AI Integration","API Integration","Application Development","Cloud Computing","DevOps","Security Best Practices","Tech Tips and Tutorials"],"articleSection":["AI","AI Integration","API","API Integration","Application Development","Cloud Computing","DevOps","Security Best Practices","Tech Tips and Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/","url":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/","name":"OpenAI Function Calling - InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Blog-Banner_-Innovationm_July.png","datePublished":"2024-07-19T09:07:00+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"description":"Enhance your applications with dynamic AI function calling using OpenAI's GPT-4. Learn the best practices for robust, efficient, and secure implementation. Stay ahead with InnovationM.","breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/openai-function-calling\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Blog-Banner_-Innovationm_July.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2024\/07\/Blog-Banner_-Innovationm_July.png","width":2240,"height":1260,"caption":"OpenAI Function Calling"},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/openai-function-calling\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"OpenAI Function Calling"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/8212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=8212"}],"version-history":[{"count":0,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/8212\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/8216"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=8212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=8212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=8212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}