mirror of
https://github.com/f/awesome-chatgpt-prompts.git
synced 2025-03-28 16:48:02 -04:00
Merge b6f2b60d917e380abbb2868f0e69dffb6318bfc9 into 06708da20073a038a3970a1ebac25bd643afeefa
This commit is contained in:
commit
ab1ba3b000
25
scripts/main.py
Normal file
25
scripts/main.py
Normal file
@ -0,0 +1,25 @@
|
||||
import pandas as pd, sys
|
||||
|
||||
class PromptFinder:
|
||||
def __init__(self, csv_file):
|
||||
self.df = pd.read_csv(csv_file)
|
||||
|
||||
def find(self, search_string):
|
||||
result = self.df[self.df["act"] == search_string]["prompt"].values
|
||||
|
||||
if len(result) > 0:
|
||||
return result[0]
|
||||
else:
|
||||
return f"No prompt found for '{search_string}'."
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
prompt_finder = PromptFinder("../prompts.csv")
|
||||
if not sys.stdin.isatty():
|
||||
act_to_search = sys.stdin.readline().rstrip()
|
||||
else:
|
||||
act_to_search = input("Enter the ACT to search for: ")
|
||||
|
||||
prompt_result = prompt_finder.find(act_to_search)
|
||||
|
||||
print(prompt_result)
|
Loading…
x
Reference in New Issue
Block a user