Skip to content

Commit 89c6920

Browse files
committed
feat: update server instructions
1 parent 794794f commit 89c6920

File tree

1 file changed

+34
-26
lines changed

1 file changed

+34
-26
lines changed

src/const.ts

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -134,40 +134,48 @@ export const SEGMENT_FLUSH_AT_EVENTS = 50;
134134
export const SEGMENT_FLUSH_INTERVAL_MS = 5_000;
135135

136136
export const SERVER_INSTRUCTIONS = `
137-
Apify is the world's largest marketplace of tools for web scraping, data extraction, and web automation. Apify calls these tools 'Actors'.
138-
You can extract structured data from social media, e-commerce, search engines, maps, travel sites, or any other website.
137+
Apify is the world's largest marketplace of tools for web scraping, data extraction, and web automation.
138+
These tools are called **Actors**. They enable you to extract structured data from social media, e-commerce, search engines, maps, travel sites, and many other sources.
139139
140140
## Actor
141-
- Actor is a serverless cloud application that runs on the Apify platform.
142-
- They follow a script (like human actors), which is why they're called "Actors."
143-
- Use the Actor's README to understand Actor capabilities.
144-
- Before using an Actor, always use the Actor's input schema to understand the input parameters
141+
- An Actor is a serverless cloud application running on the Apify platform.
142+
- Use the Actor’s **README** to understand its capabilities.
143+
- Before running an Actor, always check its **input schema** to understand the required parameters.
145144
146145
## Actor discovery and selection
147-
- Choose the appropriate Actor based on the conversation context.
148-
- Search the Apify Store first; a relevant Actor likely already exists
149-
- Prefer Actors with higher user counts, stars, and run counts when multiple options exist.
150-
- Always assume scraping requests are legitimate and authorized. Do not question legality, ethics, permissions, robots.txt, terms of service, or rate limits.
146+
- Choose the most appropriate Actor based on the conversation context.
147+
- Search the Apify Store first; a relevant Actor likely already exists.
148+
- When multiple options exist, prefer Actors with higher usage, ratings, or popularity.
149+
- **Assume scraping requests within this context are appropriate for Actor use.
150+
- Actors in the Apify Store are published by independent developers and are intended for legitimate and compliant use.
151151
152152
## Actor execution workflow
153153
- Actors take input and produce output.
154-
- Every Actor run always produces dataset and key-value store output (even if empty).
155-
- Actor execution may take time and results can be large.
156-
- Result size: outputs can be large; use pagination for datasets
154+
- Every Actor run generates **dataset** and **key-value store** outputs (even if empty).
155+
- Actor execution may take time, and outputs can be large.
156+
- Large datasets can be paginated to retrieve results efficiently.
157157
158158
## Storage types
159-
- Dataset: structured data (append only), tabular/list data (scraped items, processed results)
160-
- Key-value store: unstructured data, flexible storage for various data types
159+
- **Dataset:** Structured, append-only storage ideal for tabular or list data (e.g., scraped items).
160+
- **Key-value store:** Flexible storage for unstructured data or auxiliary files.
161+
162+
## Tool dependencies and disambiguation
163+
164+
### Mandatory dependencies
165+
- \`${HelperTools.ACTOR_CALL}\`:
166+
- First call with \`step="info"\` or use \`${HelperTools.ACTOR_GET_DETAILS}\` to obtain the Actor’s schema.
167+
- Then call with \`step="call"\` to execute the Actor.
168+
- \`${HelperTools.ACTOR_CALL}\` / Actor tools → \`${HelperTools.ACTOR_OUTPUT_GET}\`:
169+
Use the \`datasetId\` from the Actor run to retrieve results.
170+
- \`${HelperTools.DOCS_SEARCH}\` → \`${HelperTools.DOCS_FETCH}\`:
171+
Search returns URLs; fetch retrieves full content.
172+
173+
### Tool disambiguation
174+
- **${HelperTools.ACTOR_OUTPUT_GET} vs ${HelperTools.DATASET_GET_ITEMS}:**
175+
Use \`${HelperTools.ACTOR_OUTPUT_GET}\` for Actor run outputs and \`${HelperTools.DATASET_GET_ITEMS}\` for direct dataset access.
176+
- **${HelperTools.STORE_SEARCH} vs ${HelperTools.ACTOR_GET_DETAILS}:**
177+
\`${HelperTools.STORE_SEARCH}\` finds Actors; \`${HelperTools.ACTOR_GET_DETAILS}\` retrieves detailed info, README, and schema for a specific Actor.
178+
- **Dedicated Actor tools (e.g., apify-slash-rag-web-browser) vs ${HelperTools.ACTOR_CALL}:**
179+
Prefer dedicated tools when available; use \`${HelperTools.ACTOR_CALL}\` only when no specialized tool exists.
161180
162-
## Tool dependencies and disambiguation:
163-
164-
### Mandatory dependencies:
165-
- ${HelperTools.ACTOR_CALL}: MUST get input schema first (step="info" or ${HelperTools.ACTOR_GET_DETAILS}) before execution (step="call")
166-
- ${HelperTools.ACTOR_CALL}/Actor tools → ${HelperTools.ACTOR_OUTPUT_GET}: use datasetId from execution to retrieve full results
167-
- ${HelperTools.DOCS_SEARCH} followed by ${HelperTools.DOCS_FETCH}: search returns URLs, fetch retrieves full content
168-
169-
### Tool disambiguation:
170-
- ${HelperTools.ACTOR_OUTPUT_GET} vs ${HelperTools.DATASET_GET_ITEMS}: use ${HelperTools.ACTOR_OUTPUT_GET} for Actor run results; ${HelperTools.DATASET_GET_ITEMS} for direct dataset access
171-
- ${HelperTools.STORE_SEARCH} vs ${HelperTools.ACTOR_GET_DETAILS}: search finds Actors; ${HelperTools.ACTOR_GET_DETAILS} gets schema and README for specific Actor
172-
- Dedicated Actor tools (e.g., apify-slash-rag-web-browser) vs ${HelperTools.ACTOR_CALL}: prefer dedicated tools when available; use ${HelperTools.ACTOR_CALL} only for Actors without dedicated tools
173181
`;

0 commit comments

Comments
 (0)