semvec/pypi-packages huggingface dataset:
scriptomatic 1.0.3
A cli tool to generate custom Python scripts
License: MIT
Requires Python: <4.0,>=3.11
Keywords: script, generator, ai, tool-use

# 🏭 Script-O-Matic

Welcome to Script-O-Matic, your friendly neighborhood Python script generator! 🐍✨

## 🎯 What is Script-O-Matic?

Script-O-Matic is a CLI tool that turns your ideas into fully-functional Python scripts. It uses structured output from the OpenAI API to generate scripts that are both creative and functional, as well as DSPy to refine your query to make it more specific and actionable. Check out the /example-scripts folder for some examples of what Script-O-Matic can make, feel free to add to it.

## 🚀 Features

Generate custom Python scripts based on your prompts
Get inspiration for script ideas with `--inspo`
Automatic package installation
Interactive mode for script refinement
Powered by the latest AI models

## 🛠 Installation

First, make sure you have Python 3.11 or later installed. Then, you can install Script-O-Matic using pip:

```bash
pip install scriptomatic
```

## 🔑 Setup

Yeah, you're gonna need an OpenAI API key. You can get one from OpenAI's website.

"But Ty, I don't want to use OpenAI, Claude is better at coding!" I agree with you. But Claude doesn't support structured outputs yet. When it does make a PR plz.

Set it as an environment variable:

```bash
export OPENAI_API_KEY='your-api-key-here'
```

Or, for the Windows wizards out there:

```bash
set OPENAI_API_KEY=your-api-key-here
```

## 🎭 Usage

### CLI Magic

Generate a script with a simple prompt:

```bash
scriptomatic "Create a script that converts a jpg to a png"
```

### Need Inspiration?

Get inspired with the `--inspo` flag, which creates five script ideas from your fuzzy idea:

```bash
scriptomatic --inspo
```

### Generate and test the script in a loop

Script-O-Matic will keep trying to run the script until it gets it right, with a human-in-the-loop to help refine the script.

```bash
scriptomatic "Web scraper for cat facts" --loop
```

### Let Script-O-Matic keep trying until it gets it right

Careful with this one. It's essentially an infinite loop until it gets it right, or you kill it with ctrl+c.

```bash
scriptomatic "Calculate prime numbers" --autoloop
```

### Python Usage

The Scriptomatic class can be imported and used in your Python scripts, and has a whole host of methods for generating scripts and getting inspiration. Everything in the project is modular and extensible, so you can customize Script-O-Matic to your heart's content.

```python
from scriptomatic import Scriptomatic

scriptomatic = Scriptomatic(model="gpt-4o-mini", temperature=0.6)

scriptomatic.generate_script("Create a script that builds scripts")
```

## 🌟 Contributing

Found a bug? Have an idea for an enchanting new feature? Let me know! Open an issue or submit a pull request here on GitHub.

## 📜 License

Script-O-Matic is released under the MIT License. Do whatever you want with it!
infinity-llm 0.1.0
use any llm api in a plug-and-play fashion
License: MIT
Requires Python: <4.0,>=3.9

# infinity-llm: Use any LLM API

infinity-llm is a collection of Python tools to make LLM APIs plug-and-play for fast, easy experimentation.
I use this in my own projects today, but it's still very much a work in progress. I'm trying to strike 
the balance between simplicity and modularity, so if you have ideas feel free to message me or submit a PR!

[![Twitter Follow](https://img.shields.io/twitter/follow/markycasty?style=social)](https://twitter.com/markycasty)

## Key Features

- **Chat Completion**: Mostly a wrapper around [jxnl/instructor](https://github.com/jxnl/instructor), supports a/sync chat completion and streaming for structured and unstructured chat completions.
- **Embeddings/Rerankers**: Easily use a slew of embedding and reranking models
- **Asynchronous Workloads**: Run all chat completion and embedding workloads in massively parallel fashion without worrying about rate limits. Nice for ETL pipelines.
- **OpenAI Batch Jobs**: Run large scale batch jobs with OpenAI's batch API.

## Chat Completion

All types of chat completions are made easy!

1. Make a client
```python
from infinity_llm import from_any, Provider

client = from_any(
    provider=Provider.OPENAI, 
    model_name="gpt-4o", 
    async_client=False
    )
```

2. Choose between a/sync un/structured response with/without streaming

```python
# synchronous, unstructured response without streaming 
# (aka a standard chat completion
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a friend."},
        {"role": "user", "content": "Tell me about your day."}
    ],
    response_model=None # No response model means unstructured response
)
```

## Embeddings/Rerankers
```python
from infinity_llm import Provider, embed_from_any

# Create a Cohere embedding client
client = embed_from_any(Provider.COHERE)

# Example text to embed
text = "This is an example sentence to embed using Cohere."

# Get the embedding
embeddings, total_tokens = client.create(input=text, model="embed-english-v3.0", input_type="clustering")


print(f"Number of embeddings: {len(embeddings)}")
# > Number of embeddings: 1
print(f"Embedding dimension: {len(embeddings[0])}")
# > Embedding dimension: 1536
print(f"Usage: {total_tokens}")
# > Usage: 13
```