-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Langsmith Hub Javascript Inline doesn't work #4915
Comments
It looks like there's a misunderstanding in how the import { ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate } from "@langchain/core/prompts";
const prompt = ChatPromptTemplate.fromMessages([
SystemMessagePromptTemplate.fromTemplate("You are a helpful assistant"),
PlaceholderPromptTemplate.fromTemplate("{chat_history}"),
HumanMessagePromptTemplate.fromTemplate("{input}"),
PlaceholderPromptTemplate.fromTemplate("{agent_scratchpad}"),
]); This approach uses Regarding the "Missing value for input variable const formattedPrompt = prompt.format({
chat_history: "Previous chat history",
input: "User's input",
agent_scratchpad: "Agent's scratchpad",
}); This method replaces placeholders with their corresponding values, ensuring the prompt is correctly formatted. For further examples and detailed guidance, consider checking the examples/src/prompts/prompts.ts file in the LangChain JS repository. If there are any more questions or if something isn't clear, feel free to ask. Sources
|
|
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
https://smith.langchain.com/hub/hwchase17/openai-functions-agent
The code in "Javascript Inline" here is broken.
This is the code provided on the template page:
It gives an error: "Expected 1-2 arguments, but got 4".
Based on the langchain docs, it should look like this:
But with this modification, it gives a different error: "Missing value for input variable
{chat_history}
"System Info
info.txt
The text was updated successfully, but these errors were encountered: