Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

v0.1.1

Compare
Choose a tag to compare
@JesusGautamah JesusGautamah released this 11 Apr 23:46
· 16 commits to master since this release
e8682fa

Awesome Chatgpt Actors

This gem is a easy way to build actor context with Awesome Chatgpt Prompts in ruby
for Chatgpt use.
So for prompts information, please refer to that repository.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add awesome_chatgpt_actors

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install awesome_chatgpt_actors

Add to your rakefile:

require 'awesome_chatgpt_actors'

AwesomeChatgptActors.load_tasks

Run in the command line:

$ rake chatgpt_actors:install

Usage

require 'awesome_chatgpt_actors'

# Initialize a new actor
actor = AwesomeChatgptActors::Actor.new

# it will return an actor with the following options
# {
#   actor: 'Virtual Assistant',
#   prompt: 'I want you to act as a virtual assistant. I will give you tasks and you will reply with the results of the tasks. I want you to only reply with the results of the tasks, and nothing else. Do not write explanations. My first task is ""I want you to write a short story about a cat"""
# }

# Initialize a new actor with options
actor = AwesomeChatgptActors::Actor.new(
  prompt_type: 'Linux Terminal', # The type of actor to use, check the list in https://github.com/f/awesome-chatgpt-prompts/blob/main/prompts.csv
  language: 'en', # The language of the prompt, if other language is specified, it will requirean openai api key to perform the translation
)

# Initialize a new actor with options
actor = AwesomeChatgptActors::Actor.new(
  language: 'pt',
  openai_api_key: 'Your OpenAI API Key' # it can be nil if you provide it as an environment variable OPENAI_API_KEY
)

# Initialize a random actor
actor = AwesomeChatgptActors::Actor.new(
  random: true
)

# Change the actor
actor.act_as('Virtual Assistant') # it will return the same actor with the new options, check the list in https://github.com/f/awesome-chatgpt-prompts/blob/main/prompts.csv

# Add a new actor to csv file
AwesomeChatgptActors::CastControl.add_actor(actor: 'Virtual Assistant', prompt: 'I want you to act as a virtual assistant. I will give you tasks and you will reply with the results of the tasks. I want you to only reply with the results of the tasks, and nothing else. Do not write explanations. My first task is ""I want you to write a short story about a cat"""')

# Remove an actor from csv file
AwesomeChatgptActors::CastControl.remove_actor(actor: 'Virtual Assistant')

# Get a list of all actors
AwesomeChatgptActors::CastControl.actors

# Check if an actor exists
AwesomeChatgptActors::CastControl.actor_exists?(actor: 'Virtual Assistant')

# CSV file path
AwesomeChatgptActors::CastControl.csv_path # can be overriden by setting the environment variable CAST_CSV_PATH

# TEMP file path
AwesomeChatgptActors::CastControl.temp_path # can be overriden by setting the environment variable CAST_TEMP_PATH

What's Changed

New Contributors

Full Changelog: https://github.com/JesusGautamah/awesome-chatgpt-actors/commits/0.1.1