瀏覽代碼

enh: enable tools with url search param

Timothy J. Baek 9 月之前
父節點
當前提交
67efd0dd39
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/lib/components/chat/Chat.svelte

+ 4 - 0
src/lib/components/chat/Chat.svelte

@@ -282,6 +282,10 @@
 
 		if ($page.url.searchParams.get('q')) {
 			prompt = $page.url.searchParams.get('q') ?? '';
+			selectedToolIds = ($page.url.searchParams.get('tool_ids') ?? '')
+				.split(',')
+				.map((id) => id.trim())
+				.filter((id) => id);
 
 			if (prompt) {
 				await tick();