{"id":1337,"date":"2024-03-10T08:40:44","date_gmt":"2024-03-10T08:40:44","guid":{"rendered":"https:\/\/techlaw.co.il\/en\/?p=1337"},"modified":"2024-03-11T07:24:38","modified_gmt":"2024-03-11T07:24:38","slug":"creating-your-own-document-generating-ai-assistant","status":"publish","type":"post","link":"https:\/\/techlaw.co.il\/en\/creating-your-own-document-generating-ai-assistant\/","title":{"rendered":"Creating Your Own Document Generating AI Assistant"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1337\" class=\"elementor elementor-1337\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-b456d78 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b456d78\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ec793df\" data-id=\"ec793df\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-b11bada elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b11bada\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-c7488ba\" data-id=\"c7488ba\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-53a8fad elementor-widget__width-initial elementor-widget elementor-widget-author-box\" data-id=\"53a8fad\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"author-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-author-box\">\n\t\t\t\t\t\t\t<div  class=\"elementor-author-box__avatar\">\n\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/Screen-Shot-2024-03-10-at-10.29.56-300x285.png\" alt=\"Picture of Shai Shulman, Adv.\" loading=\"lazy\">\n\t\t\t\t<\/div>\n\t\t\t\n\t\t\t<div class=\"elementor-author-box__text\">\n\t\t\t\t\t\t\t\t\t<div >\n\t\t\t\t\t\t<h4 class=\"elementor-author-box__name\">\n\t\t\t\t\t\t\tShai Shulman, Adv.\t\t\t\t\t\t<\/h4>\n\t\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-author-box__bio\">\n\t\t\t\t\t\t<p>Legal Team Lead, Corporate Counsel, LegalTech Developer<\/p>\n\t\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-0be2448\" data-id=\"0be2448\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c0be8e6 elementor-shape-circle e-grid-align-right elementor-widget__width-initial elementor-grid-0 elementor-widget elementor-widget-social-icons\" data-id=\"c0be8e6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"social-icons.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-social-icons-wrapper elementor-grid\">\n\t\t\t\t\t\t\t<span class=\"elementor-grid-item\">\n\t\t\t\t\t<a class=\"elementor-icon elementor-social-icon elementor-social-icon-linkedin elementor-repeater-item-5a85160\" href=\"https:\/\/www.linkedin.com\/in\/shai-shulman\" target=\"_blank\">\n\t\t\t\t\t\t<span class=\"elementor-screen-only\">Linkedin<\/span>\n\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"fab fa-linkedin\"><\/i>\t\t\t\t\t<\/a>\n\t\t\t\t<\/span>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-4ca72c3 elementor-widget__width-initial elementor-widget elementor-widget-text-editor\" data-id=\"4ca72c3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #000000;\">What is AI&#8217;s best practical use for a lawyer? Could it be a chatbot assistant that can draft new documents from her own templates?<\/span><br \/><br \/><span style=\"color: #000000;\">Generative AI has become part of our daily lives ever since ChatGPT made its public debut, way back in the hazy days of November 2022 (though it may now seem like a century ago). We\u2019re using it to plan a romantic trip to Italy, write a song for a loved one\u2019s birthday, or seek answers to those questions we\u2019d rather not ask out loud.<\/span><br \/><br \/><span style=\"color: #000000;\">For us lawyers, however, using an AI chatbot in a professional capacity isn\u2019t that easy. The stakes are higher, both in terms of our professional credibility and financial implications. Ultimately, we find ourselves with no control over the accuracy of the legal data used to train the AI model, or over the style, tone, and wording used in the responses it produces.<\/span><br \/><br \/><span style=\"color: #000000;\">To me, one routine legal task that is just waiting to be automated is drafting new agreements and other legal documents from a template. Every corporate and transactional lawyer has their own collection of templates, honed over years, ready to be customized for each new client and new case. With GenAI\u2019s potential to streamline this process in mind, I\u2019ve set out to find a simple and easy way to use an off-the-shelf AI chatbot for generating new documents from these templates.<\/span><br \/><br \/><span style=\"color: #000000;\">This mission turned out to be a bit harder than it looks, as following a specific template is not something that GenAI models can easily do. I focused on ChatGPT, given its better customization capabilities compared to newer competitors, experimenting with some simple techniques (embedding templates in prompts) and some very complex ones (fine-tuning). None were very practical as a simple solution.<\/span><br \/><br \/><span style=\"color: #000000;\">This is where the advent of custom GPTs comes into play. Introduced in late 2023, OpenAI\u2019s new feature, dubbed \u201cGPTs\u201d, allows users with subscription to the Plus tier to create a customized chatbots for various purposes, from drafting legal documents to providing specialized advice, by including additional specific knowledge, detailed instructions, and even external tools that can enrich the response from external data sources.\u00a0<\/span><\/p><p><span style=\"color: #000000;\">Through some clever prompt engineering and a small plugin, I had developed, I was able to quickly create a simple but powerful personalized AI helper in ChatGPT, that can generate new legal documents from my own template.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-01bcd07 elementor-widget elementor-widget-heading\" data-id=\"01bcd07\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Practical Guide<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5a2bb2b elementor-widget elementor-widget-text-editor\" data-id=\"5a2bb2b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #000000;\">To start creating a your own GPT for generating legal documents, ensure you have a Plus account with ChatGPT and head over to<\/span> <u><a href=\"http:\/\/chat.openai.com\/create\" target=\"_blank\" rel=\"noopener\">chat.openai.com\/create<\/a><\/u>.<\/p><p><span style=\"color: #000000;\"><strong>Knowledge<\/strong><\/span><\/p><p><span style=\"color: #000000;\">The GPT hinges on two critical elements: Knowledge and Instructions. As Knowledge, you&#8217;ll upload files that containing the data used in creating the responses. These can range from snippets to full templates, which can include placeholders for new data to be completed and specific inline instructions for different scenarios. It\u2019s advisable, however, to limit the number of templates uploaded for each GPT to avoid issues with aligning to different templates. In my case, I uploaded a unilateral NDA template, complete with placeholders and specific instructions for different scenarios.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4138210 elementor-widget elementor-widget-image\" data-id=\"4138210\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"974\" height=\"604\" src=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/1.png\" class=\"attachment-large size-large wp-image-1339\" alt=\"Example of instructions for new GPT\" srcset=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/1.png 974w, https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/1-300x186.png 300w, https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/1-768x476.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Example of instructions for new GPT<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4787d9d elementor-widget elementor-widget-text-editor\" data-id=\"4787d9d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #000000;\"><strong>Instructions<\/strong><\/span><\/p><p><span style=\"color: #000000;\">Instructions play a crucial role in shaping the AI\u2019s output. They should guide the model to strictly follow your templates word for word (which is quite different from the usual behavior of GenAI models) and specify when to deviate from the template&#8217;s wording. As ChatGPT can only output unformatted text by default, you can instruct the model to use a specific format that can display bold text, headers and numbered lists. In this case my instructions include a directive to use a specific lightweight format called Markdown when creating the response.<\/span><\/p><p><span style=\"color: #000000;\">You can further refine your instructions to include additional directives, like adding signature blocks or paragraph numbering for each document. Once you saved you GPT, you can now simply prompt it with a specific request like &#8220;Generate a unilateral NDA for company X with the following requirements&#8221;, and the GPT will generate the text for the new document.<\/span><\/p><p><span style=\"color: #000000;\"><strong>Time For Action<\/strong><\/span><\/p><p><span style=\"color: #000000;\">This is all very well, but still not incredibly efficient as we would need toggle back and forth between Word and ChatGPT. If only there was a way for ChatGPT to create actual Word documents for us.<\/span><\/p><p><span style=\"color: #000000;\">While ChatGPT cannot create external files by itself, it does offer a solution through &#8220;actions&#8221; &#8211; external plugins that enhance the AI&#8217;s capabilities. For instance, I developed a small plugin that enables ChatGPT to produce downloadable Word documents directly from its text-based response, and made it available here<\/span> <u><a href=\"https:\/\/roboguide.xyz\/doc-it\" target=\"_blank\" rel=\"noopener\">https:\/\/roboguide.xyz\/doc-it<\/a><\/u> <span style=\"color: #000000;\">(source code<\/span> <u><a href=\"https:\/\/github.com\/ShaiShulman\/doc-it\" target=\"_blank\" rel=\"noopener\">here<\/a><\/u><span style=\"color: #000000;\">). Once you let your GPT know of the plugin&#8217;s existence, it will direct the response to the plugin any time you specifically ask that a Word file be generated, and you will get back a link to download the new file.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8de5896 elementor-widget elementor-widget-image\" data-id=\"8de5896\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"974\" height=\"487\" src=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/2.png\" class=\"attachment-large size-large wp-image-1341\" alt=\"\" srcset=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/2.png 974w, https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/2-300x150.png 300w, https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/2-768x384.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Adding Doc-It as an Action<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6cb795e elementor-widget elementor-widget-text-editor\" data-id=\"6cb795e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #000000;\">Integrating this plugin is easy: select &#8220;<em>Add New Action<\/em>,&#8221; click &#8220;<em>Import<\/em>&#8220;, enter the plugin&#8217;s URL, and change the existing GPT instruction to also direct the GPT to generate a Word file.<\/span><\/p><p><span style=\"color: #000000;\"><strong>Using the GPT<\/strong><\/span><\/p><p><span style=\"color: #000000;\">Once you\u2019ve configured the plugin, you can use it with a prompt the same way you always use ChatGPT. The only difference is that the response will be generated based on your own templates and provided as a Word file.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d8835b7 elementor-widget elementor-widget-image\" data-id=\"d8835b7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"974\" height=\"520\" src=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/3.png\" class=\"attachment-large size-large wp-image-1340\" alt=\"\" srcset=\"https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/3.png 974w, https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/3-300x160.png 300w, https:\/\/techlaw.co.il\/en\/wp-content\/uploads\/2024\/03\/3-768x410.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Voila! Our GPT creates a new NDA for our client SecretCo Limited as a Word file<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7ba795a elementor-widget elementor-widget-text-editor\" data-id=\"7ba795a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #000000;\">From this point onward you could start to experiment and refine your GPT and the instructions to ensure the output meets your needs. Keep in mind that this method is best suited for shorter documents due to the AI&#8217;s limited context window.<\/span><\/p><p><span style=\"color: #000000;\">Naturally, you should always consider information security concerns when sharing sensitive data with external services like ChatGPT.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Linkedin What is AI&#8217;s best practical use for a lawyer? Could it be a chatbot assistant that can draft new documents from her own templates? Generative AI has become part of our daily lives ever since ChatGPT made its public debut, way back in the hazy days of November 2022 (though it may now seem [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1350,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-events-and-conventions"],"_links":{"self":[{"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/posts\/1337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/comments?post=1337"}],"version-history":[{"count":14,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/posts\/1337\/revisions"}],"predecessor-version":[{"id":1357,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/posts\/1337\/revisions\/1357"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/media\/1350"}],"wp:attachment":[{"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/media?parent=1337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/categories?post=1337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techlaw.co.il\/en\/wp-json\/wp\/v2\/tags?post=1337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}