-
Notifications
You must be signed in to change notification settings - Fork 20.3k
Closed
Labels
bugRelated to a bug, vulnerability, unexpected error with an existing featureRelated to a bug, vulnerability, unexpected error with an existing feature
Description
Checked other resources
- I added a very descriptive title to this issue.
- I searched the LangChain documentation with the integrated search.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangChain rather than my code.
Example Code
async def partial_test(self):
prompt_template = "Tell me details about {name}. The output should be in {lang}"
llm = LLMSelector(self.model).get_language_model()
prompt = ChatPromptTemplate.from_messages([
HumanMessagePromptTemplate.from_template(prompt_template, partial_variables={"lang": "Spanish"}),
])
chain = prompt | llm | StrOutputParser()
result = await chain.ainvoke({'name': 'Open AI'})
print(result)
Error Message and Stack Trace (if applicable)
Errror: Input to ChatPromptTemplate is missing variables {'lang'}. Expected: ['lang', 'name'] Received: ['name']\"
Description
But this works with PromptTemplate also work with ChatPromptTemplate in previous version
System Info
langchain v0.1.7
dosubot, thejollyrogers, DmitriyLeybel, own3dh4rd and Zerotask
Metadata
Metadata
Assignees
Labels
bugRelated to a bug, vulnerability, unexpected error with an existing featureRelated to a bug, vulnerability, unexpected error with an existing feature