semvec/pypi-packages huggingface dataset:
backprompt 0.1.1
AI Integration, Simplified. Tailor LLM outputs to your exact needs, no datasets or finetuning required.
Requires Python: >=3.7
Keywords: backprompt, ai, llm, prompt engineering, api

# Backprompt: AI Integration, Simplified

Tailor LLM outputs to your exact needs, no datasets or finetuning required.

## Installation

```bash
pip install backprompt
```

## Usage
#### Step 1: Solve for an optimal prompt
```python
from backprompt import BackpromptClient

# Initialize the client
client = BackpromptClient(
    api_key='[your-api-key]', 
    api_url='[your-api-url]'
)


input_text = "The new smartphone boasts a 108MP camera and 5G capability."
desired_output = """
🌟 Tech Specs Breakdown 🌟
📸 Camera: 108MP (Ultra High-Res)
📡 Connectivity: 5G-enabled
💡 Key Benefit: Pro-level photography with lightning-fast uploads
"""

optimal_prompt = client.solve_prompt(input_text, desired_output)
print(f"Optimal prompt: {optimal_prompt}")
```

#### Step 2: Deploy the optimal prompt
```python
optimal_prompt.deploy(client)
```

#### Step 3: Generate using the deployed prompt
```python
prompt_vars = {"input_data": "The latest smartwatch features a 1.4-inch AMOLED display and 7-day battery life."}
completion = optimal_prompt.run(client, prompt_vars)

print(f"Generated response: {completion}")
```

## Key Features

1. **Prompt Optimization**: Generate optimal prompts based on input-output pairs.
2. **Prompt Deployment**: Deploy optimized prompts for quick access.
3. **Response Generation**: Generate responses using deployed prompts.

## Backprompt's Edge for Developers

- Prompt Engineering, Automated
- Rapid Iteration Cycle
- Model-Agnostic Customization
- Resource Efficiency

## Backprompt Across Domains

- Nuanced Sentiment Extraction
- Specialized Knowledge Base Q&A
- Consistent Code Snippet Generation

For more information, visit [backprompt.ai](https://backprompt.ai)

© 2024 backprompt
polars-fuzzy-match 0.1.5
Polars extension for fzf-style fuzzy matching 
Requires Python: >=3.8

# Polars Fuzzy Matching

## Installation

```
pip install polars
pip install polars-fuzzy-match
```

## Usage

With both the plugin and polars installed, usage is as follows:

```python
import polars as pl
from polars_fuzzy_match import fuzzy_match_score


df = pl.DataFrame(
    {
        'strs': ['foo', 'foo quz BAR', 'baaarfoo', 'quz'],
    }
)
pattern = 'bar'
out = df.with_columns(
    score=fuzzy_match_score(
        pl.col('strs'),
        pattern,
    )
)
print(out)
```

This outputs:

```
shape: (4, 2)
┌─────────────┬───────┐
│ strs        ┆ score │
│ ---         ┆ ---   │
│ str         ┆ u32   │
╞═════════════╪═══════╡
│ foo         ┆ null  │
│ foo quz BAR ┆ 88    │
│ baaarfoo    ┆ 74    │
│ quz         ┆ null  │
└─────────────┴───────┘
```

When there is no match, score is `null`. When the pattern matches the value in
the given column, score is non-null. The higher the score, the closer the value
is to the pattern. Therefore, we can filter out values that do not match and
order by score:

```python
pattern = 'bar'
out = (
    df.with_columns(
        score=fuzzy_match_score(
            pl.col('strs'),
            pattern,
        )
    )
    .filter(pl.col('score').is_not_null())
    .sort(by='score', descending=True)
)
print(out)
```

This outputs:

```
shape: (2, 2)
┌─────────────┬───────┐
│ strs        ┆ score │
│ ---         ┆ ---   │
│ str         ┆ u32   │
╞═════════════╪═══════╡
│ foo quz BAR ┆ 88    │
│ baaarfoo    ┆ 74    │
└─────────────┴───────┘
```

### Fzf-style search syntax

This plugin supports Fzf-style search syntax for the pattern. It's worth noting
that this section is taken almost verbatim from the Fzf README:

| Pattern   | Match type                 | Description                                 |
| --------- | -------------------------- | ------------------------------------------- |
| `bar`     | fuzzy                      | items that fuzzy match `bar` e.g. 'bXXaXXr' |
| `'foo`    | substring exact match      | items that include `foo` e.g. 'is foo ok'  |
| `^music`  | prefix exact match         | items that start with `music`               |
| `.mp3$`   | suffix exact match         | items that end with `.mp3`                  |
| `!fire`   | inverse exact match        | items that do not include `fire`            |
| `!^music` | inverse prefix exact match | items that do not start with `music`        |
| `!.mp3$`  | inverse suffix exact match | items that do not end with `.mp3`           |

## Credits

1. Marco Gorelli's Tutorial on writing Polars Plugin. See
   [here](https://marcogorelli.github.io/polars-plugins-tutorial/).
2. The Helix Editor team for the
   [Nucleo fuzzy matching library](https://github.com/helix-editor/nucleo).