Skip to content

Commit 99d4409

Browse files
committed
Add news article generator app
1 parent fd92645 commit 99d4409

File tree

2 files changed

+222
-0
lines changed

2 files changed

+222
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
name: News Article Generator
2+
slug: news-article-generator
3+
description: Generate a news article on a given topic
4+
version: "0.0.1"
5+
icon: news_article_generator_icon.png
6+
categories:
7+
- utilities
8+
- research
9+
- writing
10+
config:
11+
seed: 2
12+
model: gpt-4o-mini
13+
layout: >-
14+
<pa-layout sx='{"maxWidth": "1200px", "margin": "0 auto", "padding": "0",
15+
"height": "100%"}'>
16+
<pa-grid container="true" spacing="2" sx='{"height": "100%", "flexDirection": "column"}'>
17+
<pa-grid item="true" xs="12" sx='{"overflow": "auto !important", "flex": "1 1 0 !important", "padding": "0 !important"}'>
18+
<pa-chat-output></pa-chat-output>
19+
</pa-grid>
20+
<pa-grid item="true" xs="12" sx='{"alignSelf": "flex-end", "flex": "0 !important", "width": "100%", "padding": "0 !important"}'>
21+
<pa-input-form clearonsubmit="true"></pa-input-form>
22+
</pa-grid>
23+
</pa-grid>
24+
</pa-layout>
25+
stream: null
26+
max_steps: 10
27+
split_tasks: true
28+
temperature: 0.7
29+
init_on_load: null
30+
user_message: "{{topic.text}}"
31+
window_color: "#477195"
32+
input_template: ""
33+
system_message: >-
34+
You are a helpful assistant writing informational articles on a given topic.
35+
You will follow the below guidelines when generating an article.
36+
37+
38+
1. Article should have a clear, captive and non sensational title followed
39+
by a cover image related to the article
40+
41+
2. You will search the internet and read urls related to the topic before
42+
writing the article
43+
44+
3. You must visit a minimum of 2 urls using the static web browser before
45+
generating the article
46+
47+
4. Include hyperlinks in the content where relevant
48+
49+
5. You will search internet for relevant images for the content and include
50+
them in the article along with captions and attribution
51+
52+
6. Images should be contextual and reflect the content around the image
53+
54+
7. Article should contain at least 3000 words
55+
56+
8. Generated final article should be ready to publish
57+
58+
9. Do not include any information about how the article is generated
59+
60+
10. Emulate writing style of publications like BBC and NYT
61+
62+
63+
You have access to the following tools:
64+
65+
1. web_browser: used to open a web page and get the contents of the page
66+
67+
2. web_search: searches the internet based on a given query and returns the
68+
list of urls
69+
70+
3. image_search: searches images for images matching given query and returns
71+
the urls
72+
73+
74+
Current date is {{ "now" | date: "%Y-%m-%d %H:%M" }}. Now let's think step
75+
by step:
76+
assistant_image: ""
77+
welcome_message: ""
78+
chat_bubble_text: null
79+
chat_bubble_style: null
80+
chat_history_limit: 10
81+
suggested_messages: []
82+
type_slug: agent
83+
processors:
84+
- id: web_browser
85+
name: Static Web Browser
86+
input:
87+
url: "{{url}}"
88+
instructions:
89+
- data: ""
90+
type: Wait
91+
selector: body
92+
config:
93+
timeout: 10
94+
stream_video: true
95+
connection_id: null
96+
tags_to_extract:
97+
- img
98+
description: Visit a webpage from a URL and get the text from that page
99+
input_fields:
100+
- name: url
101+
type: string
102+
title: URL of the page
103+
description: URL of the page to open
104+
provider_slug: promptly
105+
processor_slug: static_web_browser
106+
output_template:
107+
markdown: >
108+
{% if content.screenshot %}
109+
110+
<pa-asset url="{{content.screenshot}}" type="image/png"></pa-asset>%}
111+
112+
{% else %}
113+
114+
<promptly-web-browser-embed
115+
wsUrl="{{session.ws_url}}"></promptly-web-browser-embed>
116+
117+
{% endif %}
118+
119+
120+
## Text from the page
121+
122+
123+
{{text | truncate: 4000}}
124+
- id: web_search
125+
name: Web Search
126+
input:
127+
url: www.google.com/search?q={{query}}
128+
instructions:
129+
- data: ""
130+
type: Wait
131+
selector: body
132+
config:
133+
timeout: 10
134+
stream_video: true
135+
connection_id: null
136+
tags_to_extract:
137+
- a
138+
description: Search the web for answers
139+
input_fields:
140+
- name: query
141+
type: string
142+
title: Search Query
143+
required: true
144+
description: Search query to be used
145+
provider_slug: promptly
146+
processor_slug: static_web_browser
147+
output_template:
148+
markdown: >-
149+
{% if content.screenshot %}<pa-asset url="{{content.screenshot}}"
150+
type="image/png"></pa-asset>%}{% else %}<promptly-web-browser-embed
151+
wsUrl="{{session.ws_url}}"></promptly-web-browser-embed>{% endif %}
152+
153+
154+
155+
## Text from the search results page
156+
157+
158+
{{text}}
159+
160+
161+
## Links from the search results page
162+
163+
164+
{% for link in content.links %}
165+
166+
{{ link.url }} - {{ link.text }}
167+
168+
{% endfor %}
169+
- id: image_search
170+
name: Image Search
171+
input:
172+
url: >-
173+
https://duckduckgo.com/?t=h_&q={{query}}&iax=images&ia=images&iaf=size%3ALarge
174+
instructions:
175+
- data: "2000"
176+
type: Wait
177+
selector: dummy
178+
config:
179+
timeout: 10
180+
stream_video: true
181+
connection_id: null
182+
tags_to_extract:
183+
- img
184+
description: Search the internet for images
185+
input_fields:
186+
- name: query
187+
type: string
188+
title: Search Query
189+
required: true
190+
description: Search query to be used for finding images
191+
provider_slug: promptly
192+
processor_slug: static_web_browser
193+
output_template:
194+
markdown: >-
195+
{% if content.screenshot %}<pa-asset url="{{content.screenshot}}"
196+
type="image/png"></pa-asset>%}{% else %}<promptly-web-browser-embed
197+
wsUrl="{{session.ws_url}}"></promptly-web-browser-embed>{% endif %}
198+
199+
200+
201+
## Text from the search results page
202+
203+
204+
{{text}}
205+
206+
207+
## Images from the search results page
208+
209+
210+
{% for img in content.images %}
211+
212+
{{ img.src }} - {{ img.text }}
213+
214+
{% endfor %}
215+
input_fields:
216+
- name: topic
217+
type: multi
218+
title: Topic
219+
required: true
220+
description: Provide a topic for the article
221+
output_template:
222+
markdown: "{{agent.content}}"
Loading

0 commit comments

Comments
 (0)