tasks-prompts-chain 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ from .tasks_prompts_chain import TasksPromptsChain, PromptTemplate, OutputFormat
2
+
3
+ __all__ = ['TasksPromptsChain', 'PromptTemplate', 'OutputFormat']
@@ -0,0 +1,268 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Filename: tasks_prompts_chain.py
5
+ Author: Samir Ben Sghaier
6
+ Date: 2025-02-08
7
+ Version: 1.0
8
+ Description:
9
+ A Python library for creating and executing chains of prompts using
10
+ OpenAI's SDK with streaming support and template formatting.
11
+ Contact: ben.sghaier.samir@gmail.com
12
+ GitHub: https://github.com/smirfolio
13
+ Dependencies: openai, typing-extensions
14
+
15
+ License: APACHE 2.0 License
16
+ Copyright 2025 Samir Ben Sghaier - Smirfolio
17
+
18
+ Licensed under the Apache License, Version 2.0 (the "License");
19
+ you may not use this file except in compliance with the License.
20
+ You may obtain a copy of the License at
21
+
22
+ http://www.apache.org/licenses/LICENSE-2.0
23
+
24
+ Unless required by applicable law or agreed to in writing, software
25
+ distributed under the License is distributed on an "AS IS" BASIS,
26
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
+ See the License for the specific language governing permissions and
28
+ limitations under the License.
29
+
30
+ """
31
+ from typing import List, Optional, Dict, Union, AsyncGenerator, TypedDict
32
+ from openai import AsyncOpenAI
33
+ from enum import Enum
34
+
35
+ class OutputFormat(Enum):
36
+ JSON = "JSON"
37
+ MARKDOWN = "MARKDOWN"
38
+ CSV = "CSV"
39
+ TEXT = "TEXT"
40
+
41
+ class ModelOptions(TypedDict, total=False):
42
+ model: str
43
+ api_key: str
44
+ base_url: Optional[str]
45
+ temperature: Optional[float]
46
+ max_tokens: Optional[int]
47
+ stream: Optional[bool]
48
+
49
+ class PromptTemplate:
50
+ def __init__(self, prompt: str, output_format: str = "TEXT", output_placeholder: Optional[str] = None):
51
+ self.prompt = prompt
52
+ self.output_format = OutputFormat(output_format.upper())
53
+ self.output_placeholder = output_placeholder
54
+
55
+ class TasksPromptsChain:
56
+ """A utility class for creating and executing prompt chains using OpenAI's API."""
57
+
58
+ def __init__(self,
59
+ model_options: ModelOptions,
60
+ system_prompt: Optional[str] = None,
61
+ final_result_placeholder: Optional[str] = None,
62
+ system_apply_to_all_prompts: bool = False):
63
+ """
64
+ Initialize the TasksPromptsChain with OpenAI configuration.
65
+
66
+ Args:
67
+ model_options (ModelOptions): Dictionary containing model configuration:
68
+ - model (str): The model identifier to use (e.g., 'gpt-3.5-turbo')
69
+ - api_key (str): The OpenAI API key
70
+ - base_url (str, optional): API endpoint URL
71
+ - temperature (float, optional): Temperature parameter (default: 0.7)
72
+ - max_tokens (int, optional): Maximum tokens (default: 4120)
73
+ - stream (bool, optional): Whether to stream responses (default: True)
74
+ system_prompt (str, optional): System prompt to set context for the LLM
75
+ final_result_placeholder (str, optional): The placeholder name for the final result
76
+ system_apply_to_all_prompts (bool): Whether to apply system prompt to all prompts
77
+ """
78
+ self.model = model_options["model"]
79
+ self.temperature = model_options.get("temperature", 0.7)
80
+ self.max_tokens = model_options.get("max_tokens", 4120)
81
+ self.stream = model_options.get("stream", True)
82
+
83
+ client_kwargs = {"api_key": model_options["api_key"]}
84
+ if "base_url" in model_options:
85
+ client_kwargs["base_url"] = model_options["base_url"]
86
+ self.client = AsyncOpenAI(**client_kwargs)
87
+ self.system_prompt = system_prompt
88
+ self.system_apply_to_all_prompts = system_apply_to_all_prompts
89
+ self.final_result_placeholder = final_result_placeholder or "final_result"
90
+ self._results = {}
91
+ self._output_template = None
92
+ self._current_stream_buffer = ""
93
+
94
+ def set_output_template(self, template: str) -> None:
95
+ """
96
+ Set the output template to be used for streaming responses.
97
+ Must be called before execute_chain if template formatting is desired.
98
+
99
+ Args:
100
+ template (str): Template string containing placeholders in {{placeholder}} format
101
+ """
102
+ self._output_template = template
103
+
104
+ def _format_current_stream(self) -> str:
105
+ """
106
+ Format the current stream buffer using the template.
107
+
108
+ Returns:
109
+ str: Formatted output using the template
110
+ """
111
+ if not self._output_template:
112
+ return self._current_stream_buffer
113
+
114
+ output = self._output_template
115
+ # Replace all existing results
116
+ for placeholder, value in self._results.items():
117
+ output = output.replace(f"{{{{{placeholder}}}}}", value or "")
118
+ # Replace current streaming placeholder
119
+ output = output.replace(f"{{{{{self.final_result_placeholder}}}}}", self._current_stream_buffer)
120
+ return output
121
+
122
+ async def execute_chain(self, prompts: List[Union[Dict, PromptTemplate]], temperature: float = 0.7) -> AsyncGenerator[str, None]:
123
+ """
124
+ Execute a chain of prompts sequentially, with placeholder replacement.
125
+
126
+ Args:
127
+ prompts (List[Union[Dict, PromptTemplate]]): List of prompt templates or dicts with structure:
128
+ {
129
+ "prompt": str,
130
+ "output_format": str,
131
+ "output_placeholder": str
132
+ }
133
+ temperature (float): Temperature parameter for response generation (0.0 to 1.0)
134
+
135
+ Returns:
136
+ List[str]: List of responses for each prompt
137
+ """
138
+ responses = []
139
+ placeholder_values = {}
140
+
141
+ try:
142
+ for i, prompt_data in enumerate(prompts):
143
+ # Convert dict to PromptTemplate if necessary
144
+ if isinstance(prompt_data, dict):
145
+ prompt_template = PromptTemplate(
146
+ prompt=prompt_data["prompt"],
147
+ output_format=prompt_data.get("output_format", "TEXT"),
148
+ output_placeholder=prompt_data.get("output_placeholder")
149
+ )
150
+ else:
151
+ prompt_template = prompt_data
152
+
153
+ # Replace placeholders in the prompt
154
+ current_prompt = prompt_template.prompt
155
+ for placeholder, value in placeholder_values.items():
156
+ current_prompt = current_prompt.replace(f"{{{{{placeholder}}}}}", value)
157
+
158
+ # Format system message based on output format
159
+ format_instruction = ""
160
+ if prompt_template.output_format != OutputFormat.TEXT:
161
+ format_instruction = f"\nPlease provide your response in {prompt_template.output_format.value} format."
162
+
163
+ messages = []
164
+ if self.system_prompt and (i == 0 or self.system_apply_to_all_prompts):
165
+ messages.append({"role": "system", "content": self.system_prompt})
166
+ messages.append({"role": "user", "content": current_prompt + format_instruction})
167
+
168
+ stream = await self.client.chat.completions.create(
169
+ model=self.model,
170
+ messages=messages,
171
+ temperature=self.temperature,
172
+ max_tokens=self.max_tokens,
173
+ stream=self.stream
174
+ )
175
+
176
+ response_content = ""
177
+ self._current_stream_buffer = ""
178
+
179
+ async for chunk in stream:
180
+ if chunk.choices[0].delta.content is not None:
181
+ delta = chunk.choices[0].delta.content
182
+ response_content += delta
183
+ self._current_stream_buffer = response_content
184
+ yield self._format_current_stream()
185
+
186
+ responses.append(response_content)
187
+
188
+ # Store response with placeholder if specified
189
+ if prompt_template.output_placeholder:
190
+ placeholder_values[prompt_template.output_placeholder] = response_content
191
+ self._results[prompt_template.output_placeholder] = response_content
192
+
193
+ except Exception as e:
194
+ raise Exception(f"Error in prompt chain execution at prompt {i}: {str(e)}")
195
+
196
+ # Store the last response with the final result placeholder
197
+ if responses:
198
+ self._results[self.final_result_placeholder] = responses[-1]
199
+
200
+ def get_result(self, placeholder: str) -> Optional[str]:
201
+ """
202
+ Get the result of a specific prompt by its placeholder.
203
+
204
+ Args:
205
+ placeholder (str): The output_placeholder value used in the prompt
206
+
207
+ Returns:
208
+ Optional[str]: The response for that placeholder if it exists, None otherwise
209
+ """
210
+ return self._results.get(placeholder)
211
+
212
+ def template_output(self, template: str) -> None:
213
+ """
214
+ Set the output template for streaming responses.
215
+ Must be called before execute_chain.
216
+
217
+ Args:
218
+ template (str): Template string containing placeholders in {{placeholder}} format
219
+
220
+ Raises:
221
+ Exception: If called after execute_chain has already been run
222
+ """
223
+ if len(self._results) > 0:
224
+ raise Exception("template_output must be called before execute_chain")
225
+ self.set_output_template(template)
226
+
227
+ def execute_chain_with_system(self, prompts: List[str], system_prompt: str, temperature: float = 0.7) -> List[str]:
228
+ """
229
+ Execute a chain of prompts with a system prompt included.
230
+
231
+ Args:
232
+ prompts (List[str]): List of prompts to process in sequence
233
+ system_prompt (str): System prompt to set context for all interactions
234
+ temperature (float): Temperature parameter for response generation (0.0 to 1.0)
235
+
236
+ Returns:
237
+ List[str]: List of responses for each prompt
238
+ """
239
+ responses = []
240
+ context = ""
241
+
242
+ try:
243
+ for i, prompt in enumerate(prompts):
244
+ # Combine previous context with current prompt if not the first prompt
245
+ full_prompt = f"{context}\n{prompt}" if context else prompt
246
+
247
+ response = self.client.chat.completions.create(
248
+ model=self.model,
249
+ messages=[
250
+ {"role": "system", "content": system_prompt},
251
+ {"role": "user", "content": full_prompt}
252
+ ],
253
+ temperature=temperature,
254
+ max_tokens=4120,
255
+ stream=True
256
+ )
257
+
258
+ # Extract the response content
259
+ response_content = response.choices[0].message.content
260
+ responses.append(response_content)
261
+
262
+ # Update context for next iteration
263
+ context = response_content
264
+
265
+ except Exception as e:
266
+ raise Exception(f"Error in prompt chain execution at prompt {i}: {str(e)}")
267
+
268
+ return responses
@@ -0,0 +1,176 @@
1
+ Metadata-Version: 2.4
2
+ Name: tasks_prompts_chain
3
+ Version: 0.0.1
4
+ Summary: A Python library for creating and executing chains of prompts using OpenAI's SDK with streaming support and template formatting.
5
+ Project-URL: Homepage, https://github.com/smirfolio/tasks_prompts_chain
6
+ Project-URL: Issues, https://github.com/smirfolio/tasks_prompts_chain/issues
7
+ Author-email: Samir Ben Sghaier <ben.sghaier.samir@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+
15
+ # PromptChain
16
+
17
+ A Mini Python library for creating and executing chains of prompts using OpenAI's API with streaming support and output template formatting.
18
+
19
+ ## Features
20
+
21
+ - Sequential prompt chain execution
22
+ - Streaming responses
23
+ - Template-based output formatting
24
+ - System prompt support
25
+ - Placeholder replacement between prompts
26
+ - Multiple output formats (JSON, Markdown, CSV, Text)
27
+ - Async/await support
28
+
29
+ ## Installation
30
+
31
+ ### For Users
32
+ ```bash
33
+ pip install -r requirements/requirements.txt
34
+ ```
35
+
36
+ ### For Developers
37
+ ```bash
38
+ pip install -r requirements/requirements.txt
39
+ pip install -r requirements/requirements-dev.txt
40
+ ```
41
+
42
+ ## Quick Start
43
+
44
+ ```python
45
+ from tasks_prompts_chain import TasksPromptsChain
46
+
47
+ async def main():
48
+ # Initialize the chain
49
+ chain = TasksPromptsChain(
50
+ model="gpt-3.5-turbo",
51
+ api_key="your-api-key",
52
+ final_result_placeholder="design_result"
53
+ )
54
+
55
+ # Define your prompts
56
+ prompts = [
57
+ {
58
+ "prompt": "Create a design concept for a luxury chocolate bar",
59
+ "output_format": "TEXT",
60
+ "output_placeholder": "design_concept"
61
+ },
62
+ {
63
+ "prompt": "Based on this concept: {{design_concept}}, suggest a color palette",
64
+ "output_format": "JSON",
65
+ "output_placeholder": "color_palette"
66
+ }
67
+ ]
68
+
69
+ # Stream the responses
70
+ async for chunk in chain.execute_chain(prompts):
71
+ print(chunk, end="", flush=True)
72
+
73
+ # Get specific results
74
+ design = chain.get_result("design_concept")
75
+ colors = chain.get_result("color_palette")
76
+ ```
77
+
78
+ ## Advanced Usage
79
+
80
+ ### Using Templates
81
+
82
+ ```python
83
+ # Set output template before execution
84
+ chain.template_output("""
85
+ <result>
86
+ <design>
87
+ ### Design Concept:
88
+ {{design_concept}}
89
+ </design>
90
+
91
+ <colors>
92
+ ### Color Palette:
93
+ {{color_palette}}
94
+ </colors>
95
+ </result>
96
+ """)
97
+ ```
98
+
99
+ ### Using System Prompts
100
+
101
+ ```python
102
+ chain = TasksPromptsChain(
103
+ model="gpt-3.5-turbo",
104
+ api_key="your-api-key",
105
+ final_result_placeholder="result",
106
+ system_prompt="You are a professional design expert specialized in luxury products",
107
+ system_apply_to_all_prompts=True
108
+ )
109
+ ```
110
+
111
+ ### Custom API Endpoint
112
+
113
+ ```python
114
+ chain = TasksPromptsChain(
115
+ model="gpt-3.5-turbo",
116
+ api_key="your-api-key",
117
+ final_result_placeholder="result",
118
+ base_url="https://your-custom-endpoint.com/v1"
119
+ )
120
+ ```
121
+
122
+ ## API Reference
123
+
124
+ ### TasksPromptsChain Class
125
+
126
+ #### Constructor Parameters
127
+
128
+ - `model` (str): The model identifier (e.g., 'gpt-3.5-turbo')
129
+ - `api_key` (str): Your OpenAI API key
130
+ - `final_result_placeholder` (str): Name for the final result placeholder
131
+ - `system_prompt` (Optional[str]): System prompt for context
132
+ - `system_apply_to_all_prompts` (Optional[bool]): Apply system prompt to all prompts
133
+ - `base_url` (Optional[str]): Custom API endpoint URL
134
+
135
+ #### Methods
136
+
137
+ - `execute_chain(prompts: List[Dict], temperature: float = 0.7) -> AsyncGenerator[str, None]`
138
+ - Executes the prompt chain and streams responses
139
+
140
+ - `template_output(template: str) -> None`
141
+ - Sets the output template format
142
+
143
+ - `get_result(placeholder: str) -> Optional[str]`
144
+ - Retrieves a specific result by placeholder
145
+
146
+ ### Prompt Format
147
+
148
+ Each prompt in the chain can be defined as a dictionary:
149
+ ```python
150
+ {
151
+ "prompt": str, # The actual prompt text
152
+ "output_format": str, # "JSON", "MARKDOWN", "CSV", or "TEXT"
153
+ "output_placeholder": str # Identifier for accessing this result
154
+ }
155
+ ```
156
+
157
+ ## Error Handling
158
+
159
+ The library includes comprehensive error handling:
160
+ - Template validation
161
+ - API error handling
162
+ - Placeholder validation
163
+
164
+ Errors are raised with descriptive messages indicating the specific issue and prompt number where the error occurred.
165
+
166
+ ## Best Practices
167
+
168
+ 1. Always set templates before executing the chain
169
+ 2. Use meaningful placeholder names
170
+ 3. Handle streaming responses appropriately
171
+ 4. Consider temperature settings based on your use case
172
+ 5. Use system prompts for consistent context
173
+
174
+ ## License
175
+
176
+ MIT License
@@ -0,0 +1,6 @@
1
+ tasks_prompts_chain/__init__.py,sha256=HVhC_vMTYCyZW6vnoErHh-TkAnNRqJ2JJqClJQSfU8Y,148
2
+ tasks_prompts_chain/tasks_prompts_chain.py,sha256=epD997ELkacml3pJibbgKEo-IhlKwLx8J5uJtuJ6uWw,11416
3
+ tasks_prompts_chain-0.0.1.dist-info/METADATA,sha256=Sds4Upqje_iKrhGWmuubtGftdOhrs1Uy0RgvNpQjffk,4613
4
+ tasks_prompts_chain-0.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
+ tasks_prompts_chain-0.0.1.dist-info/licenses/LICENSE,sha256=WYmcYJG1QFgu1hfo7qrEkZ3Jhcz8NUWe6XUraZvlIFs,10172
6
+ tasks_prompts_chain-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,176 @@
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