This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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}?"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Tools | |
// Description:_ | |
import "@johnlindquist/kit"; | |
import { readFile } from "fs/promises"; | |
await arg("Select a tool", [ | |
// { | |
// name: "Sorry, no matches", | |
// info: "onNoChoices", // or "always" | |
// }, |