semvec/pypi-packages huggingface dataset:
vector-classifier-python 0.1.1
Retrieval-based classification for structured data using embeddings and Pinecone. Zero-training, fast to integrate.
License: MIT
Requires Python: >=3.9

# vector-classifier-python

Retrieval-based classification for structured data using embeddings and Pinecone. Zero-training, fast to integrate.

## Install

```bash
pip install vector-classifier-python pinecone openai huggingface_hub
```

## Quickstart

```python
from vector_classifier import VectorClassifier

classifier = VectorClassifier({
    "pinecone": {
        "api_key": "YOUR_PINECONE_API_KEY",
        "index_name": "animals",
        "metric": "cosine",
        "namespace": "prod"
    },
    "embedding": {
        "provider": "openai",
        "model": "text-embedding-3-small",
        "api_key": "YOUR_OPENAI_API_KEY"
    }
})

classifier.index_data([
    {"id": "1", "label": "Cat", "description": "Small domestic cat", "metadata": {"color": "gray"}},
    {"id": "2", "label": "Dog", "description": "Friendly domestic dog", "metadata": {"size": "medium"}},
])

result = classifier.classify({"description": "Playful feline"}, {"topK": 3, "threshold": 0.2})
print(result)
```

## API
- `index_data(records, options=None)`
- `classify(query, options=None)`
- `batch_classify(queries, options=None)`
- `update_entry(id, data, namespace=None)`
- `delete_index()`

See inline docs for details.

## Image embeddings and classification (CLIP + Pinecone)

Example mirroring the TypeScript `clip-plantnet.ts` is available at `examples/clip_plantnet.py`.

Environment variables required:

```bash
export HF_TOKEN=your_hf_token
export PINECONE_API_KEY=your_pinecone_key
export VC_INDEX=plantnet-clip
export VC_NAMESPACE=dev
export VC_MODEL=sentence-transformers/clip-ViT-B-32
```

Run the example:

```bash
python -m vector-classifier-python.examples.clip_plantnet
```

# vector-indexing-python
telemal 1.2.23
Get intelligence on malicious Telegram channels using bot Token
License: MIT

# Telemal

While threat hunting, you may come across a Telegram bot token embedded in an infostealer, used to transmit stolen data to a Telegram channel. By utilizing Telemal, you can efficiently gather intelligence on the malicious channel, leveraging the bot's token to uncover more information.

![](./images/image.png)

## Installation

`pip install telemal`

## Features

- List channels the bot is part of (Based on messages received in the last 24 hours). 
- Get basic information on a channel.
- List all messages on a channel.
- Leave channel.
- Download files.
- Send a message.
- Send a file.
- Delete all messages in the last 48 hours.
- Export all text messages.

## How does it work ?

There are two angles of intelligence in this tool :

First, using the [getUpdates](https://core.telegram.org/bots/api#getupdates) API method, we can retrieve messages that the bot can read from the last 24 hours. From that, we can possibly find other channels the bot is in.

Then, to retrieves **all messages** from a channel, we use the [forwardMessage](https://core.telegram.org/bots/api#forwardmessage) API method, which is the only way (that I know of) to retrieve a message from a message_id.
The tool first sends a message to retrieve the last message id. It then forwards all messages from 1 to last_message_id **to the same channel**. Obviously, all messages sent for recon are deleted as soon as they are sent. All messages are also sent with the *disable_notification* option. I will not write that it's impossible for a user to notice the messages being sent then deleted, but it's really hard.

### Limitations

- All messages sent with the *protect_content* option will not be retrieved.
- The bot has to have the *can_delete_messages* permission, or the channel will be flooded with messages from the bot. It shouldn't be a big deal as the goal of this tool is to stop criminals' actions, but it's better to know this.

## Teletracker vs Telemal example

![Teletracker vs Telemal](images/image2.png)

Don't hesitate to ask for more features :)