Skip to content

Commit 92ce830

Browse files
committed
feat: update links to use ADMIN_BASE_PATH for consistency in skill documentation
1 parent 4a4f0be commit 92ce830

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

agent/systemPrompt.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ export async function buildAgentSystemPrompt(adminforth: IAdminForth) {
5757
listBundledSkillManifests(),
5858
]);
5959
const alwaysAvailableTools = ALWAYS_AVAILABLE_API_TOOL_NAMES.join(", ");
60+
const adminBasePath = adminforth.config.baseUrlSlashed;
6061
const sections = [
6162
DEFAULT_AGENT_SYSTEM_PROMPT,
62-
`BASE_URL: ${adminforth.config.baseUrl}`,
63+
`ADMIN_BASE_PATH: ${adminBasePath}`,
6364
`List of resources:\n${formatResources(adminforth.config.resources)}`,
6465
`You have always-available base tools: ${alwaysAvailableTools}.`,
6566
primarySkills.length > 0
@@ -76,6 +77,8 @@ export async function buildAgentSystemPrompt(adminforth: IAdminForth) {
7677
"If a fetched skill lists a non-base tool you need, call fetch_tool_schema for it immediately instead of telling the user the tool is unavailable.",
7778
"For example: for record creation load mutate_data, read its tool list, call fetch_tool_schema for create_record, and then use create_record after confirmation.",
7879
"When fetch_tool_schema succeeds, that tool becomes available on the next step.",
80+
"All admin links must be relative paths and must start with ADMIN_BASE_PATH.",
81+
"Build record links as ADMIN_BASE_PATH + resource/{resourceId}/show/{primary key}. Do not prepend any extra slash before resource.",
7982
"Try to call as many tools as possible in parallel in one step.",
8083
];
8184

custom/skills/fetch_data/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ To find specific data record you should use filters. ILIKE filters are preferred
1212

1313
For long texts show only several first words and add "..." at the end (only if user did not request this field specifically).
1414

15-
Also when you communicate with user about record, add related link to this record. For example /{BASE_URL}/resource/{resourceId}/show/{primary key}. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links shoudl be always relative path, starting with slash.
15+
Also when you communicate with user about record, add related link to this record. Build it as `{ADMIN_BASE_PATH}resource/{resourceId}/show/{primary key}`. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links should always be relative paths and must start with `ADMIN_BASE_PATH`. Do not add an extra slash after `ADMIN_BASE_PATH`.

custom/skills/mutate_data/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Use `start_custom_action` and `start_custom_bulk_action` for resource actions.
2121
Before performing any state mutation including action calls edit/delete please fetch record which is going to be edited/deleted and show user record in format field → value (show several most important fields which can help user to understand what exactly record he is going to edit or delete).
2222

2323
For field values with long texts show only several first words and add "..." at the end.
24-
Also please add related link to record with will be changed. For example /{BASE_URL}/resource/{resourceId}/show/{primary key}. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links shoudl be always relative path, starting with slash.
24+
Also please add related link to record with will be changed. Build it as `{ADMIN_BASE_PATH}resource/{resourceId}/show/{primary key}`. Use _label from `get_resource_data` as anchor text for link (use markdown link). Links should always be relative paths and must start with `ADMIN_BASE_PATH`. Do not add an extra slash after `ADMIN_BASE_PATH`.
2525

2626
And in the same message ask user for final confirmation.
2727

@@ -62,7 +62,7 @@ If you want to block some user you can confirm that this action by saying:
6262
* IP Country: USA
6363
* Currently blocked: No // show this field only if it exists in user record
6464
65-
View [John Doe](/resource/users/show/123)
65+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
6666
Are you sure?
6767
```
6868

@@ -85,7 +85,7 @@ I am going to update user:
8585
* IP Country: USA
8686
I am going to change email from john_doe@example.com to new_email@example.com
8787
88-
View [John Doe](/admin/resource/users/show/123)
88+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
8989
9090
Are you sure?
9191
```
@@ -105,7 +105,7 @@ If you gonna delete user record, in confirmation please share full user info (no
105105
* Signed up: 2024 Jan 1
106106
* IP Country: USA
107107
108-
View [John Doe](/admin/resource/users/show/123)
108+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/123)
109109
110110
Are you sure?
111111
```
@@ -130,7 +130,7 @@ I am going to create user:
130130
* Username: john_doe
131131
* Email: john_doe@example.com
132132
133-
View [John Doe](/admin/resource/users/show/421) # 421 is id of new created record
133+
View [John Doe]({ADMIN_BASE_PATH}resource/users/show/421) # 421 is id of new created record
134134
135135
Are you sure?
136136
```

0 commit comments

Comments
 (0)