forked from Archives/langchain
prompt nit (#141)
doing some cleanup, and i think this just simplifies things...
This commit is contained in:
parent
bbb405a492
commit
1835e8a681
@ -94,8 +94,7 @@ class Prompt(BaseModel, BasePrompt):
|
||||
Returns:
|
||||
The final prompt generated.
|
||||
"""
|
||||
example_str = example_separator.join(examples)
|
||||
template = prefix + example_str + suffix
|
||||
template = example_separator.join([prefix, *examples, suffix])
|
||||
return cls(input_variables=input_variables, template=template)
|
||||
|
||||
@classmethod
|
||||
|
@ -51,8 +51,8 @@ Question: {question}
|
||||
Answer:"""
|
||||
input_variables = ["question"]
|
||||
example_separator = "\n\n"
|
||||
prefix = """Test Prompt:\n\n"""
|
||||
suffix = """\n\nQuestion: {question}\nAnswer:"""
|
||||
prefix = """Test Prompt:"""
|
||||
suffix = """Question: {question}\nAnswer:"""
|
||||
examples = [
|
||||
"""Question: who are you?\nAnswer: foo""",
|
||||
"""Question: what are you?\nAnswer: bar""",
|
||||
|
Loading…
Reference in New Issue
Block a user