mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 03:12:42 +00:00
Add link understanding tool support (#1637)
* Add * Fix --------- Co-authored-by: Richard <dasilva333@DESKTOP-74E3GJO.localdomain>
This commit is contained in:
10
src/link-understanding/format.ts
Normal file
10
src/link-understanding/format.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export function formatLinkUnderstandingBody(params: { body?: string; outputs: string[] }): string {
|
||||
const outputs = params.outputs.map((output) => output.trim()).filter(Boolean);
|
||||
if (outputs.length === 0) {
|
||||
return params.body ?? "";
|
||||
}
|
||||
|
||||
const base = (params.body ?? "").trim();
|
||||
if (!base) return outputs.join("\n");
|
||||
return `${base}\n\n${outputs.join("\n")}`;
|
||||
}
|
||||
Reference in New Issue
Block a user