PromptTemplate's output should just be a string. It is currently an object:
HumanMessagePromptTemplate (and the AI and System equivalents) should be objects with role and content. They are currently visualized like this:
The RunnableMap's output should get the same visualizations as described above, instead of the LangChain objects:
To reproduce
const llm = new ChatOpenAI({
azureOpenAIApiKey: AZURE_OPENAI_API_KEY,
azureOpenAIApiInstanceName: AZURE_OPENAI_API_INSTANCE_NAME,
azureOpenAIApiDeploymentName: AZURE_OPENAI_API_DEPLOYMENT_NAME,
azureOpenAIApiVersion: AZURE_OPENAI_API_VERSION,
modelName: "gpt-4",
verbose: true,
})
const handler = new CallbackHandler({
secretKey: LANGFUSE_SECRET_KEY,
publicKey: LANGFUSE_PUBLIC_KEY,
baseUrl: LANGFUSE_BASE_URL,
});
const map = RunnableMap.from({
"String": PromptTemplate.fromTemplate("Tell me a joke about {topic}."),
"Human": HumanMessagePromptTemplate.fromTemplate("Tell me a joke about {topic}."),
"AI": AIMessagePromptTemplate.fromTemplate("Tell me a joke about {topic}."),
"System": SystemMessagePromptTemplate.fromTemplate("Tell me a joke about {topic}."),
});
await map.invoke({topic: "bears"}, { callbacks: [handler] });
Describe the bug
PromptTemplate
's output should just be a string. It is currently an object:HumanMessagePromptTemplate
(and theAI
andSystem
equivalents) should be objects withrole
andcontent
. They are currently visualized like this:The
RunnableMap
's output should get the same visualizations as described above, instead of theLangChain
objects:To reproduce
Additional information
I'm using the JavaScript SDK, version 3.1.0