Explorer
project
index.css
index.html
index.js
logo.png
Dependencies
/* Multiple Chains */
import { PromptTemplate } from "langchain/prompts";
import { RunnableSequence } from "langchain/schema/runnable";
import { StringOutputParser } from "langchain/schema/output_parser";
import { ChatOpenAI } from "langchain/chat_models/openai";
const prompt1 = PromptTemplate.fromTemplate(
`What is the city {person} is from? Only respond with the name of the city.`
);
const model = new ChatOpenAI({});
const chain = prompt1.pipe(model).pipe(new StringOutputParser());