You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using OpenAI-compatible providers for agent modes, you can force Chat Completions API mode with `useComplitionApi: true`:
282
+
Each item in `modes` defines a user-selectable preset in the chat UI. The selected mode is sent to the backend and the plugin uses that mode's `completionAdapter` for the response.
283
+
284
+
The plugin adds a chat surface to the admin UI, keeps session history per admin user, and shows a mode picker when `modes` are configured.
285
+
286
+
# Using with self-hosted models
287
+
288
+
`CompletionAdapterOpenAIResponses` when works with agent plugin, under the hood uses the LangChain internal proxy called `OpenAIChat` (in LangChain they call it "provider"). This proxy is capable with a fresh versions of OpenAI-compatible Responses APIs, for example [self-hosted latest versions of vLLM installations](https://devforth.io/insights/self-hosted-gpt-real-response-time-token-throughput-and-cost-on-l4-l40s-and-h100-for-gpt-oss-20b/)
289
+
To use them, just point the adapter to your local vLLM server:
openAiApiKey: process.env.MY_API_KEYasstring, // if you use authorization
295
+
baseUrl: 'http://my_local_vllm_server:8000/v1',
296
+
model: 'gpt-oss-120b',
297
+
})
298
+
```
299
+
300
+
However some of 3rd party providers might serve outdated vLLM and still don't fully support the Responses API needed for langchain internal implmentation, for example [OVH AI Endpoints](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/) in Responses mode still don't play well with langchain proxy (25 Apr 2026)
301
+
302
+
In that case you can try to use the OpenAI Complition API mode of the plugin, which is less efficient but more compatible with older APIs, you can force Chat Completions API mode with `useComplitionApi: true`:
OVH AI Endpoints still does not fully support the OpenAI `responses` API, so `useComplitionApi: false` may work unstably there.
294
314
295
-
Each item in `modes` defines a user-selectable preset in the chat UI. The selected mode is sent to the backend and the plugin uses that mode's `completionAdapter` for the response.
296
315
297
-
The plugin adds a chat surface to the admin UI, keeps session history per admin user, and shows a mode picker when `modes` are configured.
316
+
317
+
318
+
## Writing own skills
319
+
320
+
You can write own skills by following [SKILL.md Agennt Skills](https://agentskills.io/)
321
+
322
+
For example we will write a skill which can summarizes backoffice data stats like record counts by resources and send it to user email.
323
+
324
+
It may handle prompts like
325
+
326
+
```
327
+
Please send record counts for all resources to my email
328
+
```
329
+
330
+
Or:
331
+
332
+
```
333
+
Please send record counts to all admin users
334
+
```
335
+
336
+
### Writing custom tools
337
+
338
+
To define a custom tool you should simply define an express API route in your app using `admin.express.withSchema` wrapper which makes the route available for the agent (clear and predictable schema is a crucial part of making the tool work well).
339
+
340
+
If you are using `admin.express.authorize` wrapper for authorization, adminuser will be injected atomatically from user which sits on the surface and controls the agent. In other words all permissions and access rights of the agent are defined by the admin user which is controlling this agent. At the same time all actions done by agent are automatically attributed in the audit log to the admin user which is controlling the agent.
341
+
342
+
This example uses the same email adapter pattern shown in the Email Invite and Email Password Reset plugins. The transport below uses Mailgun only to keep the snippet short; you can replace it with SES or any other adapter from [List of adapters](/docs/tutorial/ListOfAdapters/).
Each skill needs YAML frontmatter with `name` and `description`. The `description` is the discovery surface, so include the phrases the admin is likely to type in chat. Skills are not loaded automcatically, agent loads them
435
+
on demand once understands that `description` of the skill matches the user intent, so keep the description clear and concise.
436
+
437
+
Tools are also not loaded automatically, the agent loads them only if they are mentioned in the skill instructions. Then agent calls `fetch_tool_schema` meta tool to load actual schema of your custom tool.
438
+
439
+
Tool names are derived from route paths. If you want the tool name to be exactly `send_email_to_user`, register the route as `/send_email_to_user`.
440
+
441
+
The example below creates a minimal user skill which:
442
+
443
+
- resolves a user row
444
+
- reads the `total` count for each resource with `get_resource_data`
445
+
- sends the final report by email with `send_email_to_user`
description: Email record counts for each AdminForth resource to a user. Use when the user asks to send resource counts or all-record statistics by email.
453
+
---
454
+
455
+
# Involved tools
456
+
457
+
Use `send_email_to_user` to send the final report after you have one exact target user row.
458
+
459
+
# Instructions
460
+
461
+
- For each resource in system use fetch data default skill to collect total count of records in each resource.
462
+
- Create html report in format `Resource Label (resourceId): count` for each resource on a new line, sort resources by count in descending order.
463
+
- Use modern, stylish but compatible html formatting in the email.
464
+
- Call `send_email_to_user` with the resolved user primary key, the final subject, and the final plain text body.
465
+
- After the tool succeeds, tell the user the email was sent and include a short summary in chat.
466
+
```
467
+
468
+
This way allows to extend your agent with literally any custom instructions and tools and make it do complex tasks related to your backoffice data and operations.
469
+
470
+
471
+
## Standard skills
472
+
298
473
299
474
## Persistent checkpointer
300
475
@@ -559,17 +734,3 @@ services:
559
734

560
735
561
736
562
-
## Custom skills and tools
563
-
564
-
565
-
Place you skills in `custom/skills/<skill_name>/SKILL.md` file. The plugin will pick them up automatically and make available in agent's toolbox.
566
-
567
-
568
-
To define custom tools, create api endpoints, prefer `admin.express.withSchema(...)` from [Custom Pages / API docs](/docs/tutorial/Customization/customPages/). That exposes machine-readable request and response schemas the agent can use.
569
-
570
-
In skills markdown file, merge which tool exactlu agent should load.
0 commit comments