Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.