mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-05 09:25:14 +03:00
prompt nit (#141)
doing some cleanup, and i think this just simplifies things...
This commit is contained in:
1 parent
bbb405a492
commit
1835e8a681
2 files changed
+3
-4
No files matched your search
@@ -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""",
|
||||
|
||||
Reference in new issue
Block a user