Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling GPT model switching #86

Merged
merged 3 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ FEEDLY_TOKEN=
# Head over to https://openai.com/ to get your token and organization id.
OPENAI_ACCESS_TOKEN=
OPENAI_ORGANIZATION_ID=
# Pick the ChatGPT Model (gpt-4 or gpt-3.5-turbo)
OPENAI_GPT_MODEL=gpt-3.5-turbo

# Head over to https://www.thenextleg.io/, create an account, configure midjourney, and get your token.
NEXT_LEG_TOKEN=
Expand Down Expand Up @@ -48,8 +50,4 @@ DYNAMIC_THROTTLE = true
# Toggle Social Networks
TWITTER_ENABLED = TRUE
LINKEDIN_ENABLED = TRUE
PINTEREST_ENABLED = TRUE

# This will strip out the hashtags from the tweet and replace them with
# Trending real-time hashtags from Ayrshare
AUTOMATIC_HASHTAGS = TRUE
PINTEREST_ENABLED = TRUE
1 change: 1 addition & 0 deletions .github/workflows/ruby_on_rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
NEXT_LEG_TOKEN: ${{ secrets.NEXT_LEG_TOKEN }}
OPENAI_ACCESS_TOKEN: ${{ secrets.OPENAI_ACCESS_TOKEN }}
OPENAI_ORGANIZATION_ID: ${{ secrets.OPENAI_ORGANIZATION_ID }}
OPENAI_GPT_MODEL: gpt-3.5-turbo
ORGANIZATION: ${{ secrets.ORGANIZATION }}
STORYPRO_API_KEY: ${{ secrets.STORYPRO_API_KEY }}
STORYPRO_API_URL: ${{ secrets.STORYPRO_API_URL }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Compliance with applicable laws, regulations, and ethical standards is essential
Responsible and ethical use of AI-generated content is imperative to avoid harmful consequences, such as spreading misinformation, creating offensive material, or infringing upon others' rights. Users are solely responsible for preventing these negative outcomes.

By using QuasarAI, you agree to the following terms and conditions:
1. Acknowledge that QuasarAI utilizes generative AI technology, including OpenAI's GPT-3.5-turbo model and Midjourney's image generation models.
1. Acknowledge that QuasarAI utilizes generative AI technology, including OpenAI's GPT models and Midjourney's image generation models.
2. Assume full responsibility and legal liability for any content, including text and images, generated by the AI models integrated within QuasarAI.
3. Understand that QuasarAI and its contributors are not liable for any consequences arising from the content generated by the AI models, including accuracy, legality, or ethical implications.
4. Agree to comply with all applicable laws, regulations, and ethical standards in your jurisdiction when using generative AI and its content. Ensure the generated content does not infringe upon rights, violate laws, or contravene regulations.
Expand All @@ -53,7 +53,7 @@ By using QuasarAI or any content generated by its AI integrations, including tex

For the specific terms and conditions governing the usage of Midjourney's image generation models, please refer to [Midjourney's Terms of Service](https://docs.midjourney.com/docs/terms-of-service).

For the specific terms and conditions governing the usage of OpenAI's GPT-3.5-turbo model (ChatGPT), please refer to [OpenAI's Terms of Service](https://openai.com/policies/terms-of-use).
For the specific terms and conditions governing the usage of OpenAI's GPT models (ChatGPT), please refer to [OpenAI's Terms of Service](https://openai.com/policies/terms-of-use).

This comprehensive and legally sound disclaimer aims to mitigate potential legal risks and promote responsible and ethical use of QuasarAI and its AI integrations. Review and understand these terms and conditions, along with the respective Terms of Service, before using QuasarAI or any content generated by its AI models.

Expand All @@ -65,7 +65,7 @@ Join us on this exciting journey as we redefine the future of journalism togethe
### Required
- [Feedly](https://feedly.com/i/welcome) – Stellar News Aggregation ($12/month for Pro+ Plan)
- [OpenAI](https://beta.openai.com/) – Cosmic Content Creation (We are using gpt-3.5-turbo which costs $0.002 per 1000/tokens)
- [NexLeg](https://nexleg.com/) – Futuristic Visual Storytelling ($40/month for API Acccess + $30/month from Midjourney)
- [NexLeg](https://nexleg.com/) – Futuristic Visual Storytelling ($40/month for API Access + $30/month from Midjourney)

__Total:__ $82/month + OpenAI Costs

Expand Down
2 changes: 1 addition & 1 deletion app/jobs/discussions/make_stem_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def valid_json?(json_string)
def chat(messages:)
@client.chat(
parameters: {
model: "gpt-3.5-turbo", # Required.
model: ENV['OPENAI_GPT_MODEL'], # Required.
messages:,
temperature: 0.7
}
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/images/create_image_idea_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def valid_json?(json_string)
def chat(messages:)
@client.chat(
parameters: {
model: "gpt-3.5-turbo", # Required.
model: ENV['OPENAI_GPT_MODEL'], # Required.
messages:,
temperature: 0.7
}
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/stories/make_stem_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def valid_json?(json_string)
def chat(messages:)
@client.chat(
parameters: {
model: "gpt-3.5-turbo", # Required.
model: ENV['OPENAI_GPT_MODEL'], # Required.
messages:,
temperature: 0.7
}
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/tweets/make_stem_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def valid_json?(json_string)
def chat(messages:)
@client.chat(
parameters: {
model: "gpt-3.5-turbo", # Required.
model: ENV['OPENAI_GPT_MODEL'], # Required.
messages:,
temperature: 0.7
}
Expand Down
2 changes: 1 addition & 1 deletion spec/jobs/discussions/make_stem_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
it 'calls the OpenAI client with the correct parameters' do
expect(client).to receive(:chat).with(
parameters: {
model: "gpt-3.5-turbo",
model: ENV['OPENAI_GPT_MODEL'],
messages: anything,
temperature: 0.7
}
Expand Down