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
1 change: 1 addition & 0 deletions src/lib/helpers/types/agentTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @property {string?} provider
* @property {string?} model
* @property {number} max_recursion_depth
* @property {number?} [max_output_tokens]
*/


Expand Down
1 change: 1 addition & 0 deletions src/routes/page/agent/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
filter = {
pager: initFilter.pager,
types: selectedAgentTypes?.length > 0 ? selectedAgentTypes : null,
labels: selectedAgentLabels?.length > 0 ? selectedAgentLabels : null,
similarName: event.payload || null
};
getPagedAgents();
Expand Down
6 changes: 5 additions & 1 deletion src/routes/page/agent/[agentId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@
utilities: agent.utilities || [],
knowledge_bases: agent.knowledge_bases || [],
rules: agent.rules || [],
max_message_count: Number(agent.max_message_count) > 0 ? Number(agent.max_message_count) : null
max_message_count: Number(agent.max_message_count) > 0 ? Number(agent.max_message_count) : null,
llm_config: {
...agent.llm_config,
max_output_tokens: Number(agent.llm_config.max_output_tokens) > 0 ? Number(agent.llm_config.max_output_tokens) : null
}
};
isLoading = true;
saveAgent(agent).then(res => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
/** @type {import('$commonTypes').LlmModelSetting[]} */
let models = [];

const lowerLimit = 1;
const upperLimit = 10;
const recursiveDepthLowerLimit = 1;
const recursiveDepthUpperLimit = 10;

let config = agent.llm_config;

Expand Down Expand Up @@ -59,14 +59,20 @@
function changeMaxRecursiveDepth(e) {
let value = Number(e.target.value) || 0;

if (value < lowerLimit) {
value = lowerLimit;
} else if (value > upperLimit) {
value = upperLimit;
if (value < recursiveDepthLowerLimit) {
value = recursiveDepthLowerLimit;
} else if (value > recursiveDepthUpperLimit) {
value = recursiveDepthUpperLimit;
}

config.max_recursion_depth = value;
}

/** @param {any} e */
function changeMaxOutputToken(e) {
const value = Number(e.target.value) || 0;
config.max_output_tokens = value;
}
</script>

<Card>
Expand Down Expand Up @@ -113,11 +119,25 @@
<Input
style="text-align: center;"
type="number"
min={lowerLimit}
max={upperLimit}
min={recursiveDepthLowerLimit}
max={recursiveDepthUpperLimit}
value={config.max_recursion_depth}
on:change={e => changeMaxRecursiveDepth(e)}
/>
/>
</div>
</div>

<div class="mb-3 row">
<label for="example-text-input" class="col-md-3 col-form-label">
Max output tokens
</label>
<div class="col-md-9">
<Input
style="text-align: center;"
type="number"
value={config.max_output_tokens}
on:change={e => changeMaxOutputToken(e)}
/>
</div>
</div>
</CardBody>
Expand Down