-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Updated readme, set gpt to default off, cleaned up helper
Showing
6 changed files
with
40 additions
and
33 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
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
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,18 +1,19 @@ | ||
""" | ||
GPT Functions stored here | ||
""" | ||
|
||
from g4f.client import Client | ||
|
||
|
||
def simple_gpt(surf_summary, gpt_prompt): | ||
""" | ||
Surf summary is a report of todays data, ex: The surf is 4 feet with a 10 second period... | ||
GPT Prompt is what kind of report the user wants, loaded in from the environment vars | ||
Surf summary is a report of todays data, ex: The surf is 4 | ||
feet with a 10 second period... GPT Prompt is what kind of | ||
report the user wants, loaded in from the environment vars | ||
""" | ||
client = Client() | ||
response = client.chat.completions.create( | ||
model="gpt-3.5-turbo", | ||
messages=[{"role": "user", "content": surf_summary + gpt_prompt}], | ||
language="en" # Specify English language. For some reason, mine was in Japanese. Should create setting to configure this | ||
) | ||
return response.choices[0].message.content | ||
|
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