Support adustment of Temperature and SamplingFactor for incoming message.

This commit is contained in:
Haiping Chen 2023-09-11 12:09:41 -05:00
parent 54afdfef3e
commit d1ff4c0c3c
11 changed files with 127 additions and 137 deletions

View file

@ -1,73 +0,0 @@
<mxfile host="Electron" modified="2023-09-05T02:34:27.433Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.8 Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36" etag="9t635ybkj5y8Tzf_PMHD" version="21.6.8" type="device">
<diagram id="6jfvZ688tm8pOZHgqSFM" name="Page-1">
<mxGraphModel dx="1434" dy="836" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="kNc4F-3AqUrd7lAFkTx2-3" value="BotSharp&lt;br&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Agent&lt;br&gt;Conversation&lt;br&gt;Routing&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcc99;strokeColor=#36393d;fontStyle=1;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="345.71" y="340" width="214.29" height="60" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-7" value="&lt;b&gt;Phone&amp;nbsp;Voice&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="240" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-8" value="&lt;b&gt;Web Chat&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="360" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-9" value="&lt;b&gt;Message&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="474" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-10" value="&lt;b&gt;Open API&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="590" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-11" value="&lt;h1&gt;BotSharp AI Orchestration&lt;/h1&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="50" y="50" width="310" height="120" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-12" value="&lt;b&gt;Knowlege Base&lt;/b&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#eeeeee;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="270" y="670" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-13" value="&lt;b&gt;Knowledge&lt;/b&gt;&lt;br&gt;RAG" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="240" y="565" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-14" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="150" y="260" width="20" height="450" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-15" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="345.71" y="450" width="42.86" height="50" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-16" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="431.43" y="450" width="42.86" height="50" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-17" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="517.14" y="450" width="42.86" height="50" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-18" value="&lt;b&gt;Meta Messenger&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="381.43" y="565" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-19" value="&lt;b&gt;Data Storage&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="520" y="565" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-20" value="&lt;b&gt;Storage&lt;/b&gt;" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="550" y="680" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-22" value="&lt;b&gt;UI/ UX&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="250" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-25" value="&lt;b&gt;Kernel&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="355" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-26" value="&lt;b&gt;Agent&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="460" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-27" value="&lt;b&gt;Plugin&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="565" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-28" value="&lt;b&gt;Data Storage&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="680" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-29" value="&lt;b&gt;File Storage&amp;nbsp;&amp;nbsp;&lt;/b&gt;" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="397" y="680" width="88" height="60" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View file

@ -1,71 +1,80 @@
<mxfile host="Electron" modified="2023-09-04T04:15:39.989Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.8 Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36" etag="EYukBgFOzSkZaMHsrLLu" version="21.6.8" type="device">
<mxfile host="Electron" modified="2023-09-11T03:31:43.410Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.8 Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36" etag="lRrajK2n_0sEKLZhDFCg" version="21.6.8" type="device">
<diagram id="6jfvZ688tm8pOZHgqSFM" name="Page-1">
<mxGraphModel dx="1434" dy="836" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="1418" dy="820" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="kNc4F-3AqUrd7lAFkTx2-3" value="BotSharp&lt;br&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Agent&lt;br&gt;Conversation&lt;br&gt;Routing&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcc99;strokeColor=#36393d;fontStyle=1;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="345.71" y="340" width="214.29" height="60" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-7" value="&lt;b&gt;Phone&amp;nbsp;Voice&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-7" value="&lt;b&gt;Phone&amp;nbsp;Voice&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="240" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-8" value="&lt;b&gt;Web Chat&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-8" value="&lt;b&gt;Web Chat&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="360" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-9" value="&lt;b&gt;Message&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-9" value="&lt;b&gt;Message&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="474" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-10" value="&lt;b&gt;Open API&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-10" value="&lt;b&gt;Open API&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f9f7ed;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="590" y="240" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-11" value="&lt;h1&gt;BotSharp AI Orchestration&lt;/h1&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-11" value="&lt;h1&gt;BotSharp AI Orchestration&lt;/h1&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="50" y="50" width="310" height="120" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-12" value="&lt;b&gt;Knowlege Base&lt;/b&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#eeeeee;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="270" y="670" width="60" height="80" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-12" value="&lt;b&gt;Knowlege Base&lt;/b&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#eeeeee;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="300" y="735" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-13" value="&lt;b&gt;Knowledge&lt;/b&gt;&lt;br&gt;RAG" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="240" y="565" width="120" height="40" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-13" value="&lt;b&gt;Knowledge&lt;/b&gt;&lt;br&gt;RAG" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="270" y="640" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-14" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="150" y="260" width="20" height="450" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-14" value="" style="shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;labelPosition=left;verticalLabelPosition=middle;align=right;verticalAlign=middle;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="150" y="260" width="20" height="530" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-15" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-15" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="345.71" y="450" width="42.86" height="50" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-16" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-16" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="431.43" y="450" width="42.86" height="50" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-17" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-17" value="&lt;b&gt;&lt;br&gt;&lt;br&gt;Agent&lt;/b&gt;" style="shape=actor;whiteSpace=wrap;html=1;fillColor=#ffff88;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="517.14" y="450" width="42.86" height="50" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-18" value="&lt;b&gt;Meta Messenger&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="381.43" y="565" width="120" height="40" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-18" value="&lt;b&gt;Meta Messenger&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="411.43" y="640" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-19" value="&lt;b&gt;Data Storage&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="520" y="565" width="120" height="40" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-19" value="&lt;b&gt;Data Storage&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="550" y="640" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-20" value="&lt;b&gt;Storage&lt;/b&gt;" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="550" y="680" width="60" height="60" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-20" value="&lt;b&gt;Storage&lt;/b&gt;" style="shape=datastore;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="583" y="745" width="60" height="60" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-22" value="&lt;b&gt;UI/ UX&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-22" value="&lt;b&gt;UI/ UX&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="60" y="250" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-25" value="&lt;b&gt;Kernel&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-25" value="&lt;b&gt;Kernel&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="60" y="355" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-26" value="&lt;b&gt;Agent&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxCell id="9DShFkwYbzccSmdIPQ0x-26" value="&lt;b&gt;Agent&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="60" y="460" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-27" value="&lt;b&gt;Plugin&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="565" width="60" height="30" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-27" value="&lt;b&gt;Plugin&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="60" y="640" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-28" value="&lt;b&gt;Data Storage&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="60" y="680" width="60" height="30" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-28" value="&lt;b&gt;Data Storage&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="60" y="750" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="9DShFkwYbzccSmdIPQ0x-29" value="&lt;b&gt;File Storage&amp;nbsp;&amp;nbsp;&lt;/b&gt;" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;sketch=1;curveFitting=1;jiggle=2;" vertex="1" parent="1">
<mxGeometry x="397" y="680" width="88" height="60" as="geometry" />
<mxCell id="9DShFkwYbzccSmdIPQ0x-29" value="&lt;b&gt;File Storage&amp;nbsp;&amp;nbsp;&lt;/b&gt;" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.multi-document;whiteSpace=wrap;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="430" y="745" width="88" height="60" as="geometry" />
</mxCell>
<mxCell id="Nu5NWX8wfgGd1vgsjRF--1" value="" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;shape=mxgraph.aws3.step_functions;fillColor=#D9A741;gradientColor=none;" parent="1" vertex="1">
<mxGeometry x="381" y="530" width="65.39" height="80" as="geometry" />
</mxCell>
<mxCell id="Nu5NWX8wfgGd1vgsjRF--2" value="" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;shape=mxgraph.aws3.step_functions;fillColor=#D9A741;gradientColor=none;" parent="1" vertex="1">
<mxGeometry x="474" y="530" width="65.39" height="80" as="geometry" />
</mxCell>
<mxCell id="Nu5NWX8wfgGd1vgsjRF--4" value="&lt;b&gt;Functions&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;sketch=1;curveFitting=1;jiggle=2;" parent="1" vertex="1">
<mxGeometry x="60" y="555" width="60" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>

View file

@ -0,0 +1,29 @@
namespace BotSharp.Abstraction.Conversations.Models;
public class IncomingMessageModel
{
public string Text { get; set; } = string.Empty;
public virtual string Channel { get; set; } = string.Empty;
/// <summary>
/// Model name
/// </summary>
public virtual string ModelName { get; set; } = "gpt-3.5-turbo";
/// <summary>
/// The sampling temperature to use that controls the apparent creativity of generated completions.
/// </summary>
public float Temperature { get; set; } = 0.5f;
/// <summary>
/// An alternative value to Temperature, called nucleus sampling, that causes
/// the model to consider the results of the tokens with probability mass.
/// </summary>
public float SamplingFactor { get; set; } = 0.5f;
/// <summary>
/// Conversation states from input
/// </summary>
public List<string> States { get; set; } = new List<string>();
}

View file

@ -13,6 +13,7 @@ public class RoleDialogModel
public string CurrentAgentId { get; set; }
public string ModelName { get; set; } = "gpt-3.5-turbo";
public float Temperature { get; set; } = 0.5f;
public float SamplingFactor { get; set; } = 0.5f;
/// <summary>
/// Function name if LLM response function call

View file

@ -1,5 +1,6 @@
using BotSharp.Abstraction.Agents.Enums;
using BotSharp.Abstraction.Agents.Models;
using BotSharp.Abstraction.Conversations.Models;
using BotSharp.Abstraction.MLTasks;
using BotSharp.Abstraction.Templating;
@ -32,7 +33,9 @@ public partial class ConversationService
await HandleAssistantMessage(agent, new RoleDialogModel(AgentRole.Assistant, text)
{
CurrentAgentId = agent.Id,
Channel = wholeDialogs.Last().Channel
Channel = wholeDialogs.Last().Channel,
Temperature = wholeDialogs.Last().Temperature,
SamplingFactor = wholeDialogs.Last().SamplingFactor
}, onMessageReceived);
return false;
@ -53,7 +56,9 @@ public partial class ConversationService
await HandleAssistantMessage(agent, new RoleDialogModel(AgentRole.Assistant, fn.Content)
{
CurrentAgentId = fn.CurrentAgentId,
Channel = fn.Channel
Channel = fn.Channel,
Temperature = fn.Temperature,
SamplingFactor = fn.SamplingFactor
}, onMessageReceived);
return;
@ -65,7 +70,9 @@ public partial class ConversationService
CurrentAgentId = fn.CurrentAgentId,
Channel = fn.Channel,
ExecutionData = fn.ExecutionData,
ExecutionResult = fn.ExecutionResult
ExecutionResult = fn.ExecutionResult,
Temperature = fn.Temperature,
SamplingFactor = fn.SamplingFactor
}, onMessageReceived);
return;
@ -97,7 +104,9 @@ public partial class ConversationService
await HandleAssistantMessage(agent, new RoleDialogModel(AgentRole.Assistant, response)
{
CurrentAgentId = agent.Id,
Channel = wholeDialogs.Last().Channel
Channel = wholeDialogs.Last().Channel,
Temperature = wholeDialogs.Last().Temperature,
SamplingFactor = wholeDialogs.Last().SamplingFactor
}, onMessageReceived);
return;

View file

@ -41,9 +41,15 @@ public partial class ConversationService
// Interrupted by hook
if (lastDialog.StopCompletion)
{
var response = new RoleDialogModel(AgentRole.Assistant, lastDialog.Content);
await onMessageReceived(response);
_storage.Append(_conversationId, response);
var message = new RoleDialogModel(AgentRole.Assistant, lastDialog.Content)
{
CurrentAgentId = agent.Id,
Channel = lastDialog.Channel,
Temperature = lastDialog.Temperature,
SamplingFactor = lastDialog.SamplingFactor
};
await onMessageReceived(message);
_storage.Append(_conversationId, message);
return true;
}
}
@ -60,7 +66,9 @@ public partial class ConversationService
await HandleAssistantMessage(agent, new RoleDialogModel(AgentRole.Assistant, reasonedContext.Content)
{
CurrentAgentId = agent.Id,
Channel = lastDialog.Channel
Channel = lastDialog.Channel,
Temperature = lastDialog.Temperature,
SamplingFactor = lastDialog.SamplingFactor
}, onMessageReceived);
return true;
@ -70,7 +78,9 @@ public partial class ConversationService
await HandleAssistantMessage(agent, new RoleDialogModel(AgentRole.Assistant, reasonedContext.Content)
{
CurrentAgentId = agent.Id,
Channel = lastDialog.Channel
Channel = lastDialog.Channel,
Temperature = lastDialog.Temperature,
SamplingFactor = lastDialog.SamplingFactor
}, onMessageReceived);
return true;

View file

@ -53,7 +53,9 @@ public class ConversationController : ControllerBase, IApiAdapter
new RoleDialogModel("user", input.Text)
{
Channel = input.Channel,
ModelName = input.ModelName
ModelName = input.ModelName,
Temperature = input.Temperature,
SamplingFactor = input.SamplingFactor
},
async msg =>
{

View file

@ -1,13 +1,8 @@
using BotSharp.Abstraction.Conversations.Models;
namespace BotSharp.OpenAPI.ViewModels.Conversations;
public class NewMessageModel
public class NewMessageModel : IncomingMessageModel
{
public string Text { get; set; }
public string ModelName { get; set; } = "gpt-3.5-turbo";
public string Channel { get; set; } = "openapi";
/// <summary>
/// Conversation states from input
/// </summary>
public List<string> States { get; set; } = new List<string>();
public override string Channel { get; set; } = "openapi";
}

View file

@ -105,7 +105,9 @@ public class ChatCompletionProvider : IChatCompletion
CurrentAgentId = agent.Id,
FunctionName = message.FunctionCall.Name,
FunctionArgs = message.FunctionCall.Arguments,
Channel = conversations.Last().Channel
Channel = conversations.Last().Channel,
Temperature = conversations.Last().Temperature,
SamplingFactor = conversations.Last().SamplingFactor
};
// Somethings LLM will generate a function name with agent name.
@ -124,7 +126,9 @@ public class ChatCompletionProvider : IChatCompletion
var msg = new RoleDialogModel(AgentRole.Assistant, message.Content)
{
CurrentAgentId= agent.Id,
Channel = conversations.Last().Channel
Channel = conversations.Last().Channel,
Temperature = conversations.Last().Temperature,
SamplingFactor = conversations.Last().SamplingFactor
};
// Text response received
@ -226,8 +230,8 @@ public class ChatCompletionProvider : IChatCompletion
}
// https://community.openai.com/t/cheat-sheet-mastering-temperature-and-top-p-in-chatgpt-api-a-few-tips-and-tricks-on-controlling-the-creativity-deterministic-output-of-prompt-responses/172683
chatCompletionsOptions.Temperature = 0.5f;
chatCompletionsOptions.NucleusSamplingFactor = 0.5f;
chatCompletionsOptions.Temperature = conversations.Last().Temperature;
chatCompletionsOptions.NucleusSamplingFactor = conversations.Last().SamplingFactor;
var convSetting = _services.GetRequiredService<ConversationSetting>();
if (convSetting.ShowVerboseLog)

View file

@ -74,7 +74,10 @@ public class ChatbotUiController : ControllerBase, IApiAdapter
.Where(x => x.Role == AgentRole.User)
.Select(x => new RoleDialogModel(x.Role, x.Content)
{
Channel = channel
Channel = channel,
ModelName = input.ModelName,
Temperature = input.Temperature,
SamplingFactor = input.SamplingFactor
}).Last();
var conv = _services.GetRequiredService<IConversationService>();

View file

@ -1,23 +1,24 @@
using BotSharp.Abstraction.Conversations.Models;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace BotSharp.Plugin.ChatbotUI.ViewModels;
public class OpenAiMessageInput
public class OpenAiMessageInput : IncomingMessageModel
{
public string AgentId { get; set; }
public string ConversationId { get; set; }
public string Model { get; set; } = string.Empty;
public string AgentId { get; set; } = string.Empty;
public string ConversationId { get; set; } = string.Empty;
[JsonPropertyName("model")]
public override string ModelName { get; set; } = string.Empty;
public List<OpenAiMessageBody> Messages { get; set; } = new List<OpenAiMessageBody>();
[JsonPropertyName("max_tokens")]
public int MaxTokens { get; set; } = 4000;
public bool Stream { get; set; } = true;
public float Temperature { get; set; } = 0.9f;
/// <summary>
/// Conversation states from input
/// </summary>
public List<string> States { get; set; } = new List<string>();
public override string ToString()
{