Skip to content

joshfarias/Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python logo

Chatbot using text-davinci-003 Model from OpenAI

davinci-003-chatbot.py

This program uses OpenAI's API to generate responses to user prompts and questions in an interactive chatbot format. The responses generated are based on OpenAI's text-davinci-003 language model. To end the chat the user can enter the keyword end.

Below is an screenshot containing a brief conversation with the chatbot:

python logo

Notes

  • Users must have the OpenAI API library for Python installed in order for this program to work. The library can be installed using the following pip command: pip install openai
  • The program has the API key set as an environment variable by default, the code can however be modified in the following ways so that the user can set up their API key differently:
    • Use a configuration file to store the API key
    • Pass the API key through a command-line argument
    • Use a keyring library
    • Hardcode the API key (not recommended)
  • The openai.Completion.create() function call includes several parameters that can be adjusted to change the behavior of the chatbot. More information regarding the parameters can be found on OpenAI's API documentation.

AI Image Generator using OpenAI's DALL-E Model

DALLEImageGenerator.py

This program uses OpenAI's API to generate images based on user prompts using OpenAI's DALL-E model. For best results, user prompts should be clear and concise. For example cat vs orange cat sitting on a windowsill overlooking a city skyline at sunset, photorealistic:

Orange Cat Orange Cat Sitting on Windowsill

Notes

  • Users must have the OpenAI API library for Python installed in order for this program to work. The library can be installed using the following pip command: pip install openai
  • The program has the API key set as an environment variable by default, the code can however be modified in the following ways so that the user can set up their API key differently:
    • Use a configuration file to store the API key
    • Pass the API key through a command-line argument
    • Use a keyring library
    • Hardcode the API key (not recommended)
  • By default the program is set to generate a single image with a resolution of 256x256. This was done for prompt testing purposes due to the greater charges OpenAI places on higher resolution images. This however can easily be changed by modifying the size parameter in the openai.Image.create() function call to a greater resolution such as 1024x1024 and by modifying the n parameter to a set number of how many images you want such as 3.

NBA Player Stats

NBAPlayerStats.py

This program uses swar's NBA API to fetch career, season and game log stats for a given NBA player that the program prompts the user to enter. Here is an example of the program running using the NBA Player Luka Doncic:

Carrer Stats:

Career Stats

Season Stats:

Season Stats

Game Log Stats:

Notes

  • Users must have the nba_api and tabulate libraries for Python installed in order for this program to work. The libraries can be installed using the following pip command: pip install nba_api tabulate

CircuitPython RP2040 Projects using Adafruit's HID Library

This project is based on the following GitHub Repo:

https://github.com/dbisu/pico-ducky

The payload was created by SurfKahuna (RJC)

The payload targets Windows computers. First it opens up Notepad using Run and draws Bart Simpson in ASCII characters then writes the message: "I will learn to lock my computer." several times before locking the computer.

Project Repo

Steps:

  • Download the latest CircuitPython firmware and the Adafruit HID library, you should have a .UF2 file and a .ZIP file.
  • Connect the Raspberry Pi Pico (RP2040) to computer using USB-A to Micro-USB cable.
  • Put the Pico into bootloader mode by holding down the BOOTSEL button when plugging in the USB.
  • The Pico should appear as a mass storage device.
  • Move the .UF2 firmware file that was downloaded from Circuit Python's website on to the Pico.
  • The Pico should now appear as CIRCUITPY
  • Extract the contents of the .ZIP file that was downloaded from Adafruit HID library and search for the following folder:
    • /adafruit_hid
  • Select adafruit_hid and copy it into the lib folder in CIRCUITPY
  • To make a copy of this project you can overwritte the contents of the payload.dd and code.py file with the code from this repo. Just be forewarned as the code will automatically run upon plugging in the Pico. code.py is a Python script that converts DuckyScript into MicroPython code for Pico. The payload.dd file is a binary file that contains the keystrokes and other actions that will be executed by the Pico when it is plugged in.

Media Downloader

mediaDL.py

This program uses the BeautifulSoup and requests Python libraries to parse through a given URL from a web forum and extract and download media that is in the form of (.JPG, .PNG, .GIF, .WEBM and .MP4). Here is an example of the program running and downloading media from AVForums, an audiovisual and home entertainment forum:

Media Downloader

The media that is downloaded will be saved within a folder entitled media within the directory the program is in.

Notes:

  • Users must have the BeautifulSoup and requests libraries for Python installed in order for this program to work. The libraries can be installed using the following pip command: pip install beautifulsoup4 requests

About

Repo for Python programming projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages