Skip to content

Commit 9905a8e

Browse files
committed
Change ChatGPT prompt
1 parent 04e6e49 commit 9905a8e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

__debug__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def get_json(self):
88
return self.json_data
99

1010
def main():
11-
data = {'gem_url': 'https://www.shouselaw.com/ca/labor/wrongful-termination/warn-act/', 'new_page_id': '610fd5b3-78a6-4119-96a4-dcc1ed3d1f3a'}
11+
data = {'gem_url': 'https://www.balancepro.org/resources/articles/five-steps-to-smart-tax-management/', 'new_page_id': 'c7a5bebc-a76c-4f26-a7ae-3c8ddddd41ea'}
1212
describe_url(MockWebhook(data))
1313

1414
if __name__ == '__main__':

main.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ def describe_url(webhook):
5151
categories = [option["name"] for option in options]
5252

5353
# Generate the prompt
54-
prompt = f"Describe this webpage ({gem_url}) using only the following tags: {', '.join(categories)}"
54+
prompt = f"Choose the most relevant tags for this webpage {gem_url} from the following list: {', '.join(categories)}. You are not allowed to use any other tags."
5555
print("ChatGPT prompt:", prompt)
5656

5757
# Get the response from the ChatGPT API
5858
chatgpt_answer = get_chatgpt_response(prompt)
59+
print("ChatGPT answer:", chatgpt_answer)
5960

6061
# Select Notion categories that were selected by ChatGPT
6162
tokens = chatgpt_answer.lower().rstrip(" ,.!/").split(", ")
@@ -67,7 +68,7 @@ def describe_url(webhook):
6768
request_payload = { "properties": { "Category": request_payload } }
6869

6970
# Update the Notion database with the ChatGPT answer
70-
print("Notion request payload:", pick(request_payload, "properties"))
71+
print("Notion request payload for updated page:", pick(request_payload, "properties"))
7172
notion.pages.update(
7273
new_page_id,
7374
**request_payload

0 commit comments

Comments
 (0)