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

enhance: update prompt to format wordpress post content #419

Merged
merged 7 commits into from
Feb 7, 2025
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
12 changes: 6 additions & 6 deletions wordpress/tool.gpt
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ Share Context: Wordpress Context

---
Name: Create Post
Description: Create a post in user'swordpress site
Description: Create a post in user's Wordpress site. Use HTML tags to format the content, for example, <strong>Bold Text</strong> for bold text. By default, the post will be created as a draft. Do NOT set status to publish unless it is confirmed by the user.
Credential: ./credential
Share Context: Wordpress Context
Param: title: the title of the post
Param: content: the content of the post
Param: status: (optional) the status of the post, must be one of: publish, future, draft, pending, private, default is publish
Param: content: the content of the post.
Param: status: (optional) the status of the post, must be one of: publish, future, draft, pending, private, default is draft.
tybalex marked this conversation as resolved.
Show resolved Hide resolved
Param: comment_status: (optional) the comment status of the post, must be one of: open, closed. default is open
Param: sticky: (optional) whether the post is sticky to the top of the page, default is false
Param: password: (optional) the password of the post, default is None
Expand All @@ -81,7 +81,7 @@ Param: ping_status: (optional) the ping status of the post, must be one of: open

---
Name: Update Post
Description: Update a post in user's wordpress site. Only the fields that are provided will be updated.
Description: Update a post in user's Wordpress site. Only the fields that are provided will be updated. Use HTML tags to format the content, for example, <strong>Bold Text</strong> for bold text.
Credential: ./credential
Share Context: Wordpress Context
Param: post_id: the id of the post to update
Expand Down Expand Up @@ -122,8 +122,8 @@ Share Context: ../time
You have access to a set of tools to interact with a Wordpress workspace.

Display all dates and times in the user's preferred timezone. When the user gives values for dates and times, assume they are in the user's preferred timezone unless otherwise specified by the user.
Wordpress post doesn't render markdown syntax, so when you create or update a post, you should not fill the content with markdown syntax.
Wordpress post supports a list of different formats, here are the definitions:
You MUST use HTML tags to format the content. WordPress posts do NOT render markdown syntax.
WordPress posts support the following formats:
- standard: The default post format.
- aside: Typically styled without a title. Similar to a Facebook note update.
- gallery: A gallery of images. Post will likely contain a gallery shortcode and will have image attachments.
Expand Down
2 changes: 1 addition & 1 deletion wordpress/tools/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def create_post(client):
content = os.getenv("CONTENT", "")
if title == "" and content == "":
raise ValueError("Error: At least one of title or content must be provided.")
status = os.getenv("STATUS", "publish").lower()
status = os.getenv("STATUS", "draft").lower()
status_enum = ["publish", "future", "draft", "pending", "private"]
if status not in status_enum:
raise ValueError(
Expand Down