Skip to content

Instantly share code, notes, and snippets.

// Name: LangChain 2 Template
import "@johnlindquist/kit";
import { PromptConfig } from "@johnlindquist/kit";
import { CallbackManager } from "langchain/callbacks";
import { PromptTemplate } from "langchain/prompts";
const { OpenAI } = await import("langchain/llms");
const template = "What is the capital city of {country}?";
/*
# Chat with ChatGPT
## <span class="text-primary">👉 Note: LangChain is still in development. This script will keep updating to use the latest APIs</span>
Use `Kit` -> `Manage npm Packages` -> `Update a Package` -> `langchain` to update to install the latest version.
- Opens the `chat` component
- Type a message and press `enter` to send
- The message is sent to the OpenAI API
// Name: Tools
// Description:_
import "@johnlindquist/kit";
import { readFile } from "fs/promises";
await arg("Select a tool", [
// {
// name: "Sorry, no matches",
// info: "onNoChoices", // or "always"
// },