-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from BytePSU/Code-Refactor
ChatGPT & Code Refactors
- Loading branch information
Showing
7 changed files
with
105 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
BOT_TOKEN=YOUR_TOKEN | ||
BOT_GUILD_ID=YOUR_GUILD_ID | ||
CHANNEL_ID=YOUR_CHANNEL_ID | ||
|
||
TESTING_CHANNEL_ID=YOUR_CHANNEL_ID_FOR_TESTING | ||
TESTING=0_OR_1 | ||
TESTING=0_OR_1 | ||
|
||
GPT=YOUR_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ discord.py | |
pillow | ||
python-dotenv | ||
requests | ||
openai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__all__ = ['color', 'internship', 'embed_colors'] | ||
__all__ = ['color', 'internship', 'format_dt', 'job_description'] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from datetime import datetime | ||
|
||
|
||
def current_time(): | ||
'''formats the current time in a nicely manner''' | ||
now = datetime.now() | ||
return now.strftime("%b %d, %Y at %H:%M") | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import openai | ||
from dotenv import load_dotenv | ||
|
||
|
||
load_dotenv() | ||
openai.api_key = os.getenv('GPT') | ||
|
||
|
||
def generate_job_summary(internship): | ||
'''ChatGPT integration to provide brief summaries of companies''' | ||
response = openai.ChatCompletion.create( | ||
model="gpt-3.5-turbo", | ||
messages=[ | ||
{ | ||
"role": "user", | ||
"content": f"Summarize {internship} in 15 words or less WITHOUT restating the company's name. Be engaging!\n\nSummary:"} | ||
], | ||
temperature=1, | ||
max_tokens=20, | ||
) | ||
return response.choices[0].message.content | ||
|