File tree Expand file tree Collapse file tree
chat/[agentId]/[conversationId]/rich-content
agent/[agentId]/agent-components
conversation/[conversationId] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555 * @typedef {Object } LlmModelSetting
5656 * @property {string } name
5757 * @property {string } type
58+ * @property {any } reasoning
5859 */
5960
6061
Original file line number Diff line number Diff line change 100100 < div class = " mb-3" > {message .text }< / div>
101101 {/ if }
102102 < div id= {` ${ scrollbarId} ` }>
103- < div id= {` chart-${ message? .message_id }` } style="min-width: 1000px; max-height: 500px;" ></div>
103+ < div id= {` chart-${ message? .message_id }` }></div>
104104 </div>
105105</div>
Original file line number Diff line number Diff line change 1212 export let handleAgentChange = () => {};
1313
1414 export const fetchLlmConfig = () => {
15+ const reasoningEffort = models .find (x => x .name === config .model )? .reasoning != null ? config .reasoning_effort_level : null ;
1516 return {
1617 ... config,
17- max_output_tokens: Number (config .max_output_tokens ) > 0 ? Number (config .max_output_tokens ) : null
18+ max_output_tokens: Number (config .max_output_tokens ) > 0 ? Number (config .max_output_tokens ) : null ,
19+ reasoning_effort_level: reasoningEffort
1820 };
1921 }
2022
3739 /** @type {import('$commonTypes').LlmModelSetting[]} */
3840 let models = [];
3941
42+ $: isReasoningModel = models .find (x => x .name === config .model )? .reasoning != null ;
43+
4044 onMount (async () => {
4145 await init ();
4246 });
6367 if (!!! provider) {
6468 models = [];
6569 config .model = null ;
70+ config .reasoning_effort_level = null ;
6671 handleAgentChange ();
6772 return ;
6873 }
181186 < / div>
182187 < / div>
183188
189+ {#if isReasoningModel}
184190 < div class = " mb-3 row" >
185191 < label for = " example-text-input" class = " col-md-3 col-form-label" >
186192 Reasoning effort
195201 < / Input>
196202 < / div>
197203 < / div>
204+ {/ if }
198205 < / CardBody>
199206< / Card>
Original file line number Diff line number Diff line change 11<script >
22 import Markdown from ' $lib/common/markdown/Markdown.svelte' ;
33 import { Button } from ' @sveltestrap/sveltestrap' ;
4+ import RcJsInterpreter from ' ../../../chat/[agentId]/[conversationId]/rich-content/rc-js-interpreter.svelte' ;
5+ import { RichType } from ' $lib/helpers/enums' ;
46
57 /** @type {import('$conversationTypes').ChatResponseModel} */
68 export let dialog;
1820 class =" fw-bold"
1921 class:text-collapse ={!! is_collapsed }
2022>
21- <Markdown
22- containerClasses ={' dialog-item-text' }
23- text ={dialog ?.rich_content ?.message ?.text || dialog ?.text }
24- rawText
25- />
23+ {#if dialog ?.rich_content ?.message ?.rich_type === RichType .ProgramCode
24+ && dialog ?.rich_content ?.message ?.language === ' javascript' }
25+ <RcJsInterpreter message ={dialog } scrollable />
26+ {:else }
27+ <Markdown
28+ containerClasses ={' dialog-item-text' }
29+ text ={dialog ?.rich_content ?.message ?.text || dialog ?.text }
30+ rawText
31+ />
32+ {/if }
2633</div >
2734
2835<Button
You can’t perform that action at this time.
0 commit comments