File tree Expand file tree Collapse file tree 2 files changed +0
-14
lines changed
Expand file tree Collapse file tree 2 files changed +0
-14
lines changed Original file line number Diff line number Diff line change 11"""Instructions to the LLM, to be passed in the prompt."""
22from string import Template
3- from warnings import warn
43
54from guardrails .utils .parsing_utils import get_template_variables
65
@@ -30,12 +29,6 @@ def format(self, **kwargs):
3029 # Only use the keyword arguments that are present in the prompt.
3130 vars = get_template_variables (self .source )
3231 filtered_kwargs = {k : v for k , v in kwargs .items () if k in vars }
33- if len (filtered_kwargs ) == 0 :
34- warn (
35- "Instructions do not have any variables, "
36- "if you are migrating follow the new variable convention "
37- "documented here: https://docs.guardrailsai.com/0-2-migration/"
38- )
3932
4033 # Return another instance of the class with the formatted prompt.
4134 formatted_instructions = Template (self .source ).safe_substitute (
Original file line number Diff line number Diff line change 11"""The LLM prompt."""
2- import warnings
32from string import Template
43
54from guardrails .utils .parsing_utils import get_template_variables
@@ -21,12 +20,6 @@ def format(self, **kwargs):
2120 # Only use the keyword arguments that are present in the prompt.
2221 vars = get_template_variables (self .source )
2322 filtered_kwargs = {k : v for k , v in kwargs .items () if k in vars }
24- if len (filtered_kwargs ) == 0 :
25- warnings .warn (
26- "Prompt does not have any variables, "
27- "if you are migrating follow the new variable convention "
28- "documented here: https://docs.guardrailsai.com/0-2-migration/"
29- )
3023
3124 # Return another instance of the class with the formatted prompt.
3225 formatted_prompt = Template (self .source ).safe_substitute (** filtered_kwargs )
You can’t perform that action at this time.
0 commit comments