0.2.7 • Published 5 months ago

@beparallel/langchain-ts v0.2.7

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

@beparallel/langchain-ts

A TypeScript tool for extracting Langchain prompts and generating corresponding TypeScript types.

Features

  • Extracts prompts from Langchain Hub
  • Generates TypeScript interfaces for prompt inputs and outputs
  • Automatically handles JSON schema conversion
  • Command-line interface for easy integration

Installation

  1. Install the package
pnpm i @beparallel/langchain-ts
  1. Set the environment variables in your .env file
LANGCHAIN_API_KEY=your_api_key
LANGCHAIN_TAG=your_tag
  1. Set up the script in your package.json file
"scripts": {
  ...
  "prompt:generate": "dotenv -f .env.* run -- npx langchain-types --file=X"
}

Where X = the path to the file where you want to save the types.

  1. Run the script
pnpm prompt:generate

Contributing

Installation

pnpm i

Usage

  1. Add the environment variables in your .env file
LANGCHAIN_API_KEY=your_api_key
LANGCHAIN_TAG=your_tag
  1. Export them
export LANGCHAIN_API_KEY=your_api_key
export LANGCHAIN_TAG=your_tag
  1. Run the script
pnpm prompt:generate

Release

  1. Update the version in the package.json file.
  2. Run the following command to update the types.
pnpm prepublish
  1. Run npm publish command
npm publish --access public
  1. Commit and push the changes.
  2. Create a new release on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

0.2.7

5 months ago

0.2.6

6 months ago

0.2.5

6 months ago

0.2.4

6 months ago

0.2.3

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago