Skip to content

Commit 55d1776

Browse files
densumeshvid277
authored andcommitted
feature: add tool configuration to dashboard
1 parent d64806d commit 55d1776

File tree

6 files changed

+259
-4
lines changed

6 files changed

+259
-4
lines changed

clients/ts-sdk/openapi.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12347,6 +12347,14 @@
1234712347
"description": "The temperature to use",
1234812348
"nullable": true
1234912349
},
12350+
"TOOL_CONFIGURATION": {
12351+
"allOf": [
12352+
{
12353+
"$ref": "#/components/schemas/ToolConfiguration"
12354+
}
12355+
],
12356+
"nullable": true
12357+
},
1235012358
"USE_MESSAGE_TO_QUERY_PROMPT": {
1235112359
"type": "boolean",
1235212360
"description": "Whether to use the message to query prompt",
@@ -17524,6 +17532,31 @@
1752417532
"lte": 1
1752517533
}
1752617534
},
17535+
"QueryToolOptions": {
17536+
"type": "object",
17537+
"properties": {
17538+
"max_price_option_description": {
17539+
"type": "string",
17540+
"nullable": true
17541+
},
17542+
"min_price_option_description": {
17543+
"type": "string",
17544+
"nullable": true
17545+
},
17546+
"price_filter_description": {
17547+
"type": "string",
17548+
"nullable": true
17549+
},
17550+
"query_parameter_description": {
17551+
"type": "string",
17552+
"nullable": true
17553+
},
17554+
"tool_description": {
17555+
"type": "string",
17556+
"nullable": true
17557+
}
17558+
}
17559+
},
1752717560
"QueryTypes": {
1752817561
"oneOf": [
1752917562
{
@@ -22694,6 +22727,19 @@
2269422727
],
2269522728
"description": "Specifies which tokenizer to use for the chunking process.\n\nThis type supports two ways of specifying a tokenizer:\n1. Using a predefined tokenizer from the `Tokenizer` enum\n2. Using any Hugging Face tokenizer by providing its model ID as a string\n(e.g. \"facebook/bart-large\", \"Qwen/Qwen-tokenizer\", etc.)\n\nWhen using a string, any valid Hugging Face tokenizer ID can be specified,\nwhich will be loaded using the Hugging Face tokenizers library."
2269622729
},
22730+
"ToolConfiguration": {
22731+
"type": "object",
22732+
"properties": {
22733+
"query_tool_options": {
22734+
"allOf": [
22735+
{
22736+
"$ref": "#/components/schemas/QueryToolOptions"
22737+
}
22738+
],
22739+
"nullable": true
22740+
}
22741+
}
22742+
},
2269722743
"ToolFunction": {
2269822744
"type": "object",
2269922745
"description": "Function for a LLM tool call",

clients/ts-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"files": [
1818
"dist"
1919
],
20-
"version": "0.0.117",
20+
"version": "0.0.118",
2121
"license": "MIT",
2222
"scripts": {
2323
"lint": "eslint 'src/**/*.ts'",

clients/ts-sdk/src/types.gen.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,7 @@ export type DatasetConfigurationDTO = {
14541454
* The temperature to use
14551455
*/
14561456
TEMPERATURE?: (number) | null;
1457+
TOOL_CONFIGURATION?: ((ToolConfiguration) | null);
14571458
/**
14581459
* Whether to use the message to query prompt
14591460
*/
@@ -3308,6 +3309,14 @@ export type QueryRatingRange = {
33083309
lte?: (number) | null;
33093310
};
33103311

3312+
export type QueryToolOptions = {
3313+
max_price_option_description?: (string) | null;
3314+
min_price_option_description?: (string) | null;
3315+
price_filter_description?: (string) | null;
3316+
query_parameter_description?: (string) | null;
3317+
tool_description?: (string) | null;
3318+
};
3319+
33113320
/**
33123321
* Query is the search query. This can be any string. The query will be used to create an embedding vector and/or SPLADE vector which will be used to find the result set. You can either provide one query, or multiple with weights. Multi-query only works with Semantic Search and is not compatible with cross encoder re-ranking or highlights.
33133322
*/
@@ -4615,6 +4624,10 @@ export type TokenizerType = {
46154624
String: string;
46164625
};
46174626

4627+
export type ToolConfiguration = {
4628+
query_tool_options?: ((QueryToolOptions) | null);
4629+
};
4630+
46184631
/**
46194632
* Function for a LLM tool call
46204633
*/

frontends/dashboard/src/components/dataset-settings/LLMSettings.tsx

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,202 @@ export const LLMSettings = (props: {
484484
</div>
485485
</div>
486486
</div>
487+
488+
{/* Tool Settings */}
489+
<div class="mt-6">
490+
<span>
491+
<h2 class="flex items-center gap-2 text-lg font-semibold leading-6">
492+
Tool Settings
493+
<Tooltip
494+
body={<AiOutlineInfoCircle />}
495+
tooltipText="Tools are used to configure the prompt which is used to transform user prompts into search queries which hit the retrieval sub-system."
496+
/>
497+
</h2>
498+
<hr class="mt-2" />
499+
</span>
500+
501+
<div class="mt-4 grid grid-cols-4 gap-x-6 gap-y-3">
502+
<div class="col-span-4 sm:col-span-2">
503+
<label
504+
for="messageToQueryPrompt"
505+
class="flex items-center gap-2 text-sm font-medium leading-6"
506+
>
507+
Query Tool Description
508+
<Tooltip
509+
body={<AiOutlineInfoCircle />}
510+
tooltipText="Description of the query tool. This will be used to describe the query tool to the LLM."
511+
/>
512+
</label>
513+
<textarea
514+
value={
515+
props.serverConfig()?.TOOL_CONFIGURATION?.query_tool_options
516+
?.tool_description ?? ""
517+
}
518+
onInput={(e) =>
519+
props.setServerConfig((prev) => {
520+
return {
521+
...prev,
522+
TOOL_CONFIGURATION: {
523+
...prev.TOOL_CONFIGURATION,
524+
query_tool_options: {
525+
...prev.TOOL_CONFIGURATION?.query_tool_options,
526+
tool_description: e.currentTarget.value,
527+
},
528+
},
529+
};
530+
})
531+
}
532+
rows="4"
533+
name="queryToolDescription"
534+
id="queryToolDescription"
535+
class="block w-full rounded-md border-[0.5px] border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
536+
/>
537+
</div>
538+
539+
<div class="col-span-4 sm:col-span-2">
540+
<label
541+
for="queryParameterDescription"
542+
class="flex items-center gap-2 text-sm font-medium leading-6"
543+
>
544+
Query Parameter Description
545+
<Tooltip
546+
body={<AiOutlineInfoCircle />}
547+
tooltipText="Description of the query parameter. This will be used to describe the query parameter to the LLM."
548+
/>
549+
</label>
550+
<textarea
551+
value={
552+
props.serverConfig()?.TOOL_CONFIGURATION?.query_tool_options
553+
?.query_parameter_description ?? ""
554+
}
555+
onInput={(e) =>
556+
props.setServerConfig((prev) => {
557+
return {
558+
...prev,
559+
TOOL_CONFIGURATION: {
560+
...prev.TOOL_CONFIGURATION,
561+
query_tool_options: {
562+
...prev.TOOL_CONFIGURATION?.query_tool_options,
563+
query_parameter_description: e.currentTarget.value,
564+
},
565+
},
566+
};
567+
})
568+
}
569+
rows="4"
570+
name="queryParameterDescription"
571+
id="queryParameterDescription"
572+
class="block w-full rounded-md border-[0.5px] border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
573+
/>
574+
</div>
575+
<div class="col-span-4 sm:col-span-2">
576+
<label
577+
for="priceFilterDescription"
578+
class="flex items-center gap-2 text-sm font-medium leading-6"
579+
>
580+
Price Filter Description
581+
<Tooltip
582+
body={<AiOutlineInfoCircle />}
583+
tooltipText="Description of the price filter. This will be used to describe the price filter to the LLM."
584+
/>
585+
</label>
586+
<textarea
587+
value={
588+
props.serverConfig().TOOL_CONFIGURATION?.query_tool_options
589+
?.price_filter_description ?? ""
590+
}
591+
onInput={(e) =>
592+
props.setServerConfig((prev) => {
593+
return {
594+
...prev,
595+
TOOL_CONFIGURATION: {
596+
...prev.TOOL_CONFIGURATION,
597+
query_tool_options: {
598+
...prev.TOOL_CONFIGURATION?.query_tool_options,
599+
price_filter_description: e.currentTarget.value,
600+
},
601+
},
602+
};
603+
})
604+
}
605+
rows="4"
606+
name="priceFilterDescription"
607+
id="priceFilterDescription"
608+
class="block w-full rounded-md border-[0.5px] border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
609+
/>
610+
</div>
611+
<div class="col-span-4 sm:col-span-2">
612+
<label
613+
for="maxPriceOptionDescription"
614+
class="flex items-center gap-2 text-sm font-medium leading-6"
615+
>
616+
Max Price Option Description
617+
<Tooltip
618+
body={<AiOutlineInfoCircle />}
619+
tooltipText="Description of the max price option. This will be used to describe the max price option to the LLM."
620+
/>
621+
</label>
622+
<textarea
623+
value={
624+
props.serverConfig()?.TOOL_CONFIGURATION?.query_tool_options
625+
?.max_price_option_description ?? ""
626+
}
627+
onInput={(e) =>
628+
props.setServerConfig((prev) => {
629+
return {
630+
...prev,
631+
TOOL_CONFIGURATION: {
632+
...prev.TOOL_CONFIGURATION,
633+
query_tool_options: {
634+
...prev.TOOL_CONFIGURATION?.query_tool_options,
635+
max_price_option_description: e.currentTarget.value,
636+
},
637+
},
638+
};
639+
})
640+
}
641+
name="maxPriceOptionDescription"
642+
id="maxPriceOptionDescription"
643+
class="block w-full rounded-md border-[0.5px] border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
644+
/>
645+
</div>
646+
<div class="col-span-4 sm:col-span-2">
647+
<label
648+
for="minPriceOptionDescription"
649+
class="flex items-center gap-2 text-sm font-medium leading-6"
650+
>
651+
Min Price Option Description
652+
<Tooltip
653+
body={<AiOutlineInfoCircle />}
654+
tooltipText="Description of the min price option. This will be used to describe the min price option to the LLM."
655+
/>
656+
</label>
657+
<textarea
658+
value={
659+
props.serverConfig()?.TOOL_CONFIGURATION?.query_tool_options
660+
?.min_price_option_description ?? ""
661+
}
662+
onInput={(e) =>
663+
props.setServerConfig((prev) => {
664+
return {
665+
...prev,
666+
TOOL_CONFIGURATION: {
667+
...prev.TOOL_CONFIGURATION,
668+
query_tool_options: {
669+
...prev.TOOL_CONFIGURATION?.query_tool_options,
670+
min_price_option_description: e.currentTarget.value,
671+
},
672+
},
673+
};
674+
})
675+
}
676+
name="minPriceOptionDescription"
677+
id="minPriceOptionDescription"
678+
class="block w-full rounded-md border-[0.5px] border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
679+
/>
680+
</div>
681+
</div>
682+
</div>
487683
</div>
488684
</div>
489685
</form>

frontends/dashboard/src/pages/dataset/PublicPageSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ const PublicPageControls = () => {
714714
typeof q === "string"
715715
? q
716716
: q.query
717-
? q.query + "," + (q.imageUrl ?? "")
718-
: q.query ?? "",
717+
? q.query + "," + (q.imageUrl ?? "")
718+
: q.query ?? "",
719719
) || []
720720
}
721721
onChange={(e) => {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7830,7 +7830,7 @@ solid-use@^0.9.0:
78307830
resolved "https://registry.npmjs.org/solid-use/-/solid-use-0.9.1.tgz"
78317831
integrity sha512-UwvXDVPlrrbj/9ewG9ys5uL2IO4jSiwys2KPzK4zsnAcmEl7iDafZWW1Mo4BSEWOmQCGK6IvpmGHo1aou8iOFw==
78327832

7833-
source-map-js@^1.0.1:
7833+
source-map-js@^1.0.1, source-map-js@^1.2.1:
78347834
version "1.2.1"
78357835
resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz"
78367836
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==

0 commit comments

Comments
 (0)