Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib/common/markdown/Markdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

let innerText = '';
$: {
if (typeof text !== 'string') {
text = `${JSON.stringify(text)}`;
}
const markedText = !rawText ? replaceNewLine(marked(replaceMarkdown(text || ''))?.toString()) : marked(text || '')?.toString();
if (!!markedText && markedText.endsWith('<br>')) {
const idx = markedText.lastIndexOf('<br>');
Expand Down
1 change: 1 addition & 0 deletions src/lib/helpers/types/instructTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* @property {string} provider
* @property {string} model
* @property {string?} [template_name]
* @property {string?} [user_name]
* @property {string} user_message
* @property {string?} [system_instruction]
* @property {string} completion_text
Expand Down
1 change: 1 addition & 0 deletions src/lib/scss/custom/pages/_instruction.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
padding: 10px 5px;

.instruction-log-message {
margin-top: 10px;
overflow-y: auto;
max-height: 350px;
scrollbar-width: none;
Expand Down
8 changes: 6 additions & 2 deletions src/routes/page/conversation/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,12 @@
</div>
</CardBody>
{#if showStateSearch}
<CardBody class="border-bottom" style="display: flex; justify-content: flex-end;">
<StateSearch bind:states={states} onSearch={q => handleStateSearch(q)}/>
<CardBody class="border-bottom">
<Row class="g-3 justify-content-end">
<Col lg="6">
<StateSearch bind:states={states} onSearch={q => handleStateSearch(q)}/>
</Col>
</Row>
</CardBody>
{/if}
<CardBody class="border-bottom">
Expand Down
23 changes: 12 additions & 11 deletions src/routes/page/conversation/state-search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
>
{#each states as state, idx}
<div class="state-search-item">
<div>
<div style="flex: 1;">
<RemoteSearchInput
bind:value={state.key}
maxLength={maxLength}
onSearch={e => onSearch(e)}
placeholder="Search States"
/>
</div>
<div>
<div style="flex: 1;">
<Input
type="text"
bind:value={state.value}
Expand All @@ -67,15 +67,16 @@
</div>
{/each}
{#if states.length < limit}
<div>
<Button
color="link"
style="padding-left: 0px;"
on:click={() => addState()}
>
Add +
</Button>
</div>
<div class="d-flex justify-content-end">
<Button
color="link"
style="padding-left: 0px;"
on:click={() => addState()}
>
Add +
</Button>
<div style="flex: 0 0 13px;"></div>
</div>
{/if}
</div>

7 changes: 4 additions & 3 deletions src/routes/page/instruction/log/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@


<HeadTitle title="{$_('Instruction Log')}" />
<Breadcrumb pagetitle="{$_('Instruction Log')}" title="{$_('Instruction')}"/>
<Breadcrumb pagetitle="{$_('Log')}" title="{$_('Instruction')}"/>
<LoadingToComplete isLoading={isLoading} />

<Row>
Expand Down Expand Up @@ -260,9 +260,10 @@
<thead>
<tr>
<th scope="col" class="instruction-log-col ellipsis">{$_('Agent')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Provider')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Model')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Llm Provider')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Llm Model')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Template')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Caller')}</th>
<th scope="col" class="instruction-log-col ellipsis">{$_('Created Time')}</th>
<th scope="col">{$_('')}</th>
</tr>
Expand Down
1 change: 1 addition & 0 deletions src/routes/page/instruction/log/log-item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<td class="instruction-log-col ellipsis">{item.provider}</td>
<td class="instruction-log-col ellipsis">{item.model}</td>
<td class="instruction-log-col ellipsis">{item.template_name || 'N/A'}</td>
<td class="instruction-log-col ellipsis">{item.user_name || 'N/A'}</td>
<td class="instruction-log-col ellipsis">{utcToLocal(item.created_time)}</td>
<td>
<ul class="list-unstyled hstack gap-1 mb-0" style="justify-content: center;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import HeadTitle from '$lib/common/HeadTitle.svelte';
import Breadcrumb from '$lib/common/Breadcrumb.svelte';
import Markdown from '$lib/common/markdown/Markdown.svelte';
import InstructionState from './instruction-components/instruction-state.svelte';
import InstructionState from '../instruction-components/instruction-state.svelte';
import { getAgents } from '$lib/services/agent-service';
import LoadingToComplete from '$lib/common/LoadingToComplete.svelte';
import { sendChatCompletion } from '$lib/services/instruct-service';
import { getLlmConfigs } from '$lib/services/llm-provider-service';
import { LlmModelType } from '$lib/helpers/enums';
import NavBar from '$lib/common/nav-bar/NavBar.svelte';
import NavItem from '$lib/common/nav-bar/NavItem.svelte';
import InstructionTemplate from './instruction-components/instruction-template.svelte';
import InstructionLlm from './instruction-components/instruction-llm.svelte';
import InstructionTemplate from '../instruction-components/instruction-template.svelte';
import InstructionLlm from '../instruction-components/instruction-llm.svelte';
const maxLength = 64000;
const DEFAULT_PROVIDER = 'openai';
Expand Down Expand Up @@ -165,7 +165,7 @@
</script>
<HeadTitle title="{$_('Instruction')}" />
<Breadcrumb pagetitle="{$_('Instruction')}" title="{$_('Instruction')}"/>
<Breadcrumb pagetitle="{$_('Testing')}" title="{$_('Instruction')}"/>
<LoadingToComplete isLoading={isLoading} />
<div class="d-xl-flex">
Expand Down
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const config = {
"/page/agent/[agentId]",
"/page/agent/[agentId]/build",
"/page/agent/[agentId]/train",
"/page/instruction",
"/page/instruction/testing",
"/page/instruction/log",
"/page/conversation",
"/page/conversation/[conversationId]",
Expand Down