open-index/open-npm huggingface dataset:
npm package: @isdk/ai-tool-llm
Description: ## LLMProvider
Author: Riceball LEE
Latest version: 0.1.14

# ai-tool-llm

## LLMProvider

LLMProvider serves as the base class for all Large Language Model (LLM) backends, enabling support for various model types from a single backend. This class is pivotal in obtaining outputs from any LLM.

Every LLM provider must define:

* `rule`: `RegExp | string | function`: optional, Determines which model names this provider will service. For instance, lama.cpp might use the pattern `/[.]gguf$/`.
* `async function(input: LLMArguments)`: Accepts input and returns the LLM's output. The function's objective is to generate output based on the input, which can be either a streamed JSON object or a non-streamed response.

Note: the registered provider name will be treat as model url protocol name part.

The LLM's output is structured as a JSON Object adhering to the following schema:

```js
export type AITextGenerationFinishReason =
  | 'stop'       // Model generated a stop sequence
  | 'length'     // Maximum token limit reached
  | 'content-filter' // Content violated filters
  | 'tool-calls'  // Model invoked tool calls
  | 'abort',      // aborted by user or timeout for stream
  | 'error'      // Model halted due to an error
  | 'other'      // Other termination reasons
  | null;        // No specified reason

export interface AIResult<TValue = any, TOptions = any> {
  /**
   * Generated content.
   */
  content?: TValue;

  /**
   * Reason for generation termination.
   */
  finishReason?: AITextGenerationFinishReason;

  /**
   * Optional parameters associated with the result.
   */
  options?: TOptions;
}
```

In the case of streaming output, the returned JSON objects exclude `finishReason` and only include `content`. `options` are optional.

To register diverse LLM backends and retrieve results, invoke the LLM method. If no specific LLM backend is designated, the default one set via current will process requests. It also facilitates querying the parameter size of the `current` LLM model.

Static method `getByModel(modelName: string)` is employed to determine the appropriate Provider based on the model name provided.
npm package: @isdk/ai-tool-prompt
Description: * 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
Author: Riceball LEE
Latest version: 0.4.2

# ai-tool-prompt

* 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 parameters for LLM models
* Extensible multiple template formats to write system prompt template: jinjia2 (hf), golang (ollama), python fstring (langchain). Here jinjia2 is used as the default template format.
* Extensible file format: `yaml`, `json`. Here yaml format is used as the default file format.

## Installation

```bash
npm install @isdk/ai-tool @isdk/ai-tool-prompt
```

## Prompt Structure

* _id: `string` (unique) - id of the prompt
* templateFormat: `'hf'|'ollama'|'langchain'` - template format of the prompt, defaults to 'hf'
* template: `string` - template of the prompt, eg, '{{messages[0].content}}'
* type: `'system'|'tool'|'char'` - type of the prompt
* prompt: `object` - default prompt template data
* modelPattern: `string|RegExpr|(string|RegExpr)[]|{[version:string]: string|RegExpr}` - pattern(s) to match the LLM model file name
* parameters: `{[ruleMatched: string]: object]}` - the default parameters of LLM models
  * the key is the matched rule named group: `id` or `group[1]`, it is lowercase always.
  * the value is parameters of the LLM model
* extends: `string` - the id of the parent prompt to inherit
* version: `{[name: string]: object}` - the version/feature info of the prompt
  * the key is the name of the version/feature
  * the value is the prompt to overwrite.

The Current Default System Prompt Templates: [here](./prompts/)

The `YAML`(`.yaml`|`.yml`) and `JSON`(`.json`) file format are supported.

## Usage

The following code snippet shows how to use the prompts by `AIPromptsFunc` sqilteDB.

```js
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.

```js
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' })
```
npm package: @isdk/ai-tool-sqlite
Description: SQlite(>=3.45.0) key/value store
Author: Riceball LEE
Latest version: 0.1.15

# ai-tool-sqlite

SQlite(>=3.45.0) key/value store

## KVSqliteResFunc

The AI RESTful ResServer API.

Parameters:

* dbPath: Path to the database file.

## SqliteStore Tool API

An AI SqliteStore Tool function via `createSqliteStore` represents a database.
npm package: @isdk/artistic-text
Description: Generates artistic text with custom fonts and color.
Author: Riceball LEE
Latest version: 0.1.1

# @isdk/artistic-text

[![npm version](https://badge.fury.io/js/@isdk%2Fartistic-text.svg)](https://badge.fury.io/js/@isdk%2Fartistic-text)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

`@isdk/artistic-text` is a library that generates stylized ASCII art text with customizable fonts and color.

## Features

- Random font selection from supported Figlet fonts
- Custom color support via ANSI colors
- Specify font and color options
- Exclude problematic fonts by default

## Installation

You can install `@isdk/artistic-text`:

```bash
npm install @isdk/artistic-text
```

## Usage

```typescript
import { artisticText } from '@isdk/artistic-text';

// Basic usage with default options
console.log(artisticText('Hello World'));

// Custom configuration
console.log(artisticText('Node.js', {
  font: '3D-ASCII',
  color: 'blue'
}));
```

### Options

| Option       | Type   | Description |
|--------------|--------|-------------|
| font         | string | Font name (default: random selection from supported fonts) |
| color        | string | Text color (supports all ansi-colors names, default: 'gray'; use 'none' to disable) |
| Other options| -      | Accepts all figlet Options                 |

## Contributing

We welcome contributions from the community! Here are some ways you can help:

* **Bug Reports**: If you find a bug, please open an issue on the [GitHub Issues page](https://github.com/isdk/artistic-text.js/issues).
* **Feature Requests**: If you have an idea for a new feature, feel free to open an issue to discuss it.
* **Pull Requests**: If you want to contribute code, please fork the repository and submit a pull request with your changes.

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE-MIT) file for details.