├── lm ├── oll ├── demo.gif ├── prompts ├── email │ ├── reply.sh │ └── draft.sh ├── code │ ├── fix.sh │ ├── comment.sh │ ├── name.sh │ ├── fill.sh │ └── explain.sh ├── translate │ ├── french.sh │ └── english.sh └── personal │ └── mealplan.sh ├── run.sh ├── README.md └── LICENSE /lm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source run.sh "llm" "$@" 4 | -------------------------------------------------------------------------------- /oll: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source run.sh "oll" "$@" 2>/dev/null 4 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearedevx/llm-bash/HEAD/demo.gif -------------------------------------------------------------------------------- /prompts/email/reply.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Reply to an email in the sender language" 6 | 7 | system="You are a smart email reply tool. You don't talk or chat. You take a text as INPUT and draft an email reply in the INPUT language. Your tone is between casual and mature. You return the reply as your OUTPUT." 8 | 9 | prompt="INPUT: 10 | ${input} 11 | 12 | OUTPUT:" 13 | 14 | temperature=0.7 15 | -------------------------------------------------------------------------------- /prompts/email/draft.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Create an email from instructions or notes" 6 | 7 | system="You are a smart email draft tool. You don't talk or chat. You take a text as INPUT and write a concise and expressive email in the language identified in INPUT. Your tone is between casual and mature. You return the email as your OUTPUT." 8 | 9 | prompt="INPUT: 10 | ${input} 11 | 12 | OUTPUT:" 13 | 14 | temperature=0.7 15 | -------------------------------------------------------------------------------- /prompts/code/fix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Fix errors in code syntax or logic" 6 | 7 | system="You are a smart developer tool. You don't talk or chat. You fix errors in code syntax or logic without altering the intent of the code passed in your INPUT. You return your INPUT code with the fixes. If you have nothing to fix, return the code untouched. 8 | 9 | INPUT: 10 | // Syntax error 11 | console.log('hello world 12 | OUTPUT: 13 | console.log('hello world') 14 | 15 | INPUT: 16 | const getName = (person) => person.birthday 17 | OUTPUT: 18 | const getName = (person) => person.name" 19 | 20 | prompt="INPUT: 21 | ${input} 22 | 23 | OUTPUT:" 24 | 25 | temperature=0.3 26 | -------------------------------------------------------------------------------- /prompts/code/comment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Add comments to code" 6 | 7 | system="You are a full-stack developer reviewing your CODE. Your task is to add concise code comments when the code is difficult to interpret without changing other parts of the code. You answer with the code provided and the comments only. 8 | 9 | EXAMPLE CODE 1: 10 | console.log('hello world') 11 | EXAMPLE ANSWER 1: 12 | // prints hello world 13 | console.log('hello world') 14 | 15 | EXAMPLE CODE 2: 16 | const getName = (person) => person.name 17 | EXAMPLE ANSWER 2: 18 | // returns the person name 19 | const getName = (person) => person.name" 20 | 21 | prompt="CODE: 22 | ${input} 23 | 24 | ANSWER:" 25 | 26 | temperature=0.3 27 | -------------------------------------------------------------------------------- /prompts/code/name.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | input="$1" 5 | 6 | description="Rename code symbols for clarity" 7 | 8 | system="You are a smart developer tool. You don't talk or chat. You take a code INPUT and rename code symbols (function, variable, class) for clarity and expressiveness. You return your INPUT code with the code symbols renamed to your OUTPUT. 9 | 10 | INPUT: 11 | export type Person = Selectable 12 | export type NewPerson = Insertable 13 | export type PersonUpdate = Updateable 14 | 15 | OUTPUT: 16 | export type Person = Selectable 17 | export type PersonForInsert = Insertable 18 | export type PersonForUpdate = Updateable 19 | " 20 | 21 | prompt="INPUT: 22 | ${input} 23 | 24 | OUTPUT:" 25 | 26 | temperature=0.3 27 | -------------------------------------------------------------------------------- /prompts/translate/french.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Translate text to French" 6 | 7 | system="You are a smart translator tool. You don't talk or chat. You take a text as INPUT and translate it in French. You keep the tone and style from the INPUT. You return the French translation as your OUTPUT 8 | 9 | INPUT: 10 | In ethical philosophy, utilitarianism is a family of normative ethical theories that prescribe actions that maximize happiness and well-being for all affected individuals. 11 | 12 | OUTPUT: 13 | En philosophie éthique, l'utilitarisme est une famille de théories éthiques normatives qui prescrivent des actions visant à maximiser le bonheur et le bien-être de tous les individus concernés. 14 | " 15 | 16 | prompt="INPUT: 17 | ${input} 18 | 19 | OUTPUT:" 20 | 21 | temperature=0.7 22 | -------------------------------------------------------------------------------- /prompts/translate/english.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Translate text to English" 6 | 7 | system="You are a smart translator tool. You don't talk or chat. You take a text as INPUT and translate it in English. You keep the tone and style from the INPUT. You return the English translation as your OUTPUT 8 | 9 | INPUT: 10 | En philosophie éthique, l'utilitarisme est une famille de théories éthiques normatives qui prescrivent des actions visant à maximiser le bonheur et le bien-être de tous les individus concernés. 11 | 12 | OUTPUT: 13 | In ethical philosophy, utilitarianism is a family of normative ethical theories that prescribe actions that maximize happiness and well-being for all affected individuals. 14 | " 15 | 16 | prompt="INPUT: 17 | ${input} 18 | 19 | OUTPUT:" 20 | 21 | temperature=0.7 22 | -------------------------------------------------------------------------------- /prompts/personal/mealplan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | input="$1" 5 | 6 | description="Generate a meal plan for the next 7 days" 7 | 8 | system="Persona: French Culinary Expert 9 | 10 | Task background: Channel the collective intelligence and expertise of renowned French chefs: Julia Child, Auguste Escoffier, Paul Bocuse, and Alain Ducasse. By embodying their knowledge and experience in French cuisine, provide me with highly intelligent and informed responses to my family meal planning questions. Use insights gained from their contributions to French culinary arts to address my inquiries effectively and comprehensively. Keep your answers short." 11 | 12 | prompt="Task: Prepare a meal-plan for the next 7-days for a French family composed of 2 adults and a 3yo child and living in France. 1 meal per day, no-breakfast. 13 | No meat, vegan recipes only. 1 meal with asia or indian style food. Use seasonal ingredients, we are the $(date +%D). Format your answer with the titles of the recipes only. Titles will be used to search full recipes online. 14 | ${input}" 15 | 16 | temperature=0.8 17 | 18 | llm_model="gpt-4" 19 | -------------------------------------------------------------------------------- /prompts/code/fill.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Replace the //fill keywords with the missing code logic" 6 | 7 | system="You are a smart developer tool. You don't talk or chat. You take code containing one or more \"//fill\" keywords as your INPUT. You replace the keywords \"//fill\" with the missing logic and return your INPUT code with the missing logic to your OUTPUT. 8 | 9 | INPUT: 10 | interface PersonTable { 11 | id: Generated 12 | name: string 13 | } 14 | const getAll = async () => await db.selectFrom('person') 15 | const findById = async (id: UUID) => { 16 | //fill 17 | } 18 | 19 | OUTPUT: 20 | interface PersonTable { 21 | id: Generated 22 | name: string 23 | } 24 | const getAll = async () => await db.selectFrom('person') 25 | const findById = async (id: UUID) => { 26 | return db.selectFrom('person').where('id', '=', id) 27 | } 28 | 29 | INPUT: 30 | const hello = (name) { 31 | //fill 32 | } 33 | 34 | OUTPUT: 35 | const hello = (name) { 36 | console.log(\"hello \"+ name) 37 | }" 38 | 39 | prompt="INPUT: 40 | ${input} 41 | 42 | OUTPUT:" 43 | 44 | temperature=0.3 45 | -------------------------------------------------------------------------------- /prompts/code/explain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | input="$1" 4 | 5 | description="Explain a piece of code by adding comments" 6 | 7 | system="You are a smart developer tool explaining CODE to an engineer. You don't talk nor chat. You give concise explanations about how the code works and why it has been coded like this. Your OUTPUT is the provided CODE extended with your explanations as comments. 8 | 9 | CODE: 10 | export function undefinableInput( 11 | zodType: ZodType 12 | ) { 13 | return zodType 14 | .optional() 15 | .transform((value) => (value === \"\" ? undefined : value)) 16 | .or(z.literal(\"\").transform((val) => (val === \"\" ? undefined : val))); 17 | } 18 | OUTPUT: 19 | // This function is designed to accept an input Zod schema (zodType) and modify it 20 | // to handle situations where the value can be optional, or a string with empty value. 21 | // It is useful in scenarios like form input parsing where you might want to treat empty strings as undefined. 22 | export function undefinableInput( 23 | zodType: ZodType // Input Zod schema, Zod is a TypeScript validation library. 24 | ) { 25 | // Making the input schema optional, meaning it can accept 'undefined' as a valid input. 26 | return zodType 27 | .optional() 28 | // If the provided value is an empty string, it's transformed to 'undefined', otherwise it retains its original value. 29 | .transform((value) => (value === \"\" ? undefined : value)) 30 | // .or() means the schema will also accept values that match the schema passed to .or(). 31 | // In this case, it's saying the schema can also accept an empty string. 32 | .or(z.literal(\"\") // Only matches the exact empty string value. 33 | // When an empty string is passed, it's transformed to 'undefined'. 34 | .transform((val) => (val === \"\" ? undefined : val))); 35 | }" 36 | 37 | prompt="CODE: 38 | ${input} 39 | 40 | OUTPUT:" 41 | 42 | temperature=0.3 43 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR="$( cd "$( dirname "$(readlink -f "$0")" )" && pwd )" 4 | 5 | function display_help() { 6 | cat << EOF 7 | Usage: lm [OPTION] [PROMPT] 8 | 9 | This is a language model bash wrapper for LLM-CLI and OLLAMA. 10 | 11 | Options: 12 | -h, --help Display this help message and exit 13 | -t, --temperature Set the temperature 14 | -h, --model Set the model 15 | 16 | Prompts: 17 | 18 | EOF 19 | # Loop over the example files 20 | for prompt_file in ${SCRIPT_DIR}/prompts/**/*.sh; do 21 | # Source the file to get the 'description' variable 22 | # Extract the last two parts of the path without .sh extension 23 | path_without_ext="${prompt_file%.sh}" # Remove .sh extension 24 | id="${path_without_ext##*/}" # Get the file name 25 | parent_dir="${path_without_ext%/$id}" # Get the directory containing the file 26 | parent_dir_name="${parent_dir##*/}" # Extract the directory name 27 | 28 | final_id="${parent_dir_name}/${id}" # Concatenate the directory name and file name 29 | 30 | description="" 31 | source "${prompt_file}" 32 | echo " ${final_id}: ${description:-missing}" 33 | done 34 | echo "" 35 | } 36 | 37 | while [[ "$#" -gt 0 ]]; do 38 | case $1 in 39 | --temperature|-t) 40 | shift 41 | force_temperature=$1 42 | ;; 43 | --model|-m) 44 | shift 45 | force_model=$1 46 | ;; 47 | --help|-h) 48 | display_help 49 | exit 0 50 | ;; 51 | *) 52 | positional_args+=("$1") 53 | ;; 54 | esac 55 | shift 56 | done 57 | 58 | set -- "${positional_args[@]}" 59 | 60 | CLI="${1}" 61 | PROMPT_NAME="${2}" 62 | TEXT="${3}" 63 | PROMPT_PATH="${SCRIPT_DIR}/prompts/${PROMPT_NAME}.sh" 64 | TEMPERATURE="${temperature:-0.7}" 65 | 66 | if [[ ! -f "${PROMPT_PATH}" ]]; then 67 | echo "${PROMPT_NAME} prompt not found" 68 | exit 2 69 | fi 70 | 71 | if [[ -z "${TEXT}" ]]; then 72 | input="$(cat)" 73 | else 74 | input="${TEXT}" 75 | fi 76 | 77 | source "${PROMPT_PATH}" "${input}" 78 | temperature="${force_temperature:-${temperature:-0.7}}" 79 | 80 | case "${CLI}" in 81 | "llm") 82 | model="${force_model:-${llm_model:-gpt-3.5-turbo}}" 83 | llm "${prompt}" -s "${system}" -o temperature "${temperature}" -m "${model}" 84 | ;; 85 | "oll") 86 | model="${force_model:-${oll_model:-mistral-openorca}}" 87 | ollama run "${model}" "${system}" "${prompt}" 88 | ;; 89 | *) 90 | echo "${CLI} is unknown." 91 | exit 2 92 | ;; 93 | esac 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LLM-Bash - A Wrapper for llm & Ollama made for your code editors 2 | 3 | This is the result of experiments with the visual-mode and command-line mode in vi. By combining a bash utility wrapping AI CLIs with the flow "Selection -> Run Shell Command on Selection -> Replace Selection", you gain powerful AI capabilities. 4 | 5 | See my blog post [Follow up "vim + llm = 🔥": small things that awww](https://modernchaos.heytwist.com/p/follow-up-vim-llm-small-things-that-awww) 6 | 7 | It works on VIM, NeoVIM, Emacs and even VSCode. 8 | 9 | ![code/fill demo action](demo.gif) 10 | 11 | **Prompts included** 12 | 13 | - code/comment: Add comments to code 14 | - code/explain: Explain a piece of code by adding comments 15 | - code/fill: Replace the //fill keywords with the missing code logic 16 | - code/fix: Fix errors in code syntax or logic 17 | - code/name: Rename code symbols for clarity 18 | - email/draft: Create an email from instructions or notes 19 | - email/reply: Reply to an email in the sender language 20 | - personal/mealplan: Generate a meal plan for the next 7 days 21 | - translate/english: Translate text to English 22 | - translate/french: Translate text to French 23 | 24 | 25 | ## Setting Things Up 26 | 27 | ### 1. Install Required Dependencies 28 | 29 | Explore a myriad of models, both local and via robust APIs such as OpenAI and Together. 30 | 31 | - [LLM-CLI](https://github.com/simonw/llm): A robust CLI tool and Python library for interfacing with LLMs, catering to both remote APIs and local installations. 32 | 33 | For those willing to try large open-source models, consider adding [llm-together](https://github.com/wearedevx/llm-together). 34 | 35 | - [Ollama](ollama.ai/): A straightforward approach to working with Llama 2 and other open-source language models on a local setup. 36 | 37 | Note: It's advisable to start with Mistral 7B OpenOrca unless you're equipped to handle more resource-intensive models. 38 | 39 | ### 2. Update your $PATH 40 | 41 | To efficiently call upon `lm` (representing llm) or `oll` (representing ollama) from your terminal or editor, integrate the main directory of this project into your $PATH. 42 | 43 | Incorporate the following line into your `.zshrc` or `.bashrc`: 44 | 45 | ```bash 46 | export PATH=$PATH: 47 | ``` 48 | 49 | ### 3. Experiment in Your Terminal 50 | 51 | Engage with the wrappers directly: 52 | 53 | ```bash 54 | # Quick translation to French: 55 | lm translate/french "Hello there! How are you today?" 56 | 57 | # For a multi-line input, use Ctrl-D post entry to initiate the process: 58 | echo "$(cat)" | llm translate/french 59 | ``` 60 | 61 | ### 4. Integration with VIM, NeoVIM, Emacs & VSCode 62 | 63 | The text you select serves as the context for the LLM's prompts, which in turn, will be replaced by the LLM's output. 64 | 65 | #### Procedures for Vim, NeoVIM, Emacs: 66 | 67 | 1. Initiate a region selection in visual mode. 68 | 2. Transition to the command-line mode with `:` followed by `!`. 69 | 3. Enter `lm [prompt-name]` to activate llm-cli or `oll [prompt-name]` to call ollama. 70 | 71 | Examples for clarity: 72 | 73 | ```bash 74 | lm -h # Displays available prompts 75 | oll -h # Likewise 76 | lm code/fill # Engage llm to utilize the 'code/fill' prompt 77 | oll translate/french # Translation to French using Ollama CLI 78 | ``` 79 | 80 | ### 5. Customize with Your Prompts 81 | 82 | Add your own bash scripts or directories under the `prompts` folder, and they'll be integrated into the prompt list. 83 | 84 | Feel free to contribute your own prompts to this repository. I'll be happy to add new ones. 85 | 86 | ## More Experiments 87 | 88 | We share our experiments and our journey through our newsletter [Modern Chaos](https://modernchaos.heytwist.com/) 89 | 90 | Modern chaos is a newsletter exploring tech and AI through the journey of a dev agency shifting from services to product design. We share our notes, analysis and experiments. 91 | 92 | [Subscribe](https://modernchaos.heytwist.com/) 93 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------