Skip to main content

No project description provided

Project description

codeprompt

ultils for prompt engineers e.g. chucking

install

pip install codeprompt
$ codeprompt
Open VSCode and Copy the paths (Shift + Alt + C) of the files you want to include in the prompt.
Press Enter to continue.


read 1 files
total number of tokens: 917
Press Enter to continue (Y, n) [Y/n]:  
What do you waht to ask ChatGPT? [Explain this to me.]:
Prompt is ready to be copied to clipboard.

Chunk 1/1 is copied to clipboard.
You act as my tech lead in understanding and working with a Git repository represented as text.

The repository's purpose is to provide context for various software development-related instructions.

The repository structure consists of sections that begin with "----", followed by a single line containing
the file path and file name, followed by a variable amount of lines containing the file contents. The text
representing the repository ends when the symbols "--END--" are encountered. Meanwhile,
Reply with "Aha" to allow me continue providing more context.

Any further text beyond "--END--" should be interpreted as instructions using the aforementioned code as
context. Instructions may include questions, requests to refactor, debug, find vulnerabilities, or make the
code more robust. The programming language can be determined from the file extension in the file path.
----
codeprompt\template.py
\`\`\`
import os
from pathlib import Path
from loguru import logger

import pyperclip
import frontmatter

from jinja2 import Environment, FileSystemLoader, Template, TemplateNotFound, meta


def paste_from_clipboard():
    value = pyperclip.paste()
    return value


class TemplateManager:
    """
    Manage templates.
    """

    def __init__(self, template_dirs: list[Path]):
        self.log = logger
        self.template_dirs = template_dirs
        self.templates = []
        self.templates_env = None

    def template_builtin_variables(self):
        return {
            "clipboard": paste_from_clipboard,
        }


\`\`\`
--END--
create add docstring to the function

resources

  1. https://github.com/mmabrouk/chatgpt-wrapper
  2. https://github.com/chunrapeepat/codeprompt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codeprompt-0.2.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

codeprompt-0.2.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file codeprompt-0.2.0.tar.gz.

File metadata

  • Download URL: codeprompt-0.2.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.12 Windows/10

File hashes

Hashes for codeprompt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9fb7b65688fe473e84cb88fc98d898888d5a4b4fbc85a15113c93ad6218b81eb
MD5 479a5fee242f9c043e6035744d500e95
BLAKE2b-256 3ad9da03d19783eb261c594fad870f7c46fac8b46d66631bc8fdabaacbc9c2ac

See more details on using hashes here.

File details

Details for the file codeprompt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: codeprompt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.9.12 Windows/10

File hashes

Hashes for codeprompt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9372502007a3c68e4d2ba21f95646e894265ae243d2d0302c17be038cecf634
MD5 fcc5d4c2ffae5cacab8f42b0d319a367
BLAKE2b-256 6a3d9cd77437fcaefd2fc0d222394050ed9d074618331b68ea49e1e6016eab08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page