Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@isdk/ai-tool-prompt
Advanced tools
* Management of various prompts * Collection The LLM System template prompts With Enhancement (guessing corresponding system templates based on the model file name) * Multiple versions support under the same system prompt template file * Recommendation of
yaml
, json
. Here yaml format is used as the default file format.npm install @isdk/ai-tool @isdk/ai-tool-prompt
string
(unique) - id of the prompt'hf'|'ollama'|'langchain'
- template format of the prompt, defaults to 'hf'string
- template of the prompt, eg, '{{messages[0].content}}''system'|'tool'|'char'
- type of the promptobject
- default prompt template datastring|RegExpr|(string|RegExpr)[]|{[version:string]: string|RegExpr}
- pattern(s) to match the LLM model file name{[ruleMatched: string]: object]}
- the default parameters of LLM models
id
or group[1]
, it is lowercase always.string
- the id of the parent prompt to inherit{[name: string]: object}
- the version/feature info of the prompt
The Current Default System Prompt Templates: here
The YAML
(.yaml
|.yml
) and JSON
(.json
) file format are supported.
The following code snippet shows how to use the prompts by AIPromptsFunc
sqilteDB.
import { AIPromptsFunc } from '@isdk/ai-tool-prompt';
const promptsDB = new AIPromptsFunc(AIPromptsName, {dbPath: ':memory:'})
// load default system template prompts automatically into sqliteDB
await promptsDB.initData()
const promptInfo = await promptsDB.$getPrompt({ model: 'qwen2.5-7b-it.gguf', type: 'system' })
console.log(promptInfo)
// {prompt: ..., version: 'qwen'}
The following code snippet shows how to use the prompts by findPrompt
function.
import { parse as parseIni } from 'ini'
import { ConfigFile, getConfigs } from '@isdk/ai-tool';
import { findPrompt } from '@isdk/ai-tool-prompt';
// add your prompt file format parser
ConfigFile.register(['.ini'], parseIni)
// load all prompts from your prompts directory, searh all .ini|json|yaml|yml files
const prompts = getConfigs('dir/your-prompts-dir')
const promptInfo = await findPrompt(prompts, 'qwen2.5-7b-it.gguf', { type: 'system' })
FAQs
* Management of various prompts * Collection The LLM System template prompts With Enhancement (guessing corresponding system templates based on the model file name) * Multiple versions support under the same system prompt template file * Recommendation of
We found that @isdk/ai-tool-prompt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.